Jump to content
JChartFX Community
  • 0

JSON data format for dates


rgundersen

Question

Hi

I'm new to JChartFX and I'm trying to do a line chart with multiple lines on it, with dates along the X axis. I've got one line displaying correctly using this format:

            var data = [
                 {"Date": "2013-11-11T12:00:00.000Z", "Value": 4 },                
                 {"Date": "2013-11-11T14:00:00.000Z", "Value": 17 },                
                 {"Date": "2013-11-11T15:00:00.000Z", "Value": 8 },                
                 {"Date": "2013-11-11T16:00:00.000Z", "Value": 1 }                
            ];
The values above represent 'successful logins over time'.
How do I format the data for a second line on my graph to show 'failed logins over time'? 
Thanks 
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Something like this

var data = [

                 {"Date": "2013-11-11T12:00:00.000Z", "Value": 4, "Failed": 2 },

                 {"Date": "2013-11-11T14:00:00.000Z", "Value": 17, "Failed": 5 },

                 {"Date": "2013-11-11T15:00:00.000Z", "Value": 8, "Failed": 1 },

                 {"Date": "2013-11-11T16:00:00.000Z", "Value": 1, "Failed": 0 }

            ];

 

JuanC 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...