Hello.
I have written the XAML for XAMdatachart as shown below. I am able to display the two curves on the same left Y axis but the legend displays the curve names twice. I can't find out where the issue is. Can somebody advice?
XAML code:
HorizontalZoomable="True" HorizontalZoombarVisibility="Collapsed" VerticalZoomable="True" VerticalZoombarVisibility="Collapsed" Title="Steamflood Model Prediction" Legend="{Binding ElementName=xmLegend}" HorizontalAlignment="Stretch" Margin="0,0,0,0" RenderTransformOrigin="0.505,0.464" FontFamily="Tahoma" FontSize="14" FontWeight="Bold">
<ig:CategoryXAxis.LabelSettings > <ig:NumericYAxis.LabelSettings >
MarkerType="Hexagon" Title="Model Oil Rate(bbl/d)" XAxis="{Binding ElementName=BarXAxis}" YAxis="{Binding ElementName=BarCO2YAxis}" IsHighlightingEnabled="True" IsTransitionInEnabled="True" Brush="SteelBlue" MarkerBrush="SteelBlue" >
MarkerType="Triangle" Title="Actual Oil Rate (bbl/d)" XAxis="{Binding ElementName=BarXAxis}" YAxis="{Binding ElementName=BarCO2YAxis}" IsHighlightingEnabled="True" IsTransitionInEnabled="True" Brush="Red" MarkerBrush="Red" TrendLineThickness="5">
VerticalAlignment="Top" Margin="60,30,55,20">
Updated Code:
<Grid Grid.Column="2" Grid.ColumnSpan="1" Margin="9.8,10,10,10.2"> <ig:XamDataChart Padding="2" x:Name="Chart" HorizontalZoomable="True" HorizontalZoombarVisibility="Collapsed" VerticalZoomable="True" VerticalZoombarVisibility="Collapsed" Title="Steamflood Model Prediction" Legend="{Binding ElementName=xmLegend}" HorizontalAlignment="Stretch" Margin="0,0,0,0" RenderTransformOrigin="0.505,0.464" FontFamily="Tahoma" FontSize="14" FontWeight="Bold"> <ig:XamDataChart.Axes>
<ig:CategoryXAxis x:Name="BarXAxis" ItemsSource="{Binding MonthlyResults}" Label="{}{elap_mos}" MajorStrokeThickness="0" MinorStrokeThickness="0"> <ig:CategoryXAxis.LabelSettings > <ig:AxisLabelSettings Location="OutsideLeft" Extent="55" FontFamily="Tahoma" FontSize="10" /> </ig:CategoryXAxis.LabelSettings> </ig:CategoryXAxis> <ig:NumericYAxis x:Name="BarCO2YAxis" Label="{}{}" MajorStrokeThickness="1" MinorStrokeThickness="1" LogarithmBase="10" IsLogarithmic="True"> <ig:NumericYAxis.LabelSettings > <ig:AxisLabelSettings Location="OutsideLeft" Extent="55" FontFamily="Tahoma" FontSize="11" /> </ig:NumericYAxis.LabelSettings> </ig:NumericYAxis> </ig:XamDataChart.Axes>
<ig:XamDataChart.Series> <ig:LineSeries ItemsSource="{Binding MonthlyResults}" ValueMemberPath="modeloilrate" MarkerType="Hexagon" Title="Model Oil Rate(bbl/d)" XAxis="{Binding ElementName=BarXAxis}" YAxis="{Binding ElementName=BarCO2YAxis}" IsHighlightingEnabled="True" IsTransitionInEnabled="True" Brush="SteelBlue" MarkerBrush="SteelBlue" > <ig:LineSeries.ToolTip> <StackPanel Orientation="Vertical"> <TextBlock Text="{Binding Series.Title}" FontWeight="Bold" /> <StackPanel Orientation="Horizontal"> <TextBlock Text="Value:" /> <TextBlock Text="{Binding Item.modeloilrate,StringFormat=n2}"/> </StackPanel> </StackPanel> </ig:LineSeries.ToolTip>
</ig:LineSeries> <ig:LineSeries ItemsSource="{Binding MonthlyResults}" ValueMemberPath="actual_oilrate" MarkerType="Triangle" Title="Actual Oil Rate (bbl/d)" XAxis="{Binding ElementName=BarXAxis}" YAxis="{Binding ElementName=BarCO2YAxis}" IsHighlightingEnabled="True" IsTransitionInEnabled="True" Brush="Red" MarkerBrush="Red" TrendLineThickness="5">
<ig:LineSeries.ToolTip> <StackPanel Orientation="Vertical"> <TextBlock Text="{Binding Series.Title}" FontWeight="Bold" /> <StackPanel Orientation="Horizontal"> <TextBlock Text="Value:" /> <TextBlock Text="{Binding Item.actual_oilrate,StringFormat=n2}"/> </StackPanel> </StackPanel> </ig:LineSeries.ToolTip>
</ig:LineSeries>
<ig:ItemToolTipLayer Canvas.ZIndex="11" UseInterpolation="True" TransitionDuration="0:00:00.0"/>
</ig:XamDataChart.Series>
</ig:XamDataChart> <ig:Legend x:Name="xmLegend" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="60,30,55,20"> </ig:Legend> </Grid>
Hello PD,
Thank you for your post.
I have been investigating into this issue you are seeing, and I have put together a sample project using the code that you have provided to attempt to reproduce this issue, but I am currently not seeing the behavior that you are seeing on my end. I have attached the sample project that I have used to test this. From the screenshot that you have provided on this forum thread, I am somewhat curious as to which version of the Infragistics assemblies you are using, as it looks like the original style that the XamDataChart had before it was changed in the Infragistics for WPF 2014.1 assemblies. I may be mistaken on this though.
The sample project that I have attached is using the latest version of the Infragistics for WPF 2015.2 assemblies, 15.2.20152.2038. Would it be possible for you to please test this sample project on your machine to see if it reproduces the issue you are seeing? If the assembly versions that we are using differ, would it be possible for you to provide the specific version of the assemblies you are using as well?
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
Hello Andrew.
Thanks for your reply. I made the changes. it works now!