SfChart in Crosshair

HI,

I had a problem, I was learning using MVVM mode in WPF, BubbleSeries in Sfchart, and I wanted to use crosshairs in the chart. Moving the crosshairs can be moved to the corresponding X-axis, and the corresponding data source information is automatically filled into the TextBox. Can you write an example of this effect?


3 Replies

AJ Arul Jenith Berkmans Syncfusion Team April 4, 2025 06:41 AM UTC

Hi Vincent,


To enable crosshair functionality in your chart, you can utilize the ChartCrossHairBehavior. This feature allows you to inspect or focus on individual data points within the chart.  By setting ShowTrackBallInfo to true, you can display Textbox for axes labels with their corresponding values.


Below is a simple code example to initialize the Crosshair.


<syncfusion:SfChart.PrimaryAxis>

      <syncfusion:CategoryAxis   ShowTrackBallInfo="True"/>

  </syncfusion:SfChart.PrimaryAxis>

 

  <syncfusion:SfChart.SecondaryAxis>

      <syncfusion:NumericalAxis  ShowTrackBallInfo="True" />

  </syncfusion:SfChart.SecondaryAxis>

 

  <syncfusion:SfChart.Behaviors>

      <syncfusion:ChartCrossHairBehavior />

  </syncfusion:SfChart.Behaviors>


For more details, you can refer to the Crosshair in WPF Charts control | Syncfusion.


Let us know if you need further assistance.


Regards,

Arul Jenith B.





VI Vincent April 4, 2025 08:58 AM UTC

HI,




PR Preethi Rajakandham Syncfusion Team April 4, 2025 12:24 PM UTC

Hi Vincent,

Could you please confirm whether the provided solution addresses your reported requirement? Also, please get back to us if any further assistance is required, we will be happy to assist you.

Regards,

Preethi R


Loader.
Up arrow icon