Highcharts: Line graph with half solid line and half dotted line?

后端 未结 5 1145
灰色年华
灰色年华 2020-12-28 08:49

I\'m trying to show a time series line graph in highcharts - to the left of center is historical data, so the line needs to be solid. To the right of center is predicted da

5条回答
  •  一个人的身影
    2020-12-28 09:38

    I don't think you can have two different kind of line style in one series, but you can split the series into two, then specify the x coordinates for the second series to start where the first left off. Then you can set the dashStyle of that line.

    series: [{
                name: 'Tokyo',
                data: [7.0, 6.9, 9.5, 14.5, 18.2, 21.5]
            }, {
                name: 'New York',
                data: [{x: 5, y: 21.5}, {x: 6, y: 22.0}, {x: 7, y: 24.8}, {x: 8, y: 24.1}, {x: 9, y: 20.1}, {x:10, y: 14.1}, {x:11, y: 13}],
                dashStyle: 'dash'
            }]
    

    Here's a JSFiddle illustrating it: http://jsfiddle.net/mkremer90/zMZEV/1/

提交回复
热议问题