I have a lot of series on my XamDataChart - sometimes as many as 2000 or so. Calling MyChart.Series.Clear() takes upwards of 30-40 seconds. Is there a way I can just hide the series I do not need to display? I tried setting the visibility, but then the series object was still shown on the Y axis. I'm using a ScatterPolylineSeries with a NumericXAxis and a NumbericYAxis.
Hello Josh,
I have been investigating into the behavior you are seeing, and it is valid to set the Visibility of the different series in the XamDataChart. I am under the impression that by you saying that “the series object is still being shown on the Y-Axis,” you mean that the Y-Axis is not changing to accommodate the visible series? This is expected, as the series is still plotted in the chart and the axis takes that into account more-so than the visibility of the series.
It is worth noting that the NumericX and NumericY axes both have MinimumValue and MaximumValue properties, and so you can calculate this yourself based on the visible series’ data sources if you wish, but this may not be something viable for you.
Something I am curious about in this case is the usage of 2,000 ScatterPolylineSeries in this case. Is there a reason you are using so many series? Perhaps some of these series could be combined as the data source of the ScatterPolylineSeries can be a List<List<Point>> where each inner List<Point> is a line segment?
Please let me know if you have any other questions or concerns on this matter.
I don't believe that will help. I'm already using a a List<List<Point>> to represent each object.I'm using the Chart component to create a scheduler. Each point on the y-axis represents an object and the x axis represents time. There is an example below. Each green line to the right represents the availability of that object (for instance, the time that "Hospital 1" in the sample below is open. For my specific use case, there may be thousands of these objects.In addition, each row has a ScatterSeries that represents the beginning and end of each time period. These are used as grips to change the beginning and end times of each green area. There are at least 2 of these on each line.
I need to be able to use the filters at the top to hide a type of objects - say hide the buildings. Right now, I have to completely rebuild the series. This is not the biggest problem since the series don't take too long to create or add to the chart. But clearing the series from the chart takes a long time. Hiding and showing the object lines would be much faster.
Do you have any ideas on how to do this efficiently?