Some questions about the trackball ability of the sfchart control

Hi Syncfusion Support!

We are still in love with the sfchart control! It is really flexible and fast.

Now we have some questions about the trackball functionality.

It is possible to create a custom trackball series label for line and area series? We have seen that the financial series supports a nice label with additional information. Our idea of a label needs the value(s) and some more custom strings to clarify the data.

And, are there some cool events behind the trackball? Something like "show", "move" and so on? Our idea is to show additional information in a separate canvas while the user is hovering a chart.

Thank you!

Regards
Sascha

1 Reply

MK Muneesh Kumar G Syncfusion Team November 1, 2018 08:42 AM UTC

Hi Sascha, 
 
Greetings from Syncfusion. Please find the response below.  
 
Query 1: It is possible to create a custom trackball series label for line and area series?  
 
You can achieve this requirement by setting TrackBallLabelTemplate in series as per the below code snippet.  
 
Code snippet 
<chart:SfChart x:Name="chart"> 
 
            <chart:SfChart.Resources> 
 
                <DataTemplate x:Key="labelTemplate"> 
 
                    <Border CornerRadius="5" BorderThickness="1"  
                             
                        BorderBrush="Black" Background="BlueViolet" Margin="8"> 
                        <StackPanel Margin="5" Orientation="Horizontal"> 
                            <TextBlock Foreground="White" Text="XData: " /> 
                            <TextBlock Foreground="White" Text="{Binding ValueY}"/> 
                        </StackPanel> 
 
                    </Border> 
 
                </DataTemplate> 
 
            </chart:SfChart.Resources> 
 
            <chart:SfChart.Behaviors> 
 
                <chart:ChartTrackBallBehavior /> 
 
            </chart:SfChart.Behaviors> 
 
            <chart:ColumnSeries Label="2010"  Interior="#4A4A4A"      
 
                                 ItemsSource="{Binding Data}"  
                                
                                TrackBallLabelTemplate="{StaticResource labelTemplate}" 
 
                                 XBindingPath="XValue"  
                                      
                                 YBindingPath="YValue"/> 
 
        </chart:SfChart> 
 
 
Query 2: Are there some cool events behind the trackball? Something like "show", "move" and so on? 
 
We have PositionChanging and PositionChanged event in trackball. You can subscribe these events as per the below code snippet.  
 
Code snippet 
          <chart:SfChart.Behaviors> 
 
              <chart:ChartTrackBallBehavior     
                         PositionChanged="ChartTrackBallBehavior_PositionChanged"/> 
 
            </chart:SfChart.Behaviors> 
 
 
private void ChartTrackBallBehavior_PositionChanged(object sender, PositionChangedEventArgs e) 
        { 
 
        } 
 
 
 
Hope it helps.  

Regards,
Muneesh Kumar G
 


Loader.
Up arrow icon