All chart types can show tooltips. Currently there are two ways to show tooltips.
JavaScript Copy Code |
---|
var StudentData = (function () { |
You render a radar chart with three series - each one with data from GPA1, GPA2 and GPA3.
JavaScript Copy Code |
---|
radarChart.xDataFields = radarChart.yDataFields = new Collections.ObservableCollection(["GPA1", "GPA2", "GPA3"]); |
This is how you set the data and how you specify that the labels from the Subject field shall appear as tooltips.
Alternatively, you can create three DataBoundSeries objects and set the tooltip data fields.
JavaScript Copy Code |
---|
DataBoundSeries series1 = new DataBoundSeries(studenDataList); |
The second approach is to customize your chosen Series object. First, define the tooltips:
JavaScript Copy Code |
---|
var tooltips = new Collections.List(["32.7%", "29.5%", "26.2%", "12%", "5%", "2%"]); |
The next step is to override the supportedLabels property of your Series and make it return LabelKinds.ToolTip in addition to the type of labels it already supports. Here we use the SimpleSeries class.
JavaScript Copy Code |
---|
Object.defineProperty(Charting.SimpleSeries.prototype, "supportedLabels", { |
The last thing to do is return the correct tooltip when asked for it:
JavaScript Copy Code |
---|
Charting.SimpleSeries.prototype.getLabel = function (index, kind) { |
You can follow these steps to add tooltip support to any kind of Series.