I am working on an elevation profile chart.
I have a list of 200 distance-points given.: "distancePoints" : [0,222.22,433.3,620.44,822.24,1001.55 ... 5022.56
There a many unlovely values as labels on the categoryAxis like 5022.56, 10022.2 and so on... (see screenshot1).
Is there a possibilty to change the labels on the categroryAxis like 5000, 10000 and so on... (see screenshot2) without changing the list of distancePoints?
Thanks for helping.
5 Answers, 1 is accepted
You could use template to round the displayed values without modifying the data - example.
Thanks for the answer, but I still have a problem. I need distance ticks all 100 or 200 or 1000 meters. The Points are given "distancePoints" : [0,222.22,433.3,620.44,822.24,1001.55 ... 5022.56]. How can I add a meaningful category axis, with rounded values, like 200, 400, ....2000 I tried to add a second category axis, but the it isn't precise enough. The second axis values are always behind the correct points.(see screenshot 4). The second category axis values are never correct. Is there maybe a function for that?
I am not sure if I understand the requirement but if you need to show only the labels from the second image and they are equally spaced then you could round the values and set step for the labels - example.
Generally, the category axis does not support placing the categories based on their numeric value. You might consider using scatterLine chart instead which has numeric x axis if this is the requirement.
Thank you very much Daniel.
I think scatterLine is the solution. Thanks for that hint