c3 icon indicating copy to clipboard operation
c3 copied to clipboard

Change axis config when some event on page was occured

Open k010 opened this issue 11 years ago • 1 comments

There's a way to change the x axis config and redraw c3 once it's was generated ?? I need to change the rotation of x axis label and change the x tick .height when i made some event in the page.

For example: when the data was changed, and now the data description for x axis is more large, i would like to rotate the x axis and change the x axis height

The only way that i found was

Config:


c3Chart.generate({
...
axis: {
    x: {
      type: 'category',
      height: 30,
      tick: {
        rotate: 0,
        multiline: false
      }
    }
...
})

some event was ocurred in the page, for example the data was updated...

...
function pageEvent(newData) {
   c3Chart.internal.config.axis_x_height = 100;
   c3Chart.internal.config.axis_x_tick_rotate = 60;
   c3Chart.flush();
   c3Chart.load(newData);
}

There's a better way to do that ???

Thanks !

k010 avatar Sep 23 '15 20:09 k010

Hi,

The issue queue is to be used for reporting defects and problems with C3.js, in addition to feature requests and ideas.

It is not a catch-all support forum.

For general support enquiries, please use the Google Group at https://groups.google.com/forum/#!forum/c3js.

All questions involving the interplay between C3.js and any other library (such as AngularJS) should be posted there first!

Thank you!

panthony avatar Mar 25 '18 07:03 panthony