Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
515
Error when using same series style for more than one series (Tooltip)
posted

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