This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hello, So - I have 6 lines on the chart, they are being fed information from 6 different comm connections. When the lines show on the graph it looks VERY strange, I've included a picture of the graph. What I think is happening is that series one is starting at 12:00:01 and line series two is starting at 12:00:02 and the chart is displaying them with separate X-Axis. |
|
|
Hello Make sure the data you are feeding to the chart is in chronological order. If not, you will need to sort the data. The chart will render the data in whatever order it is given to the chart. The series will only be rendered on different X axes if you tell them too. If the problem remains, please let me know how to reproduce this and I'll work it out. -Jason Fauchelle |
|
|
Hey Jason, The data is in chronological order for each series, but each series may not have the same datetime for each point. So series 1 will have a DateTime of 12:00:00 and Series 2 will have a DateTime of 12:00:01. Then series 1 skips to 12:00:03 while series 2 has 12:00:02. Attached is an application that shows the issue. To reproduce it after running the application wait for 1 min and you will see the lines start to redraw in strange ways. Thanks B |
|
|
Hello Bruce Thanks for sending the repro project. By default, any non numeric data will be mapped to consecutive axis numbers in first-come-first-served order. For multiple date time charts, this does not work - as you have seen. To fix this, create an instance of DateTimeAxisValueConverter in your xaml:
Then set the ValueConverter property of the X axis to be this value converter. This tells the axis how to interpret date time values. It also has a lot of options to customize its behavior. Sorry this is not automatic. I have a note to make this just-work, but it is tricky to change this without potentially breaking someones application. -Jason Fauchelle |
|
|
Hello Jason, That worked great to get the values showing up - but now I've lost the X-Axis labels, they show up then disappear. Is there something else I need to do to get them to display all the time? Thanks! B |
|
|
Hello Bruce I should have mentioned earlier, you'll want to remove the MajorTickSpacing and probably also the LabelStep property setters on the X axis. A MajorTickSpacing value of 20 with a DateTimeAxisValueConverter means to place a label every 20 milliseconds. This would result in a huge number of labels - but the axis will recognize this and skip the label rendering so that the application does not freeze. Not setting the MajorTickSpacing will allow the DateTimeAxisValueConverter to choose an appropriate spacing based on the current time range - which it is quite good at doing but can be customized. -Jason Fauchelle |
|
|
Jason, I can only get it to show points every one minute. I've tried setting MajorTickSpacing to 10,100,1000 and 5000. Thanks! B |
|
|
Hello Bruce The easiest way to set the tick mark and label spacing (when using the date time axis converter) is by setting the IntervalUnit and IntervalMagnitude properties on the DateTimeAxisValueConverter. The unit is an enum containing second, minute, year and such. The magnitude will set the desired number of those units between each tick and label. These values will be used at every zoom level though. If you want to have a different custom spacing for different zoom levels, you can fill the DateTimeIntervalDefinitions collection on the DateTimeAxisValueConverter. This blog post has more information about this: http://www.mindscapehq.com/blog/index.php/2014/01/22/wpf-elements-improved-datetime-chart-axis/ Or let me know if you have any questions. -Jason Fauchelle |
|