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

后端 未结 5 1139
灰色年华
灰色年华 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:33

    var envelopBorder =[[-20, 63], [-20, 85], null, null,null,null,[19, 130], [35,150], [60,150],[65,148], [80,140],[80,100],[65,82],[55,70],[40,67],[20,63],[15,63],[-20,63]] ;
    
    var dasshedBorder =[[-20, 85],[-20, 100],[1, 130],[19, 130]] ;
    
    Highcharts.chart('container', {
        chart: {
            type: 'line'
        },
        title: {
            text: 'Operating Envelop'
        },
            xAxis: {
            title: {
                enabled: true,
                text: 'Evaporating Temperature (°F)'
            },
    
            gridLineWidth: 0,
            lineWidth:1,
            startOnTick: true,
            endOnTick: true,
            showLastLabel: true
        },
        yAxis: {
            title: {
                text: 'Temperature (°C)'
            }
        },
        plotOptions: {
            line: {
                dataLabels: {
                    enabled: true
                },
                enableMouseTracking: false
            }
        },
        series: [{
            name: 'Normal',
            data: envelopBorder
        }, {
            name: 'Dash',
            data: dasshedBorder,
            dashStyle: 'dash'
        }]
    });
    

    Result :-

    jsfiddle.net/7c9929mg

提交回复
热议问题