Search code examples
angularjshighchartshighcharts-ngjstockchart

Is there a way to to always show the data along with tooltip data rather on on hover only in highcharts-stockchart?


Demonstration image For the stockchart, I'm calculating the rainfall data. For that my max, min, avg is fixed but the Rainfall data changes in hover of the graph by tooltip. I want all other information to be static and always shown and the rainfall being updated on hover over the graph.

Currently I'm mapping it to this.points.map(function(point) but it all the information shows only on hover.


Solution

  • For the tooltip to always be visible in your case, overwrite:

    • hide from Tooltip.prototype
    • hideCrosshair from Axis.prototype

    Highcharts.Tooltip.prototype.hide = function() {};
    Highcharts.Axis.prototype.hideCrosshair = function() {};
    

    Live demo: http://jsfiddle.net/BlackLabel/kfpLyvo4/

    Docs: https://www.highcharts.com/docs/extending-highcharts