c3 icon indicating copy to clipboard operation
c3 copied to clipboard

Unable to update the x ticks dynamically in a line chart

Open aditya-padhi-kbl opened this issue 9 years ago • 2 comments

C3 version: "0.4.18" D3 version: 3.5.6 Browser: Version 61.0.3163.100 (Official Build) (64-bit) (Google Chrome) OS: The operating system. (Windows 10)

Hi,

I am trying to update the x-axis ticks dynamically as I will be getting them in an ajax calls.

Just for clarification In one instance I will get x-axis tick values as ['2013-01-01', '2013-01-02', ......] And after some interval I will get as ['2013-02-02', '2013-03-04',.....]

Hence I need to update the x-ticks dynamically I am trying the same scenario in http://c3js.org/samples/timeseries.html inside a setTimeOut function.

However I am not able to understand the way to proceed.

Please let me know if you need more information from my side

aditya-padhi-kbl avatar Oct 15 '17 03:10 aditya-padhi-kbl

I am also interested in this. I have a chart and when it is on a small width I show only 5 tick values on the x axis. I would like when enlarged to fullscreen to display 15 tick values instead of 5. Any ideas?

crauliuc avatar Nov 06 '17 21:11 crauliuc

chart_name.internal.config.axis_x_tick_values=['08/01/2017']; chart_name.flush();

Worked for me right now.

crauliuc avatar Nov 06 '17 23:11 crauliuc