如何在jquery中显示图表

how to display chart in jquery?

本文关键字:显示图 jquery      更新时间:2023-09-26

你能告诉我如何在高图或目标线高图中添加趋势线吗?我能实现在融合图中绘制。.http://jsfiddle.net/Tu57h/139/请参阅上面的fiddle链接在这个开发人员使用趋势线。我需要同样的东西在高图我们可以在高图中绘制趋势线

我试着在高图中做同样的事情,我取得了一点成功,但无法在高图中制作趋势线这是我的小提琴http://jsfiddle.net/ogwsL7j3/1/

我需要添加面包线在我的图表使用highcharts

我们可以显示如图所示的趋势线吗?

$(function () {
    $('#container').highcharts({
        chart: {
            type: 'areaspline'
        },
        title: {
            text: 'Average fruit consumption during one week'
        },
        legend: {
            layout: 'vertical',
            align: 'left',
            verticalAlign: 'top',
            x: 250,
            y: 300,
            floating: true,
            borderWidth: 1,
            backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'
        },
        xAxis: {
            categories: [
                'Monday',
                'Tuesday',
                'Wednesday',
                'Thursday',
                'Friday',
                'Saturday',
                'Sunday'
            ]
        },
        yAxis: {
        title: {
            text: ''
        },
        labels: {
            enabled:false
        }
    },
        tooltip: {
            shared: true,
            valueSuffix: ' units'
        },
        credits: {
            enabled: false
        },
        plotOptions: {
            areaspline: {
                fillOpacity: 0.8
            }
        },
        series: [{
            name: 'John',
            data: [3, 4, 3, 5, 4, 10, 12]
        }]
    });
});

有更新吗?

你可以在yAxis上使用情节线。

yAxis: {
        plotLines: [{
            color: '#FF0000',
            width: 2,
            label:{
            text:'trendline',
                align: 'right',
                x: 0
            },
            value: 210
        }]
    },
http://jsfiddle.net/3zs32jLv/2/