score:30
Accepted answer
Inside formatter this
reffers to the focused serie, you can add an if/else
inside the formatter and return a string for each one, like the following.
tooltip: {
shared: false,
formatter: function() {
var text = '';
if(this.series.name == 'MSFT') {
text = this.x + ': ' + this.series.name +
'<br> $' + Highcharts.numberFormat(this.y, 0);
} else {
text = 'In ' + this.x + ' the median value was' + this.median +
'and the total $' + Highcharts.numberFormat(this.y, 0);
}
return text;
}
}
score:-1
Here's an example. The fiddle example is here:
tooltip: {
formatter: function () {
var s = '<b>' + Highcharts.dateFormat('%A, %b %e, %Y', this.x) + '</b>';
$.each(this.points, function () {
s += '<br/>1 USD = ' + this.y + ' EUR';
});
return s;
}
},
score:2
You can easily define a toolip formatter for each series - see here: http://api.highcharts.com/highcharts/plotOptions.series.tooltip
{
tooltip: {
shared: true
},
series: {
name: 'some series name',
data: mydata,
tooltip: {
valueSuffix: ' bar'
}
}
}
Example: http://jsfiddle.net/28qzg5gq/
Source: stackoverflow.com
Related Query
- Can I use two different formatters for highchart tooltips?
- Highcharts - How to show two tooltips for single point at different positions of chart?
- Two different data range for Y-axis in DotNet Highchart
- Add additional data to a Highcharts series for use in formatters
- Can color of data label be different inside and outside of the bar in Highchart
- Can I assign a different radius for each pie slice using Highcharts?
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- Can I sychronize two highcharts series with different years (leap year)
- rCharts different sizes for the two graphs in Shiny App
- Use MySQL data as the chart data for the cakephp highchart plugin
- Highcharts: make y-axis extremes the same for two data series with different units
- Set minPointLength for one of two series in highchart
- Highcharts: setOptions for two different series of charts?
- Use a symfony route with parameters in a click event for highchart series
- how can i add in highcharts a different dashStyle just for a part of the graph
- Pie Chart for Data on Different Things with HighChart
- Setting Min and Max values for more than two Highchart Solid Gauges using function
- Can I use two "categories" arrays in a stacked bar chart?
- Use different markers in the same series of an irregular time highchart
- Highchart Drill Down do not work for different chart types on same page
- Two tool tip for two different charts
- Highchart: Can I use a different variable as the data labels?
- Unable to create Highchart where i can show different - different data on clicking category and series
- How can I use data.table or data.csv and extra data for click event handling
- Two legend styles for two stacked chart styles in highchart
- How Can we display blocked area for particular timeline in horizontal bar in gantt highchart
- How can I apply different background color to entire tooltip for different series in highcharts
- Why does my Highchart look different when I transfer my code from Jsfiddle to my server?
- How to parse datetime for use in highchart graph?
- How can I create a specific Json output for use with Highcharts?
More Query from same tag
- How to have a highcharts chart in a container of a fixed width, and with a horizontal scrollbar?
- How to make a Highcharts bar disappear?
- HighcharteR facetted item type chart
- Blank Highcharts div fixed by a reboot?
- Highcharts - How to choose a range to display with javascript?
- Proper JSON format for highcharts
- Highmaps min and max zoom level
- highcharts data labels overlaps the plotlines value
- adjust axes Highcharts plotted versus
- Half node in sankey Highchart
- How to generate multiple high charts in ng-repeat
- Highcharts Drilldown charts CodeIgniter
- How to trigger legend click event on outside when using Highchart and no using JQuery
- Create vertical lines for an interval using highstocks
- How to create a highcharter event function to create a “dropdown function” in Shiny R
- Want Stacked column highchart to represent data in two colomn
- HIghcharts xAxis labels out of order
- Highcharts one value per series column
- HighCharts Boxplot side by side Xaxis
- highcharts. How to shade the area between two vertical lines?
- HighCharts Parameters meaning - plotX,plotLeft,shapeArgs
- data from AJAX json request not loading in HighChart
- HightChart Error 13 with angular js, function and controller scope
- Highcharts XRange datetime format
- Highcharts load pointStart from JSON. Milliseconds to UTC time?
- Do we have undo option in high charts?
- R Highcharter: tooltip customization
- Add text to generated quadrant area by x and y plot lines only when hovering , highcharts
- Any chart library for funnel chart instead of highchart?
- Highcharts Gantt does not show ALL rows that are empty