0

我有一个相对简单的 Highcharts 图表,我想使用共享十字准线,但由于某种原因,我的工具提示无法正常工作。这是我的javascript代码:

var myChart = new Highcharts.Chart({
    chart: {
        renderTo: 'container',
        width: '675',
        height: '400',
    },
    toolTip: {
        crosshairs: {
            width: 2,
            color: 'gray',
            dashStyle: 'shortdot'
        },
        shared: true,
        enabled: true
    },

    xAxis: {
        title: {
            text: 'Date',
            align: 'middle',
            margin: 15,
        },
        reverse: false,
        type: 'datetime',
        opposite: false,
    },
    yAxis: [{

        title: {
            text: '% Change',
            align: 'middle',
            margin: 15,
        },
        reverse: false,
        opposite: false,
        },
    {
        title: {
            text: 'actual amount',
            align: 'middle',
            margin: 15,
        },
        reverse: false,
        opposite: true,
        }, ],
    title: {
        text: 'Comparison Chart',
        align: 'center',
        margin: 15,
    },
    series: [{
        pointInterval: 86400000,
        name: 'Your actual amount',
        type: 'spline',
        yAxis: '1',
        color: '#4572A7',
        data: [[1291248000000, 4140],
                                                    [1291334400000, 342],
                                                    [1291420800000, 56],
                                                    [1291507200000, 58],
                                                    [1291593600000, 712],

                                                    ]},
    {
        pointInterval: 86400000,
        dashStyle: 'ShortDashDot',
        name: 'Other\'s %',
        type: 'spline',
        yAxis: '0',
        color: '#89A54E',
        data: [[1291248000000, 47.02],
                                                    [1291334400000, -28.68],
                                                    [1291420800000, -59.98],
                                                    [1291507200000, 182.14],
                                                    [1291593600000, -12.81],

                                                ]},
    {
        pointInterval: 86400000,
        dashStyle: 'ShortDash',
        name: 'Your %',
        type: 'spline',
        yAxis: '0',
        color: '#AA4643',
        data: [[1291248000000, 246.73],
                                                    [1291334400000, -91.74],
                                                    [1291420800000, -83.63],
                                                    [1291507200000, 3.57],
                                                    [1291593600000, 1127.59],

                                                ]},
                             ],
});
4

1 回答 1

3

我发现的唯一一件事是,在上面的 JSON 中,您放置了 toolTip,而在 highchart 示例中,它是工具提示(全部小写)。

于 2011-03-03T23:13:58.557 回答