jQWidgets Forums
jQuery UI Widgets › Forums › Chart › Scatter plot grouped by x-axis value
This topic contains 7 replies, has 2 voices, and was last updated by ivailo 9 years, 9 months ago.
-
Author
-
Hi,
I have my sample data :
var sampleData = [ { Date: 'July 8', AVG_CV: 34, AVG_MV: 99, AVG_YV: 199 }, { Date: 'July 8', AVG_CV: -200, AVG_MV: 169, AVG_YV: 77}, { Date: 'July 8', AVG_CV: 67, AVG_MV: 275, AVG_YV: 69}, { Date: 'July 6', AVG_CV: 99, AVG_MV: 130, AVG_YV: 6}, { Date: 'July 6', AVG_CV: 200, AVG_MV: 11, AVG_YV: 23}, { Date: 'July 9', AVG_CV: 150, AVG_MV: 0, AVG_YV: 31}, { Date: 'July 9', AVG_CV: 45, AVG_MV: 89, AVG_YV: 22}]
and I want to scatter plot by Date. I tried doing a scatter plot but I get a different column per date. I would want it to be grouped by Date.
Is this possible?
Thanks!
Karen
…or can we plot a source like this:
var sampleData2 = [ { Date: 'July 8', "AVG_CV": [34, 100, -170], "AVG_MV": [66, 44, -230], "AVG_YV": [199, 0,-2,-20] }, { Date: 'July 9', "AVG_CV": [34, 100, -170], "AVG_MV": [66, 44, -230], "AVG_YV": [199, 0,-2,-20] }, { Date: 'July 10', "AVG_CV": [34, 100, -170], "AVG_MV": [66, 44, -230], "AVG_YV": [199, 0,-2,-20] } ];
Hi Karen,
Here is a chart with your values.
Best Regards,
Ivailo IvanovjQWidgets Team
http://www.jqwidgets.comHi ivailo,
Yes I got that chart, however, I wanted to group the x-axis by Date. Is it possible?
Hi Ivailo,
Can we plot these data type of source structure in a scatter plot?
var sampleData2 = [ { Date: 'July 8', "AVG_CV": [34, 100, -170], "AVG_MV": [66, 44, -230], "AVG_YV": [199, 0,-2,-20] }, { Date: 'July 9', "AVG_CV": [34, 100, -170], "AVG_MV": [66, 44, -230], "AVG_YV": [199, 0,-2,-20] }, { Date: 'July 10', "AVG_CV": [34, 100, -170], "AVG_MV": [66, 44, -230], "AVG_YV": [199, 0,-2,-20] } ];
Hi Karen,
There is no option to manipulate the data in your way.
Try to reorganize it to be compatible with the regular chart.Best Regards,
Ivailo IvanovjQWidgets Team
http://www.jqwidgets.comAny suggestions on how to structure the data to fit to your regular scatter chart?
Hi Karen,
You can add more info about Date in your first sampleData example.
var sampleData = [ { Date: 'July 8 1:30PM', AVG_CV: 34, AVG_MV: 99, AVG_YV: 199 }, { Date: 'July 8 5:30PM', AVG_CV: -200, AVG_MV: 169, AVG_YV: 77}, { Date: 'July 8 7:30PM', AVG_CV: 67, AVG_MV: 275, AVG_YV: 69}, { Date: 'July 6 1:30PM', AVG_CV: 99, AVG_MV: 130, AVG_YV: 6}, { Date: 'July 6 5:30PM', AVG_CV: 200, AVG_MV: 11, AVG_YV: 23}, { Date: 'July 9 1:30PM', AVG_CV: 150, AVG_MV: 0, AVG_YV: 31}, { Date: 'July 9 5:30PM', AVG_CV: 45, AVG_MV: 89, AVG_YV: 22}]
Best Regards,
Ivailo IvanovjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.