Jump to content
JChartFX Community
  • 0

jchartfx getting a particular data



hello all,

I have a variable containing json data as var data = [
            { "Month": "Jan", "Bikes": 1800, "Parts": 1300 },
            { "Month": "Feb", "Bikes": 1760, "Parts": 900 },
            { "Month": "Mar", "Bikes": 1740, "Parts": 970 },
            { "Month": "Apr", "Bikes": 1750, "Parts": 1010},
            { "Month": "May", "Bikes": 1810, "Parts": 1070 },
            { "Month": "Jun", "Bikes": 1920, "Parts": 1180 }

I want to get the value in the month field ,but each time I call  var month= chart1.getData().getItem(0,0); I get the value as 1800 . please help me with this. 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

getData().getItem(series, point) will return the numerical data for the specified series/point combination. The first string in your json objects will be used as the X axis labels which you can retrieve as follows


Obviously if you keep a reference to the data that you passed to the chart using setDataSource you could do this

var data = [...];






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.

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.

  • Create New...