Home › forums › Using CanvasJS › Dynamic Grah Implementation
This topic contains 3 replies, has 2 voices, and was last updated by SwapnilV007 5 years ago.
I am trying to implement dynamic graph.
Here is the sample jsfiddle.
The graph does not run as I expect for first 60 seconds. But after 60 seconds; it runs as per my expections. I want to run it something differently for first 60 seconds.
To see how I expect it to run for first 60 seconds ; see this fiddle.
Only difference in both the codes is definition of minimum:0 and maximum:60 for X axis in second fiddle link.
Also I do not want to show the X axis labels as 12,24,36,48,60 that appear in second fiddle example. Initially I want those labels blanks. Later I am going to fill those labels as seen in the graph.
How can I achieve this?
In order to hide values on axis you can set the property ValueFormatString to empty string. Here is the update code. You can combine it with your first fiddle to get the expected result.
Using valueFormatString will solve the issue of hiding X axis values initially. But the graph in this jsfiddle does not shift towards left after initial 60 seconds. I expect this graph to shft after initial 60 seconds similar to this jsfiddle. Both codes are similar except that definition of minimum:0 and maximum:60 for X axis is not there in second fiddle.
How I should proceed further to get the combined result?
I was able to achieve the desired result using below api’s.
chart.options.axisX.maximum = null;
Using these api’s sets X-axis minimum and maximum values to null(default) after 60 seconds and then X-axis values start shifting.
Thanks for your valuable inputs and time.
You must be logged in to reply to this topic.