Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
60
Extending the CategoryDateTimeAxis
posted

Hi,

I have to display multiple charts where the X-axis is CategoryDateTimeAxis and the Y-Axis is NumericYAxis. The issue is that I don't know what the data will be since it's decided on run-time. I have successfully implemented the part where I can read the data from a file and display it on the chart.

The problem I am having is that I want to be able to display multiple line series at the same time. For example, the first chart contains some data points throughout the day of January 24th, and the second might contain some data points from January 25th. So initially I set the ItemsSource of the X-axis to the January 24th Data and also set the LineSeries to January 24th Data. This displays perfectly. Now, I need to display January 25th data on this chart too (by extending the chart's x-axis so 24th's data will be in the left half and 25th's data will be in the right half. These are the things I have tried:

1. Changing the X-axis ItemsSource to the 25th's Data and adding a new line series with 25th's data (after displaying 24th's line series). However, this then only displays 25th's line series and not 24th's. 

2. I tried to concatenate data of both days together. So first I just display 24th's. Then when the user wants to see 25th's data as well, I concatenate the data for the X-axis ItemsSource but have two line series with each containing 24th's and 25th's data. This correctly displays the X-Axis to show the range from 24th to 25th but neither of the LineSeries is visible. (A possible solution maybe to edit the data for 24th to include 0s for the time range for 25th's and same for 25th but this is unfeasible for me since eventually I want this to work for multiple days and each day contains data points on the order of ~500,000).

It would be great if you could provide a solution for this. I am looking to see if this can work for not just 2 days but for multiple days on the same chart.

Thanks for all the help!

Parents Reply Children
No Data