I'm currently testing out IG's DataVisualizaion and Charting tools, xamDataChart looks very nice, and I'm wondering if it can emulate, in xaml, a sort of DataTemplate wrapper for a Series (Line particularly). I've had success with a different Charting toolkit with an external wrapper class, and it's code looked something like this:
<multiChart:MultiChart> <multiChart:MultiChart.SeriesTemplate> <DataTemplate> <chartingToolkit:LineSeries /> </DataTemplate> </multiChart:MultiChart.SeriesTemplate> </multiChart:MultiChart>
The DataTemplate's the crucial part, as I do not know how many series I'll need to render until runtime. I don't see any kind of DataTemplate in the XamDataChart class, would there be another way to achieve this kind of behavior?
Hi,
Please see this post.
http://community.infragistics.com/forums/p/40011/242380.aspx#242380
Its possible it may need a small adjustment for the WPF version due to some different ways that DataContext is handled. Let me know if you have any problems or questions. I'll try to test this out later today myself and see if it needs any WPF adjustments.
We have been considering adding this feature natively. If you are interested in it, you could make a feature request to lodge your vote for it.
Hope this helps!
-Graham
The version I linked is a bit complicated, but very flexible, because it does everything with attached properties. You could also approach it with a just wrapper class instead which may simplify some things, but decrease the flexibility an amount.
Hi Graham
Sadly your sample don't goes with our scenario.We want to display a history of various values like temperatures, pressures and switching states (light on/off). All values are stored in a datatable with the columns ValueID, Value and TimeStamp. So each stored values has an independent timestamp. A transformation of the data from datatable into list format, like in the sample TestSeries[].TestSeriesItem.TestData[].TestDataItem, is easy therefore.
To this I have adjusted class TestDataItem and xaml as follows: public class TestDataItem{ public DateTime TimeStamp { get; set; } public double Value { get; set; }}
<ig:CategoryDateTimeXAxis x:Name="xAxis" ItemsSource="{Binding ElementName=xamDataChart1, Path=Series[(System:Int32)0].ItemsSource}" DateTimeMemberPath="TimeStamp" DisplayType="Continuous" Label="{}{TimeStamp:HH:mm:ss}"/>
In order that the first series will shows properly. In the following series the values are displayed in the fit Y-position and X-order but at the timestamps (Y-position) of the first series.
Is there any answer to that problem?
My second question is: how can I adjust the X-axis range (max/min) explizit for each series.
Thanking you in anticipation
Toni
If you are running the latest Service Release of the product. The CategoryDateTimeXAxis should have a MinimumValue and MaximumValue that you can use to establish the axis range. These properties were not in the Volume release of the product though. They also exist in your YAxis.
I'm not sure I completely understand your scenario, but it may more correct for you to create a seperate CategoryDateTimeXAxis per series and syncrhonize their MinimumValue and MaximumValue.
I believe in the sample code that I posted you can achieve this by instead creating the axis on the actual property of the series:
<ig:LineSeries.XAxis>
<ig:CategoryDateTimeXAxis ... />
</ig:LineSeries.XAxis>
If you can share some sort of example data and information about how you want it to look, I can give you additional guidance.
I know this post is pretty old, but I'm hoping I can still get a little help. I am having the exact same problem that tzieger did. I'll see if I can explain it.The data items I am displaying have a Price on the Y-Axis and a DateTime on the X-Axis. When I add a single series, everything displays correctly. However, when I add a second series, the new data points are not displayed correctly. The DateTime values from the second series are ignored and are plotted at the same X-Axis values as the first series that was added to the collection.For example: Series 1 has two items: ($2.34, 9:34:23) ($2.35, 9:37:13) Series 2 has two items: ($2.38, 9:35:51) ($2.36, 9:36:44)The data points from Series 2 display at the points from Series 1. Thus, Series 2 effectively becomes ($2.38, 9:34:23) ($2.36, 9:37:13)I have tried your workaround by creating an axis per series, but not matter what I do, the chart comes up blank. The Y-Axis label displays correctly, but there is nothing displayed for the X-Axis labels and no series are displayed on the chart.I'm using XamDataChart Version 12.1. Here is the before and after xaml.Before:<igXaml:XamDataChart x:Name="igdcOrderUpdates"> <igXaml:XamDataChart.Axes> <igXaml:CategoryDateTimeXAxis x:Name="xAxisOrderUpdates" ItemsSource="{Binding ElementName=igdcOrderUpdates, Path=Series[(System:Int32)0].ItemsSource}" DateTimeMemberPath="OrderTimeStamp" Label="{}{OrderTimeStamp:HH:mm:ss}"> <igXaml:CategoryDateTimeXAxis.LabelSettings> <igXaml:AxisLabelSettings Extent="55" VerticalAlignment="Center" Angle="45" /> </igXaml:CategoryDateTimeXAxis.LabelSettings> </igXaml:CategoryDateTimeXAxis> <igXaml:NumericYAxis x:Name="yAxisOrderUpdates" Label="{}{0:C}" MaximumValue="{Binding Path=MaxYAxisValue, Mode=TwoWay}" MinimumValue="{Binding Path=MinYAxisValue, Mode=TwoWay}"> <igXaml:NumericYAxis.LabelSettings> <igXaml:AxisLabelSettings Extent="50" HorizontalAlignment="Center" /> </igXaml:NumericYAxis.LabelSettings> </igXaml:NumericYAxis> </igXaml:XamDataChart.Axes> <glpCharts:SeriesBinder.BindingInfo> <glpCharts:SeriesBindingInfo ItemsSource="{Binding Path=OrderSeries}"> <glpCharts:SeriesBindingInfo.SeriesTemplate> <DataTemplate> <igXaml:LineSeries ItemsSource="{Binding Item.Data}" ValueMemberPath="{Binding Item.ValueMemberPath}" XAxis="{Binding Path=Owner.Axes[(System:Int32)0]}" YAxis="{Binding Path=Owner.Axes[(System:Int32)1]}" /> </DataTemplate> </glpCharts:SeriesBindingInfo.SeriesTemplate> </glpCharts:SeriesBindingInfo> </glpCharts:SeriesBinder.BindingInfo></igXaml:XamDataChart>After:<igXaml:XamDataChart x:Name="igdcOrderUpdates"> <igXaml:XamDataChart.Axes> <igXaml:NumericYAxis x:Name="yAxisOrderUpdates" Label="{}{0:C}" MaximumValue="{Binding Path=MaxYAxisValue, Mode=TwoWay}" MinimumValue="{Binding Path=MinYAxisValue, Mode=TwoWay}"> <igXaml:NumericYAxis.LabelSettings> <igXaml:AxisLabelSettings Extent="50" HorizontalAlignment="Center" /> </igXaml:NumericYAxis.LabelSettings> </igXaml:NumericYAxis> </igXaml:XamDataChart.Axes> <glpCharts:SeriesBinder.BindingInfo> <glpCharts:SeriesBindingInfo ItemsSource="{Binding Path=OrderSeries}"> <glpCharts:SeriesBindingInfo.SeriesTemplate> <DataTemplate> <igXaml:LineSeries ItemsSource="{Binding Item.Data, Mode=OneWay}" ValueMemberPath="{Binding Item.ValueMemberPath}" YAxis="{Binding Path=Owner.Axes[(System:Int32)0]}"> <igXaml:LineSeries.XAxis> <igXaml:CategoryDateTimeXAxis x:Name="xAxisOrderUpdates" DateTimeMemberPath="{Binding OrderTimeStamp}" Label="{}{OrderTimeStamp:HH:mm:ss}"> <igXaml:CategoryDateTimeXAxis.LabelSettings> <igXaml:AxisLabelSettings Extent="55" VerticalAlignment="Center" Angle="45" /> </igXaml:CategoryDateTimeXAxis.LabelSettings> </igXaml:CategoryDateTimeXAxis> </igXaml:LineSeries.XAxis> </igXaml:LineSeries> </DataTemplate> </glpCharts:SeriesBindingInfo.SeriesTemplate> </glpCharts:SeriesBindingInfo> </glpCharts:SeriesBinder.BindingInfo></igXaml:XamDataChart>
Hello Michael,
It has been a while since you have made your post, in case you still need support I will be glad to assist you further. I suppose the other community members can benefit from this answer as well. I have been looking into your post, but it seems like that I am missing something in your scenario, so if this is still an issue for you, could you please send an isolated sample project, where the issue is reproduced, so I can investigate it further for you.
Feel free to write me if you have further questions.
Thanks for your reply. I have temporarily moved on to a different project and have not been able to come back to this. However, part of my post was answered in another post. Graham Murray posted a reply on 08/06/2012 @9:30am to "Cannot add 2 lineSeries to 1 xamDataChart" which says:
"when using the CategoryDateTimeXAxis, unless each series has exactly the same number of entries with the same dates in the same order, you should use a seperate CategoryDateTimeXAxis per series."
That answers the first part of my post where the values on the second series are being ignored and are using the ones from the first data series.
I think the answer to the second part of my question as to the second data series not displaying in the chart at all is to not use the CatageoryDateTimeXAxis. It just seems to be doing a lot of stuff on it's own that I don't want. (Like the above as well as "the CategoryDateTimeXAxis handles reordering of unordered data and auto-min/max") I wasn't aware it behaved that way. I will most likely have to go to a basic CategoryXAxis.