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, I have a reference to the 1.0.0.1 build of MetroElements. I'd like to display a line graph of tide data in my Winrt app. On the X-axis would be a representation of time and the Y-axis would have the tide height in meters. With the last WP7 charting control I used I converted the DateTime values for each Tide Datum to a OADate double. E,g, 41182.0340277778. This allowed me to graph data that would scale from fractions of an hour out to entire years. I was also able to provide user friendly labels via a function that converted the OADate double into a string. I tried passing the List
When I used the same data in a Google Spreadsheet I got a much smoother curve. So I guess I have a few of questions:
Thanks, Daniel |
|
|
Hello Daniel
Let us know if you have further questions. Jason Fauchelle |
|
|
Hello Daniel Thanks for the repro data. I found that the cause of the jagged edges is because just before all the turning points, there is a data point that is further along the X axis. To resolve the jagged edges you'll want to order the data by OADate before passing it to the chart. Jason Fauchelle |
|
|
Great, Thank you. Sorry for getting you to debug my data. Your other suggestions make a lot of sense. I'll try switching from OADate to a DateTime based X-axis and make sure I sort the data before using it. The ZoomMode and SelectedDataPoint sound like exactly what I'm looking for. Are there any examples of these features I can try? Although now I know where to look it shouldn't be too difficult. Thanks, Daniel |
|
|
No worries Daniel There is no Metro Elements sample just yet. But you can see this blog post for a simple example of providing a symbol style: http://www.mindscapehq.com/blog/index.php/2012/09/25/metro-elements-area-charts-and-custom-styling/ Also if you get stuck, you can download the free trial of WPF Elements which contains an extensive set of Chart samples within the SampleExplorer app. The API is almost the same as Metro Elements: http://www.mindscapehq.com/products/wpfelements And of course you can ask more questions about how to use any of the features. Jason Fauchelle |
|
|
Hi Jason, I've had a couple of issues using the SymbolStyle and SelectedDataPointChanged event. I couldn't reuse the PathGeometry from the WPF examples styles to complete the SymbolStyle. I copied the CrossChartSymbolStyle and SymbolStyleBase styles over from the WPF examples (...\Mindscape\WPF Elements\Samples\SampleExplorer\App.xaml) to my WinRT project resources. Within CrossChartSymbolStyle the PathGeometry Figures attribute resulted in the following error:
I guess this makes sense, due to the differences between WPF and WinRT, but I couldn't find a viable way to define the symbol so that the SelectedDataPointChanged event would fire. I hacked up the SymbolStyleBase Template to just draw an Ellipse. Again, I couldn't define the ControlTemplate.Triggers for IsMouseOver and IsSelected due to the WinRT differences. No luck with the Interaction.Triggers that I would have used in WP7 either. So while I can get the Ellipses to draw, no matter where I click on the chart I can't get them to trigger the selected event. Do you have a simplified SymbolStyle I could try for WinRT? Can I cause a Data Point to be selected from code? I'd like to find a DataPoint based on the DateTime and select it. A few comments. These may be specific to something I'm doing, but I through they might be helpful. The default DateTimeAxisValueConverter produced really odd results for me. I replaced it with my own version that removed an offset (Ticks for 1/1/2010) from the DateTime Ticks that were cast to a double. I put a Foreground TrackingElement on the chart and it seems to work well. Although the WinRT simulator still shows it tracking when using touch input without "tapping". I guess it was never designed for this, but I'm now not sure what it will do on an actual touch device. Thanks, Daniel |
|
|
Hello Daniel WinRT does not have Type Converters which is why you can't use the path geometry approach I used in the WPF Sample Explorer. Fortunately you can still set the Data property of a Path using the geometry mini language. So here is an example of a cross symbol style for WinRT:
For the visual state, you would normally use the Visual State Manager as WinRT does not have ControlTemplate.Triggers. We haven't finished providing visual states for data points yet though, so I'll let you know when this can be done. Also, the data point selection system is not finished yet. This is because it may have some improvements compared to the WPF version. I'll let you know when this can be used. The issues with the DateTimeAxisValueConverter are unusual. We will be improving the DateTimeValueConverter by the final version, this may solve the issue. I assume you go the TrackingElement from the WPF Elements trial. As this is designed for WPF, you'll want to modify it slightly to behave in WinRT - for example, only render the elements if the pointer is pressed. I'll probably include a WinRT version in the WinRT sample. Thanks for all your feedback. Jason Fauchelle |
|