E
E
Evgeny Ivanov2018-06-22 08:59:48
JavaScript
Evgeny Ivanov, 2018-06-22 08:59:48

How to use Highcharts boost in my script?

Link to the article I'm trying to do (only 1 sheet)
https://www.highcharts.com/docs/advanced-chart-fea...
I connected the boost.js script. I am using the highstock.js
library . An article about boost.js is in highcharts . (Or maybe the library is not applicable to highstock?) But anyway... I have my working script that displays a graph.

var GRAPH1seriesOptions = [],
GRAPH1seriesCounter = 0,
GRAPH1names = ['my_new_data'];

function createChartGRAPH1() {
Highcharts.stockChart('GRAPH1_container', {

//Boost
//boost: {useGPUTranslations: true}, //наверно тут?
//series: [{boostThreshold: 1 }], //может тут?, хотя врят ли

title: {text: 'График'},
credits: {enabled: false},
rangeSelector: {enabled: false}, 
navigator: {enabled: false}, 
navigation: {buttonOptions: {enabled: false}}, 
scrollbar: {enabled: false}, 
colors: ['#FF0000'],

chart: 
{zoomType: 'x',},
xAxis: {type: 'datetime'},
yAxis: {},
legend:{layout: 'vertical',align: 'bottom',verticalAlign: 'top',enabled: true},


plotOptions: 
{
series: {
//boostThreshold: 1, - или тут?. Но тут глючит - скрывает график. Не ясно... (
animation: false,
compare: 'percent',
showInNavigator: true
}
},

tooltip: {pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.y}</b>({point.change}%)<br/>',valueDecimals: 4,split: true},
series: GRAPH1seriesOptions
});
}

$.each(GRAPH1names, function (i, name) {
$.getJSON('actions.php?get_graph_data&graph=GRAPH1&show_graph_date_begin=74&show_graph_date_end=86&cryptocurrency_id_name=' + name+ '&callback=?', function (data) {
        GRAPH1seriesOptions[i] = {
            name: name,
            data: data
        };
        GRAPH1seriesCounter += 1;
        if (GRAPH1seriesCounter === GRAPH1names.length) {
            createChartGRAPH1();
        }
    });
});

And here is an example of a script with a boost, from an off site
{
boost: {useGPUTranslations: true},
title: {text: 'Highcharts Boost' },
series: [{
     boostThreshold: 1, // Boost when there are more than 1                     
                            // point in the chart.
        data: ,
    }]
};

How to use Highcharts boost in my script? Where and what to insert?
Of course, I tried different options (copied the settings above to different places in the code), but I did not notice the performance.
Note that unlike the example, my data is coming in using getJSON.
(I did not come up with this - there are such examples in Highcharts)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question