Question

enter image description here

I want the gradline and the xaxis started in the same line, I tried set the yaxis.min and so on。 it don't work, so some one could help me on this?

            chart = new Highcharts.Chart({
            chart: {
                renderTo: 'container',
                type: 'line'
            },
            title: {
                text: 'text'
            },
            xAxis: {
                categories: [],
                labels: {
                    style: {
                        width: '50px',
                        'min-width': '50px'
                    }
                }
            },
            yAxis: {
                categories: [],
                title: {
                    text: 'text'
                },
                min: 0,
            },
            series: [
                {
                    name: 'name',
                    type: 'spline'
                }
            ]

This is my chart option, and I dynamicly update the values of xAxis and yAxis, this's my update code

            chart.yAxis[0].setExtremes(0, maxy);
            chart.xAxis[0].setCategories(timeArr);
            chart.series[0].setData(valArr);

timeArr is the string array about time, valArr is my data, maxy is max of the valArr.

Was it helpful?

Solution

In general it should work fine: http://jsfiddle.net/bteWs/31/ (try to update to 4.0.1 version)

However, I advice to remove categories from yAxis, since you want numeric values, right?

        yAxis: {
            categories: [], //remove that option
            title: {
                text: 'text'
            },
            min: 0,
        },
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top