Xceed Chart for WinForms can change the mouse cursor when it passes over chart elements. This is very useful when you want to visually prompt the end-user that something will happen when a chart element is clicked. To notify the control to change the mouse cursor when the mouse moves over the chart, you must add an object of type CursorChangeInteractivityOperation to the interactivity collection:
By default, chart elements do not change the mouse cursor. The following example changes the cursor to "hand" when the mouse passes over a data item:
VB.NET
' init the values for the tooltip properties chartControl.InteractivityOperations.Add(New CursorChangeInteractivityOperation()) Dim chart As Chart = CType((chartControl.Charts(0)), Chart)
' Create a bar series Dim bar As BarSeries = CType(chart.Series.Add(SeriesType.Bar), BarSeries)
' set some fill effects in the collection. bar.Appearance.FillMode = AppearanceFillMode.DataPoints Dim fillEffect As FillEffect = New FillEffect(Color.Red) bar.Appearance.FillEffects.Add(fillEffect)
C#
// init the values for the tooltip properties chartControl.InteractivityOperations.Add(new CursorChangeInteractivityOperation()); Chart chart = (Chart)(chartControl.Charts[0]);
// Create a bar series BarSeries bar = (BarSeries)chart.Series.Add(SeriesType.Bar); bar.BarStyle = BarStyle.CutEdgeBar; bar.Legend.Mode = SeriesLegendMode.DataPoints;
// set some fill effects in the collection. bar.Appearance.FillMode = AppearanceFillMode.DataPoints; FillEffect fillEffect = new FillEffect(Color.Red); bar.Appearance.FillEffects.Add(fillEffect);