Skip to content

Fix BarChart that has negative value#101

Merged
Hermanya merged 1 commit into
chart-kit:masterfrom
k-yokoishi:fix/bar-chart-has-negative-val
Apr 13, 2019
Merged

Fix BarChart that has negative value#101
Hermanya merged 1 commit into
chart-kit:masterfrom
k-yokoishi:fix/bar-chart-has-negative-val

Conversation

@k-yokoishi

Copy link
Copy Markdown
Contributor

If the data in BarChart is like below,

<BarChart
  width={width}
  height={height}
  data={[-50, -20, -2, 86, 71, 100]}
  chartConfig={chartConfig}
  style={graphStyle}
/>

currently the bar chart is rendered as follow.

current-bar-chart

It's not correct bar chart. The negative numbers are usually rendered like below, thus I fixed it in this MR.

fixed-bar-chart

Related issue: #93

When the data is negative value in BarChart,
the corresponding bar is rendered to downward from 0.
@Hermanya

Hermanya commented Apr 1, 2019

Copy link
Copy Markdown
Contributor

thanks, I'll take a look

@Hermanya Hermanya merged commit 49eea87 into chart-kit:master Apr 13, 2019
@Hermanya

Copy link
Copy Markdown
Contributor

this is available in v2.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants