How to format tooltips in WinForms Chart series?
In WinForms Chart control, tooltips can be displayed by setting the ShowToolTips property to true. The PointsToolTipFormat property allows you to specify the format of tooltips for values displayed. It provides the following tooltip formats:
- "{0}" - series name
- "{1}" - series style
- "{2}" - tooltip of point
- "{3}" - X value of point
- "{4}"- Y value of point
For more details on supported format specifiers in PointsToolTipFormat, refer to the WinForms Chart documentation.
this.chartControl1 = new ChartControl();
. . .
//Enabling Tooltips
this.chartControl1.ShowToolTips = true;
ChartSeries series = new ChartSeries("Sales", ChartSeriesType.Column);
// Setting Series Name as Tooltip for the series
series.PointsToolTipFormat = "{0}";Me.chartControl1 = New ChartControl()
. . .
'Enabling Tooltips
Me.chartControl1.ShowToolTips = True
Dim series = New ChartSeries("Sales", ChartSeriesType.Column)
' Setting Series Name as Tooltip for the series
series.PointsToolTipFormat = "{0}"//Enabling Tooltips
this.chartControl1.ShowToolTips = true;
// Setting Tooltip as Series2 for the series1
series.PointsToolTipFormat = "Series 2";'Enabling Tooltips
Me.chartControl1.ShowToolTips = True
' Setting Tooltip as Series2 for the series1
series.PointsToolTipFormat = "Series 2"Output
Conclusion
I hope you enjoyed learning about how to format tooltips in WinForms Chart series.
You can refer to our WinForms Chart feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started with configuration specifications. You can also explore our WinForms Chart examples to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!