I have a multi LineSeries chart with a legend that has check boxes to show/hide each series line when checked/unchecked.
I also have ToolTips (as a ItemToolTipLayer) to show the x/y values at each point on mouse over.
This is all currently setup using straight xaml with an check box event handler to set visibility on the indexed series.
This all works as expected except for the ToolTips. When the lineseries is set to collapsed the ToolTips are still showing. I expected the ToolTips to inherit the visibility property of its lineseries.
If i set the visibility of the series to collapsed in the xaml code the ToolTip does not show UNTIL the lineseries is set to visible (checkbox on legend checked) and then the ToolTip will always show from that point on regardless of the visibility setting of the lineseries.
What do i need to set to accomplish showing/hiding the ToolTips when the line series is visible/collapsed??
Thanks
Rob
Hi Rob,
I'm adding my sample that has multiple line series with tooltips for each series.
It also has checkboxes in the legend that are making the series visible or collapsed depending on the checked state. The tooltips only appear when the series is visible.
Let me know if this is what you had in mind or if you have any questions.
Ok I see I forgot to mention one more part that is different from your sample. I'm using an ItemToolTipLayer to show all the tooltips on the sereis as I hover over the chart. Below is the ItemToolTip definition i'm using.
Is there something different I have to configure to hide the tooltip when the series is hidden when using an ItemToolTipLayer?
<ig:ItemToolTipLayer
Canvas.ZIndex="11"
ToolTipStyle="{StaticResource xaToolTipStyle}"
TransitionDuration="0:00:00.1"
FontSize="10" />
Hi,
I modified my sample, adding ItemToolTipLayers for each series.
<ig:ItemToolTipLayer FontSize="10" TargetSeries="{Binding ElementName=CoalSeries}" x:Name="CoalTTLayer" />
<ig:ItemToolTipLayer FontSize="10" TargetSeries="{Binding ElementName=NuclearSeries}" x:Name="NuclearTTLayer"/>
<ig:ItemToolTipLayer FontSize="10" TargetSeries="{Binding ElementName=HydroSeries}" x:Name="HydroTTLayer"/>
<ig:ItemToolTipLayer FontSize="10" TargetSeries="{Binding ElementName=GasSeries}" x:Name="GasTTLayer"/>
<ig:ItemToolTipLayer FontSize="10" TargetSeries="{Binding ElementName=OilSeries}" x:Name="OilTTLayer"/>
Then in my code behind I modified the cbSeriesVisibility_Click event to isolate the ItemToolTIpLayer and set its visibility based on the IsChecked value, similar to the Series.
First adding an ItemToolTipLayer object.
ItemToolTipLayer ttl;
Then for each switch case I added code similar to the following:.
case "Coal":
this.dataChart.Series["CoalSeries"].Visibility = cb.IsChecked.Value ? Visibility.Visible : Visibility.Collapsed;
ttl = this.dataChart.FindName("CoalTTLayer") as ItemToolTipLayer;
ttl.Visibility = cb.IsChecked.Value ? Visibility.Visible : Visibility.Collapsed;
break;
Let me know if you have any questions.
Thanks for this, this will address the visibility based on the legend check box BUT it introduces a problem that defeats the purpose of the tooltips. If the line series y values are close together on the chart then the individual tooltip layers over lap each other, having the single tooltip layer allowed the tooltips to flow such that they did not over lap (at least in most cases).
An update to this issue.
The behavior i was expecting froma single tooltiplayer works correctly once I applied the May 2013 service release. So now when i collapse the visiblity of the series the tooltip visibility is also collapsed as expected.
I am following up with you to verify that this issue has been resolved.
If you have any further questions, please let me know.
Sincerely,Chris KDeveloper Support EngineerInfragistics, Inc.www.infragistics.com/support
Yes, the latest update to the libraries did correct the problem I was having.