Draw BarChart and LineChart from 0#107
Conversation
|
Maybe this could be behind a prop, like The reason why the range currently starts from the minimum value is that in case if the values are too large, then it's difficult to show the difference between values on a range starting from zero. And graphs are all about the difference between values. |
That's right! I agree that it's necessary to show the difference between the values even if those are too large. But that is usually solved by providing the way to configure the min/max value of y axis label not by drawing charts from the minimum value. So we can chose some choices:
How about your opinion 🤔 In any case, I'll try to fix it!! |
|
Choice 2 looks good to me. No breaking changes. |
|
@k-yokoishi Thank you for you input ❤️ |
|
Not at all! I'll fix it with the 2nd choice. |
Add prop `fromZero` to BarChart and LineChart to render the charts from 0 not from the minimum value.
|
Nice! I'll take a closer look soon 👍 |
|
Please re-review it and try new props, thanks. |
|
As usual, great job @k-yokoishi! I appreciate it 😄 |
|
Available in v2.6.0 |
It's a proposal to make
BarChartandLineChartmore general UI of the chart.Currently, the bar chart and the line chart are drawn from the minimum value as follows,
however generally these charts are drawn from 0 by default, so I modified it in this PR like below.