开发者

Highcharts Crosshairs not working

I have what I'd consider a relatively simple Highcharts chart that I want to use shared crosshairs, but for some reason, I can't get my tool tip to work properly. Here is my javascript code:

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,开发者_Python百科 246.73],
                                                    [1291334400000, -91.74],
                                                    [1291420800000, -83.63],
                                                    [1291507200000, 3.57],
                                                    [1291593600000, 1127.59],

                                                ]},
                             ],
});


The only thing I spotted was that in the JSON above you've put toolTip whereas in the highchart examples it's tooltip (all lower case).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜