Hi,
I have two series in the same xamWebChart (line graph) and both series have markers. I noticed that sometimes when I load data onto this chart, I will get this really obscure error which forces me to resize the chart and it correctly shows the two data lines after. So I was wondering what is causing this error and how do I fix it?
<igChart:XamWebChart x:Name="m_weekMonthGraph" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0" Grid.Row="0"> <igChart:XamWebChart.Legend> <igChart:Legend Visibility="Collapsed" /> </igChart:XamWebChart.Legend> <igChart:XamWebChart.Scene> <igChart:Scene> <igChart:Scene.GridArea> <igChart:GridArea BorderThickness="0" Background="#00ffffff" /> </igChart:Scene.GridArea> </igChart:Scene> </igChart:XamWebChart.Scene> <igChart:XamWebChart.Series> <igChart:Series x:Name="m_driverSeries" ChartType="Line" DataSource="{Binding DriverIdlingDisplayStats}" DataMapping="Label=EventDate;Value=TotalIdleMinutes;ToolTip=IdlingToolTip" Fill="{Binding Source={StaticResource m_red3DBrush}}"> <igChart:Series.Marker> <igChart:Marker Type="Circle" Foreground="Transparent" Fill="Maroon" MarkerSize="5" /> </igChart:Series.Marker> </igChart:Series> <igChart:Series x:Name="m_fleetSeries" ChartType="Line" DataSource="{Binding FleetIdlingDisplayStats}" DataMapping="Label=EventDate;Value=TotalIdleMinutes;ToolTip=IdlingToolTip" Fill="{Binding Source={StaticResource m_blue3DBrush}}"> <igChart:Series.Marker> <igChart:Marker Type="Rectangle" Foreground="Transparent" Fill="Navy" MarkerSize="5" /> </igChart:Series.Marker> </igChart:Series> </igChart:XamWebChart.Series> <igChart:XamWebChart.Axes> <igChart:Axis Name="AxisX" AxisType="PrimaryX" Unit="5"> <igChart:Axis.Label> <igChart:LabelGroup Angle="45" /> </igChart:Axis.Label> </igChart:Axis> <igChart:Axis Name="AxisY" AxisType="PrimaryY" Stroke="#58FFFFFF" Visibility="Visible" StrokeThickness="0" AutoRange="True"> <igChart:Axis.MajorGridline> <igChart:GridlineGroup Visibility="Collapsed"/> </igChart:Axis.MajorGridline> <igChart:Axis.MinorGridline> <igChart:GridlineGroup Visibility="Collapsed"/> </igChart:Axis.MinorGridline> <igChart:Axis.MajorTickMark> <igChart:TickMarkGroup StrokeThickness="1"/> </igChart:Axis.MajorTickMark> </igChart:Axis> </igChart:XamWebChart.Axes> </igChart:XamWebChart>
If anyone else has this issue. Turns out when you have a custom control as a tooltip instead of the System.Windows.Control.ToolTip, it'll throw this error when you have multiple series.
So on each of my datapoints, I just wrap my custom control.
ie)
public ToolTip IdlingToolTip
{
get {
if (m_idlingToolTip == null)
m_idlingToolTip = new ToolTip() { Content = new CustomIdlingToolTip() };
return m_idlingToolTip;
}