Skip to content

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

Description

@aashish-chaubey

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions