Re: Line Chart Hide/Show Series
If I understand you correctly, this may not be what you need as the axes will still be drawn to include all data hidden or visible. Your best bet is to use the set method on your chart to update your dataSource.
The chart will render to accomodate the data that you have set.
> Hi there,
> I am trying to create a very snappy chart which I have largely accomplished thanks to YUI, but I have one problem that I cannot seem to overcome.
> Is there some way to dynamically hide/show a series within a graph? I can pseudo accomplish this by keeping track of what to show in a JS array, building the series definition from that, and then remaking the graph. However, especially on higher resolution data or slower connections, the "refresh" time is extremely noticeable due to database fetching / processing time and latency.
> My preferred idea is to query all of the datasources on the first hit, and then just hide/show them based on ButtonGroup events with no further remote datasource calls.
> I have tried a couple of things, such as changing the color of the hidden ones to white to blend into the background but this still forces the dimensions of the graph to accommodate that, meaning that something "invisible" with an average value of 1000 will still make something with an average value of 5 unseeable except as a line at the bottom.
> I have also tried copying the data from the datasource via the doBeforeParseData event into a global JS object and then using that as the datasource on subsequent calls which, while better, still suffers from having to remake the entire graph.
> If there is already the means for this and in my hours spent scouring the web and APIs I missed it, my apologies in advance.