-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xaxis tickAmount auto adjustment #18
Comments
Is your xaxis type category or numeric or datetime? If you can post what you've tried (in a codepen) and what result you're looking for, I can provide more insights. |
Hi there @junedchhipa, Here it is: https://codepen.io/andresumanzor/pen/ePGgao As you can see, the tickAmount is currently set on 17 which makes the graph look as expected so, is there any way I can set the graph to get that value automatically? As for example for it to take the first series' object in order to be able to get the object data's length and set that as the chart's tickAmount? Just as Or as well, for the chart to take the higher data length value on its series in order to set that as its tickAmount value? Thank you! |
Ok, got your point. I have added an option in You will have to config your xaxis like this xaxis: {
type: 'datetime',
tickAmount: 'dataPoints',
labels: {
hideOverlappingLabels: false
}
} The additional This will be released in v2.1.5 in core apexcharts library. |
This is great, thank you so much @junedchhipa! Just to verify, this will work as well for the react npm version right? |
The update will be for core apexcharts library. So, in your react-project, you will have to run |
Got it, thank you! @junedchhipa |
Hi 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 on0
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!
The text was updated successfully, but these errors were encountered: