Profile Picture

how to use interactivitystyle in winchart?

Posted By g wu 13 Years Ago
Author
Message
g wu
questionmark Posted 13 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: Forum Members
Last Active: 13 Years Ago
Posts: 0, Visits: 1

Hi,

I am creating a xy point plot in winchart and need to add interactivity style so it will display the point values when mouse is over the point, below is my vb code, somehow it doesn't work-----no value displayed when mouse is over the point, can somebody give me advice? thanks.

Dim point As NPointSeries = chart.Series.Add(SeriesType.Point)

point.Name = "Point1"

point.InflateMargins = True

point.DataLabelStyle.Visible = False

point.FillStyle = New NColorFillStyle(Color.Red)

point.BorderStyle.Width = New NLength(1)

point.Size = New NLength(5, NRelativeUnit.ParentPercentage)

point.PointShape = PointShape.Bar

' point.InteractivityStyles(0) = interactivityStyle

point.UseXValues = True

For I = 0 To 10

point.XValues.Add(0.01 + I)

point.Values.Add(0.01 + I)

point.InteractivityStyles.Add(I, New NInteractivityStyle(CStr(I), CursorType.Hand))

Next

chart1.Refresh()

  



Nevron Support
Posted 13 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009
In order to enable tooltips you have to add an NTooltipTool instance to the chart controller:

nChartControl1.Controller.Tools.Add(New NTooltipTool())

In order to enable cursor changes you have to add an NCursorTool:

nChartControl1.Controller.Tools.Add(New NCursorTool())

If you want the tooltips to show just the data point index it is not necessary to add an individual interactivity style for each data point. You can use the following code:

point.InteractivityStyle = New NInteractivityStyle("", CursorType.Hand)

and remove

point.InteractivityStyles.Add(I, New NInteractivityStyle(CStr(I), CursorType.Hand))

from the For loop.

Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic