Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to pass multiple timestamp Json data to c3 charts? #44

Open
aashish-chaubey opened this issue Jul 30, 2018 · 0 comments
Open

How to pass multiple timestamp Json data to c3 charts? #44

aashish-chaubey opened this issue Jul 30, 2018 · 0 comments

Comments

@aashish-chaubey
Copy link

aashish-chaubey commented Jul 30, 2018

Hey,

I am trying to pass multiple Json data for the multiple line charts.

I know for the single line chart, line would pass the data as:

var data = {
    x: 'quantity1',
    json: this.state.data1,
    types: {
        quantity1: 'line'
    }
};

Here, in my case I want to draw two lines on the chart. Therefore I do this:

var data = {
    x: 'quantity1',     // this is the timestamp
    json: this.state.data1,
    json: this.state.data2,
   types: {
       quantity1: 'line',
       quantity2: 'line'
   };
};

I feel this is not the appropriate way to pass the data for the lines.

My timestamp data format in both the cases are:

{
    "Mon Apr 30 2018 00:00:00 GMT+0530 (India Standard Time)": 5.5,
    "Mon Apr 30 2018 00:30:00 GMT+0530 (India Standard Time)": 4.5,
    "Mon Apr 30 2018 01:00:00 GMT+0530 (India Standard Time)": 3.5,
    .... 
    ....
}

Please help me in this!

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant