在Highcharts上非常小的规模

时间:2016-10-20 08:53:07

标签: highcharts

我在.html页面上有这个脚本来显示图表。我的值从-1到1,我的值为0.0045。可以在Y轴上定义这个比例吗?

<script>
        function js_fun() {

        $.getJSON('/myopteboard/data/selectedEngines/'
                + getAllEnginesIdsSelected(), function(datas) {

            $.each(datas, function(index, indexData) {
                data = indexData.evidencesValues;
                console.log(data);
                drawChart(data, indexData.name);
            });

        });
    }

    var data = [];

    var options1 = {
        chart : {
            renderTo : 'thermal_graph'
        },
        yAxis : {
            labels : {
                format : '{value:.002f}'
            }
        },
        series : []
    };

    var drawChart = function(data, name) {

        console.log(name);
        // 'series' is an array of objects with keys: 'name' (string) and 'data' (array)
        var newSeriesData = {
            name : name,
            data : data
        };

        // Add the new data to the series array
        options1.series.push(newSeriesData);

        // If you want to remove old series data, you can do that here too

        // Render the chart
        var chart = new Highcharts.Chart(options1);
    };
</script>

1 个答案:

答案 0 :(得分:0)

下次请为您的代码提供小提琴。

对轴http://jsfiddle.net/Paulson/zwwsuc0L/

尝试tickInterval选项