xaxis tickAmount auto adjustment
See original GitHub issueHi there!
Is there any way to make the xaxis’ tickAmount adjust itself to the series data length (minus 1 for the ticks to be aligned with the labels) in case there is only one serie or two series with the same length present on the Spline Area Charts options object?
I did try leaving it on undefined but, it didn’t worked as the ticks remained on different coordinates in relation to the x-axis while making the xaxis.type = “categories” and sending the chart two series with the same length (without them having to necessarily be “datetime” objects).
I did find a workaround by calculating the xaxis.tickAmount as array.length - 1
and leaving the padding on 0
for the chart to begin and end it’s path on the elements xaxis limits but, I would like to know if there is a cleaner way to do this rather than calculating the ticks with a formula.
Thank you!
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Ok, got your point.
I have added an option in
xaxis.tickAmount: 'dataPoints'
which will set the tickAmount to the number of datapoints in the series.You will have to config your xaxis like this
The additional
hideOverlappingLabels: false
will prevent hiding some labels if they overlap (ashideOverlappingLabels
is true by default)This will be released in v2.1.5 in core apexcharts library.
Got it, thank you! @junedchhipa