score:43
If you want to pass additional data for a point other than the x and y values, then you have to name that value. In the following example I add the following three additional values to each data point:
{
y: 3,
locked: 1,
unlocked: 1,
potential: 1,
}
Then to access and display those values in the tooltip I use the following:
tooltip:
{
formatter: function() { return ' ' +
'Locked: ' + this.point.locked + '<br />' +
'Unlocked: ' + this.point.unlocked + '<br />' +
'Potential: ' + this.point.potential;
}
}
score:4
What i have tried is concatenating series name with x-axis and y-axis value and it works fine for me. What issue you are facing?
tooltip: { formatter: function () { return this.x + ': ' + this.series.name + ': ' + this.y; } }
score:5
I figured it out, I pass 3 values in the data array
indice.push([(new Date(value.x)).getTime(), val_change[0], val_change[1]]);
series: [{ type: 'area', name: titleindice, data: indice, showInLegend : false //disable the the show/hide icon }]
and in the tooltip
tooltip:
{
useHTML: true,
formatter: function()
{
var color = "";
return Highcharts.dateFormat('%H:%M:%S', this.x) + this.y + this.point.config[2] ;
}
},
score:5
two ways.
1
series: [
{ ...
tooltip:
{pointFormat: "<span style=\"color:{series.color}\">{series.name}</span>: <b>{point.y} {y2}</b><br/>"}
}, ...
]
o = Highcharts.Point.prototype.tooltipFormatter
Highcharts.Point.prototype.tooltipFormatter=function(format){return o.call(this, format).replace("{y2}", this.config[2]);}
2
a = new Highcharts.StockChart(options);
a.series[0].tooltipFormatter = function(item) { return "<span style=\"color:{" + item.series.color+"\">" +item.series.name+"</span>: <b>"+item.y+item.point.config[2]+"</b><br/>"; }
score:7
If you, in a multi series Highstocks chart, want to display series specific data in the tooltip you could do something like this.
var series = [];
// Populate our series
series.push({
name: "small_cities",
displayName: "Small Cities",
color: "#123456",
data: [...]
});
series.push({
name: "Countries",
displayName: "Countries",
color: "#987654",
data: [...]
});
chart: {
...
tooltip: {
formatter: function() {
var s = '';
$.each(this.points, function(i, point) {
s += '<br /><span style="color:' + this.series.color + '">' +
point.series.userOptions.displayName + '</span>: ' + point.y;
});
return s;
}
},
...
}
Now you'll see nice series names "Small Cities" instead of the series.name (small_cities). All attributes you set on the series can be found in this.points[].series.userOptions
.
For more formatter options take a look at the Highstocks docs.
Source: stackoverflow.com
Related Query
- highcharts pass multiple values to tooltip
- highcharts StockChart pass multiple values to tooltip
- how to pass values to tooltip which not in x and y axis in highcharts
- HighCharts Pie Chart - Displaying multiple series values in Tooltip
- Highcharts - Issue with negative values when displaying multiple axes
- Highcharts : Shared Tooltip for non-matching x values
- Highcharts - multiple yAxis each with its own tooltip
- Highcharts shared tooltip between charts with multiple series and shared tooltip
- How can I pass values from Highcharts event callbacks (click, mouseOver, mouseOut) back to React component member function?
- How to edit tooltip in Highcharts C# code
- passing json values to highcharts from .net code behind
- Highcharts variation (%) between yaxis values in tooltip
- how to use highcharts tooltip formatter in python code
- Highcharts synchronize tooltip on multiple charts with multiple series
- Highcharts - Highcharter in R - Getting Tooltip values from df rather than map
- How to show values in Highcharts tooltip other than x and y when data points are too high?
- Highstock/highcharts show multiple y-axis values in single tooltip
- Highcharts Showing negative values on tooltip
- Highcharts - how to access category of multiple axis of the point from tooltip
- Trouble getting unique tooltip based on X axis values in highcharts line graph
- How to have multiple highcharts with different series data in vuejs without repeating code
- Multiple X-axis values in highcharts
- Pass 3 values in highcharts series
- Highcharts with values from multiple JSON file
- Highcharts multiple values for 1 date?
- Pass time values to Highcharts Column chart
- Angular Highchart multiple values in tooltip
- How to display multiple values of the same attribute when hovering on tooltip with highcharts/highmaps
- Highcharts tooltip formatter function does not display values in table correct
- Highcharts - arearange - low and high values in tooltip
More Query from same tag
- Highcharts: Error bars in drill-down charts
- Alter SVG After Highcharts is Redrawn
- high chart- how to add array in custom dataLabels formatter
- Real Time Update High charts from sql database
- Stacked Bar Chart: Week vs Week
- highchart line chart last null value is not conected with line
- Is it possible to add image behind doughnut chart with transparency color in ng2chart?
- Is it possible to trigger tooltip in highchart of a line chart ONLY when the mouse hovers over the point?
- How to Create synchronized High chart with different no of series per chart
- Adding highcharts to existing project got unknow problem
- Highcharts - change pie slice color on existing chart
- How to set the last point's position in Highcharts
- Highchart startR is undefined under N(H, "parts/PieSeries.js", [H["parts/Globals.js"], H["parts/Utilities.js"]] highcharts.js file
- Highmaps: what is the code for a county?
- How to set a different border line of every single point or serie in Highcharts scatter plot?
- How to set custom tooltip design in HighCharts?
- Passing callback function to labelFormatter in highchart legend in typescript
- Highcharts. How to start areaspline chart from start y axis?
- Using Highchart with javascript
- Highcharts position dataLabels on hide/show event
- Highcharts: Dynamically size a solid gauge chart
- Motion in drilldown bubble chart Highcharts
- In highchart how to plot the line in 3d container
- How to add a second tooltip to highcharts
- High Charts - Split color of bar chart
- Ember component being overwritten instead of repeated
- Responsive Highchart legend position
- Sending javascript function with JSON is possible?
- highcharts wrapper function for 'drag'
- Highcharts/Highstock flags series issue