2011-02-25 47 views
0

我有一些我認爲比較簡單的Highcharts圖表,我想使用共享十字準線,但由於某些原因,我無法讓我的工具提示正常工作。這裏是我的javascript代碼:Highcharts十字線不能正常工作

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], 

               ]}, 
          ], 
}); 
+0

你能提供一個共享十字線應該是什麼樣子的例子嗎? – Robodude 2011-02-28 19:54:12

回答

3

我發現的唯一的事情是,在上面的JSON您在highchart例子把工具提示,而這提示(全部小寫)。

+0

這是問題所在。謝謝。 – dmcnelis 2011-03-04 14:03:34