Answers for "Highcharts ToolTip - Programatically set always visible tooltip on latest Point"

0

Highcharts ToolTip - Programatically set always visible tooltip on latest Point

// Highcharts ==> Making always visible tooltip pointing to latest values
// add this to load : functions settings
chart_one.tooltip.refresh(chart_one.series[0].points[19]);

// Highcharts ==> following is the sample which shows where to add the changes

chart: {
            type: 'spline',
            backgroundColor: {
                linearGradient: [0, 0, 500, 500],
                stops: [
                    [0, 'rgb(255, 255, 255)'],
                    [1, 'rgb(200, 200, 255)']
                ]
            },
            animation: Highcharts.svg, // don't animate in old IE
            marginRight: 10,
            
            events: {
                load: function () {

                    // set up the updating of the chart each second
                    var series = this.series[0];
                    setInterval(function () {
                        var x = (new Date()).getTime(), // current time
                            y = a;
                        series.addPoint([x, y], true, true);

                        //for always on display value in tootip
                      	// points[0] shows which point in the chart to show in tooltip
                        chart_one.tooltip.refresh(chart_one.series[0].points[0]);
                        //console.log("this chart "+ chart_one.series[0].points[0]);
                    }, 3000);
                }
            }
            
        }
Posted by: Guest on September-21-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language