Highchart/stock tooltip formatter for both series and flags

highcharts

Solution

One way is to create a tooltip formatter that checks if the current object is a point.

tooltip: {
            formatter: function(){
                if(this.point) {
                    return "this is a flag"
                }
                else {
                    return "this is a line"
                }
            }                
        }

You could go one step further and give your flags names and then check if the point has a name (instead of if it just exists) to prevent non-flag points from getting the same format.

Here is your example modified to reflect the former http://jsfiddle.net/aTcFe/

Problem

In the following example how can i format the tooltip for both series AND flags? http://jsfiddle.net/gh/get/jquery/1.7.1/highslide-software/highcharts.com/tree/master/samples/stock/plotoptions/flags/ I want to show extra information in series tooltip and other data in flag tooltip.

Original source