mercredi 15 avril 2015

Changing the series list in a chart

Hi,



In the app I am building I have a case where a list of records is coming back every 15 seconds and I need to chart the data that is sent back. This obviously isn't a big deal and I have that working fine; however, it is possible for 'columns' to be added or removed over time. When this happens I need to change the series list to account for these changes in the record. Again this didn't seem like it should be a big deal.



When a new set of records comes back I inspect the records to determine if there are changes in the column list and if so I create a new series list and call setSeries. Calling setSeries seems to cause some issues.



I have created a fiddle that duplicates the issues I am seeing here: http://ift.tt/1IdYIWA



If you run that fiddle you will see a chart with two series in it. If you click the "Update Series" button it will call setSeries on the chart sending in a series configuration... in this case it is the same one that was originally used. No errors are thrown and the chart appears unchanged *except* the dots in the legend turn black. If you then try to drag the splitter between the chart and the button panel the chart will resize; however, the series lines will not. If you then click the "Update Data" button a new set of series lines will appear; however, the old series lines will still be there... it is like the series lines from the original series list is frozen in the chart. You can repeatedly click the buttons to see more and more lines appear.



I don't know if I am doing something wrong or if this is a bug; however, even if I am doing something wrong I don't think the current behavior is correct.



Any ideas/help?



Thank you in advance





Changing the series list in a chart

Aucun commentaire:

Enregistrer un commentaire