Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Load region with C3.js

I am trying to dynamically load a region to a line chart in C3.js using the load api.

The column data loads fine but there is no change to the regions. I don't want to use the regions.add api because I require a dashed line for this project.

chart.load({
    columns:[
        ['data2', 10, 30, 20, 50, 40, 60, 50]
    ],
    regions: {
         'data2': [{'start':3, 'style':'dashed'}]
    }
    });

I would really appreciate any help, I am so stuck - thank you!

like image 897
dangerd Avatar asked Jun 24 '15 00:06

dangerd


1 Answers

As per their documentation c3 api load you can only pass these values in load call

url, json, rows, columns, classes, categories, axes, colors, type, types, unload and done

To add regions to load call you need to raise issue with them on their github pages or check if one already exists

As of now only solution is to use regions.add but it does not support dash style as of now

check Demo:Fiddle

You can raise an issue to add dash style instead of adding regions to load call as it may be easier and faster for them to fix

like image 177
Raunak Kathuria Avatar answered Nov 08 '22 09:11

Raunak Kathuria