| Page 1 of 1 | [ 2 posts ] |
|
Hi,
I have plotted a chart with dates in the X-axis and usercount on the Y-axix I am able to get Series yData(User Count) by using below script Code: ydata = series.get("yData"); But I cannot find a way to get xData(Dates) for a series as below script is returning Indexno not dates Code: xdata = series.get("xData"); Below is the preview of my script. Line 7 is returning incorrect value. Code: sc = mychart.get("seriesCollection"); for(; i < sc.length; ++i) { series = sc[i]; ydata = series.get("yData"); // returning correct value xdata = series.get("xData"); // returning incorrect value } Can you please tell me the correct way to get xData. Thanks |
|
The Category axis returns an array of indices for getDataByKey (which is used to define the series' xData/yData attributes). I have filed a ticket here. For now, you can use the workaround that I've written below.
Thanks, Tripp Code: var i, sc = mychart.get("seriesCollection"), len = sc.length, isVertical = mychart.get("direction") === "vertical", categoryKey = mychart.get("categoryKey"); for(i = 0; i < len; ++i) { series = sc[i]; if(isVertical) { ydata = series.get("yAxis").get("keys")[categoryKey]; xdata = series.get("xData"); } else { ydata = series.get("yData"); xdata = series.get("xAxis").get("keys")[categoryKey]; } } |
| Page 1 of 1 | [ 2 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group