Hello,
I'm having a problem in my project where I have multiple series in multiple xamdatacharts that are using the same series style - there seems to be a problem with with the tooltip property. If I have multiple series using the same style but the series are located in separate data charts, I get an error, something about the element already being used somewhere else. Below is my series style:
<Style x:Key="series" TargetType="ig:StepLineSeries"> <Setter Property="MarkerType" Value="None"/> <Setter Property="Brush" Value="Pink"/> <Setter Property="MarkerBrush" Value="Pink"/> <Setter Property="ToolTip"> <Setter.Value> <StackPanel Orientation="Vertical"> <TextBlock Text="{Binding Series.Title}" FontWeight="Bold" /> <Rectangle Fill="Black" Height="1" Stretch="Fill" Margin="4"></Rectangle> <StackPanel Orientation="Horizontal"> <TextBlock Text="Time: "/> <TextBlock Text="{Binding Item.time, Converter={StaticResource converterUtil}, ConverterParameter='DateTime!yyyy/MM/dd H:mm:ss'}" /> </StackPanel> <StackPanel Orientation="Horizontal"> <TextBlock Text="Value: "/> <TextBlock Text="{Binding Item.value, Converter={StaticResource converterUtil}, ConverterParameter='decimal!C'}" /> </StackPanel> </StackPanel> </Setter.Value> </Setter> <Setter Property="LegendItemTemplate" Value="{StaticResource legendItemTemplate}" /> </Style>
If I comment out the tooltip then everything works properly. The tooltip also works properly if the series are in the same datachart. It's only when they are in separate datacharts where the error occurs. As for the timing of the error, it occurs when hovering over the second series - the tooltip works properly when hovering over the first series, and then when I move over to the second series the error occurs. Is there something I can do (besides just making a duplicate style)? Is this a bug?
Thanks
Hi,
The chart doesn't currently support the tooltip being set in this manner. When you specify a tooltip control its that instance that it displayed for a series, and it cannot be attached at multiple points of the visual tree.
I believe that we are changing the way the tooltip is used such that this should work in 11.2, but for now, you will have to define the tooltip seperately for each series. One way to make the resulting xaml more concise would be to define a user control for the tooltip content.
Hope this helps!
-Graham
Thanks for the reply. It's good to not it's not possible to do it this way so I can look into other ways of doing it.