带有Highstock的范围选择器中的步进线

时间:2015-09-01 08:31:34

标签: javascript highcharts highstock

我正在使用highstock的步骤线图,但我在使用步进线范围选择器时遇到了麻烦。你可以在jsfiddle here中看到一个例子。

我的图表就像我想要的那样:步骤线。但是,我尝试在范围选择器中使用step : true甚至plotOptions,但这不起作用。我在documentation中找不到任何内容。

1 个答案:

答案 0 :(得分:1)

您应该为导航器系列设置步骤参数。

 function show() {
    var typeField = document.getElementById('type');    //read selected type
    var s = typeField.selectedIndex;                    //index of the selected type
    var type = typeField.options[s].value.split("-");   //value of the var s - array format
    var resultsHtml = '';

    var carsLength = cars.length;
    for(var i = 0; i < carsLength; i++) {
        //functional for the select "all" and "individual" types
        //I need add a possibility for selecting combination of two and more types (diesel + petrol)
        if (type == 'all' || type.indexOf(cars[i].type) > -1) {
            resultsHtml += '<a href="' + cars[i].url +'">\
                            <div class="rollover"><img class="lazy playable" src="' + cars[i].img + '" alt="'+                                  cars[i].title +'" width="60px" height="50px"></div></a>'
        }
    }

    results.innerHTML = resultsHtml;
} 

示例:http://jsfiddle.net/hhresek7/1/