We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Chart Tooltip Data Binding

Hi,

Would like to ask what are the binding parameters for charts? I've created a DataTemplate as below:

<DataTemplate x:Key="ChartTooltipSeriesTemplate">
            <Border BorderBrush="Black" BorderThickness="2" Padding="10" Background="White">
                <StackPanel Orientation="Vertical">
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="Series : " />
                        <TextBlock Text="{Binding SeriesName}" />
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="Category : " />
                        <TextBlock Text="{Binding XAxisLabel}" />
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="Value : " />
                        <TextBlock Text="{Binding YData}" />
                    </StackPanel>
                </StackPanel>
            </Border>
        </DataTemplate>

Please advise what is the property name to be put in for the bold text? So far only YData is displaying.

1 Reply

SK Satheesh Kumar T Syncfusion Team May 10, 2014 05:49 AM UTC

Hi Alex,

Thanks for using Syncfusion products.

We have analyzed your query and we would like to inform you that the corresponding series segment will be binding parameter for the tooltip. From that Segment, we can retrieve the required data. Based on your requirement we have modified tooltip template and highlighted changes need to be done in the binding. Please find the modified template below.

 [XAML]

<DataTemplate x:Key="ChartTooltipSeriesTemplate">

     <Border BorderBrush="Black" BorderThickness="2" Padding="10" >

        <StackPanel Orientation="Vertical">

            <StackPanel Orientation="Horizontal">

                <TextBlock Text="Series : " />

                <TextBlock Text="{Binding Series.Label}" />

            </StackPanel>

            <StackPanel Orientation="Horizontal">

                <TextBlock Text="Category : " />

                <TextBlock Text="{Binding Item.[XBindingPath]}" />

            </StackPanel>

            <StackPanel Orientation="Horizontal">

                 <TextBlock Text="Value : " />

                 <TextBlock Text="{Binding YData}" />

            </StackPanel>

        </StackPanel>

      </Border>

</DataTemplate>

Note:

[XBindingPath] Fill it with the corresponding series XBindingPath.

Please let us know if you have any queries.

Thanks

Satheesh Kumar T


Loader.
Live Chat Icon For mobile
Up arrow icon