Home › forums › Using CanvasJS › labels in x-axis and color formatting different series
This topic contains 3 replies, has 2 voices, and was last updated by Sunil Urs 5 years, 5 months ago.
I have 96 labels in x-axis and I would like to display all of them, is there any way to enforce all the labels being displayed??? Currently only 20 or so labels are being shown.
Also, I am creating a stepline chart with multiple series, I would like to specify the color for each series differently. When I provide the color for the data array, tooltip shows the correct color, but not the legend and the lines for each series in the chart. If I don’t provide the colors in my data, automatically each series has its own color(default defined), shows correctly in the legend and tool tip. Is this a bug??
Any help would be appreciated. Thanks!!!
I got the color part figured out, it was my mistake wasn’t providing the it correctly. Still have issues with displaying all the 96 labels though. Also, is there any way to update the datapoints or a series for a chart that is being displayed through a function???
I have the 96 labels to show up in x-axis by providing label. I’m still struggling with updating series dynamically. I have a global object defined in my code and I keep updating the global object, and render the chart, for some reason, when I look at the chart obj, I still see the old data points and series and not new one. Is there any method that will update the data points or series dynamically??
Any help is appreciated, Thanks.
I can surely help you with the update issue. But without looking at the code I won’t be able to figure out the problem. Can you please create a JSFiddle that demonstrates the issue – this way I can fix the issue right away.
Tip: Just make sure that you are updating the object and not assigning a new object to the variable each time.
When it comes to displaying 96 labels, don’t you think they’ll start overlapping with so many of them? If you are sure that you have enough space, here is what I suggest
1. Set labelAngle to 90 (or -89.99).
2. Reduce labelFontSize if required.
3. Set axisX interval to 1
If you have problem implementing any of the above, please create a JSFiddle so that I can I can fix it right away.
You must be logged in to reply to this topic.