You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know that it's possible to add regions this this... chart.regions.add({axis: 'x', start: 1 end: 3, class: "X"});
and them remove them like this: $(".c3-regions .X").remove()
But this is unsuitable because if you go to add a new region, c3js still "remembers" the removed ones. This will show both region X (which has been removed with CSS) and region Y ...
You can do this, actually, using the .regions(arrayOfRegions) method, which replaces the current set of regions with the provided set:
chart.regions([{axis:'x', start:4, end:12, class:'active-region'}]); // clears all regions, adds a region on x-axis from 4 to 12
chart.regions([]); // clears all regions
Hi,
Would it be possible to add functionality to add/remove regions dynamically? I see that this is not supported from http://c3js.org/reference.html#api-load
I know that it's possible to add regions this this... chart.regions.add({axis: 'x', start: 1 end: 3, class: "X"});
and them remove them like this: $(".c3-regions .X").remove()
But this is unsuitable because if you go to add a new region, c3js still "remembers" the removed ones. This will show both region X (which has been removed with CSS) and region Y ...
chart.regions.add({axis: 'x', start: '4', end: '7', class: 'regionY'})
Thanks!
The text was updated successfully, but these errors were encountered: