Home › forums › Using CanvasJS › How to Plot Complete Date and Time On X axis
This topic contains 8 replies, has 2 voices, and was last updated by SwapnilV007 3 years, 9 months ago.
I am trying to plot date and time on X axis. I am able to do so using “labels”. But I dont want to show date and time in single line. Instead I want to show Date on 1 line and below that date corresponding time. Is there a way to do it?
Please let me know if there is any solution to do so.
You can do so by using labelMaxWidth property which allows you to set the maximum width of label as required.Here is a jsfiddle can help you.
Thanks for your reply.
Setting labelMaxWidth solved my problem.
But now I see another issue. The last Label on X axis is not shown completely.
You can see this issue in sample jsfiddle given by you also.
Please let me know if there is any work around to show this label also.
You can try reducing the font size of label by using the property labelFontSize.
Reducing font size of label does not help. Still the labels are not shown completely.
I tried it with your sample example also. But it does not work there too.
After reducing the fontSize of label, if last value is not showing properly then you can use labelangle property.
Changing the angle does not suit my requirement. I am supposed to show the labels Horizontally without changing there orientation.
Is there any other solution to solve this issue?
As of now changing labelAngle is the only solution for this. We’ll look into this issue in future version.
Thanks for the reply. When can I expect the next version that will have this issue fixed.
You must be logged in to reply to this topic.