Allow custom domain and padding in yScale in LineChart #41255
Labels
[JS Package] Charts
[Pri] Normal
[Type] Enhancement
Changes to an existing feature — removing, adding, or changing parts of it
Impacted plugin
None / Other
What
I would like to specify custom
domain
for the yScale in LineChart so that it appears nicer for my use case.How
Currently the
yScale
for the LineChart is set like this:jetpack/projects/js-packages/charts/src/components/line-chart/line-chart.tsx
Line 127 in 92cd80b
The code generates line charts like these:
[13000, 14000, 15000]
, the y-axis will start at 0, and there would be a big space gap between the line series and the bottom x-axis.In WooCommerce Analytics, we would like to achieve a line chart like this:
We have an implementation that works like this:
The above produces a line chart with yScale like this:
It would be great if we can incorporate this into LineChart component.
The text was updated successfully, but these errors were encountered: