[ 4 posts ]

B. Estrade

  • Username: estrabd
  • Joined: Wed Sep 07, 2011 12:28 pm
  • Posts: 49
  • Location: Houston, Texas
  • Twitter: estrabd
  • GitHub: estrabd
  • Gists: estrabd
  • IRC: estrabd
  • Offline
  • Profile

Chart trying to plot extraneous fields, how to stop this?

Post Posted: Thu Oct 27, 2011 7:05 am
+0-
I am continuing with my charting adventures, and would like to know - how does one prevent a chart from trying to plot fields in the data that exist, but are not defined in the series that I wish to show?

I am carrying around this data for the sake of creating informative tool tips and labels, but instead the chart is plotting them.

Thank you,
Brett

Tripp Bridges

YUI Developer

  • Username: tripp
  • Joined: Wed Jan 07, 2009 1:54 pm
  • Posts: 435
  • GitHub: tripp
  • Gists: tripp
  • YUI Developer
  • Offline
  • Profile

Re: Chart trying to plot extraneous fields, how to stop this

Post Posted: Thu Oct 27, 2011 7:34 am
+0-
Hi Brett,
You can use the seriesKeys attribute to limit the series items.
http://yuilibrary.com/yui/docs/api/classes/ChartBase.html#attr_seriesKeys

If specified, only the key values in the array will be included in the axes and series.

Code:
var mychart = new Y.Chart({
    dataProvider: myDataProvider,
    seriesKeys: [ "hi", "lo", "open", "close"],
    ...
});


Thanks,
Tripp

B. Estrade

  • Username: estrabd
  • Joined: Wed Sep 07, 2011 12:28 pm
  • Posts: 49
  • Location: Houston, Texas
  • Twitter: estrabd
  • GitHub: estrabd
  • Gists: estrabd
  • IRC: estrabd
  • Offline
  • Profile

Re: Chart trying to plot extraneous fields, how to stop this

Post Posted: Thu Oct 27, 2011 7:52 am
+0-
Thank you, Tripp.

I am dynamically building up this seriesKeys array, and I can confirm that it is only passing in the fields that I wish to be show.

I will try to come up with an example.

Brett

B. Estrade

  • Username: estrabd
  • Joined: Wed Sep 07, 2011 12:28 pm
  • Posts: 49
  • Location: Houston, Texas
  • Twitter: estrabd
  • GitHub: estrabd
  • Gists: estrabd
  • IRC: estrabd
  • Offline
  • Profile

Re: Chart trying to plot extraneous fields, how to stop this

Post Posted: Thu Oct 27, 2011 8:18 am
+0-
Nope, I was wrong. Thanks for making me double check. :)

Brett
  [ 4 posts ]
Display posts from previous:  Sort by  
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