2013-10-05 70 views
1
     chart: { 
          renderTo: 'chart-selection', 
          backgroundColor: null, 
          type: 'scatter' 
         }, 
         title: { 
          text: txt + ' (' + title + ')' 
         }, 
         plotOptions: { 
          tooltip: { 
           crosshairs: true, 
           headerFormat: '<b>{point.x}</b>', 
           pointFormat: '<b>Volumn : {point.y}</b><br/>Price : {point.price}<br/>Change : {point.change}' 
          } 
         }, 
         xAxis: { 
          type: 'datetime' 
         }, 
         yAxis: { 
           title: { 
            text: title 
           }, 
           height: 200, 
           lineWidth: 2 
          }, 
         series: [{ 
           color: 'rgba(100, 100, 200, .5)', 
           data: datax 
          }] 

DATAX = [{X:1381942800000,Y:23.000,價格:26.00,變化率:0.00},{X:1382029200000,Y:45.000,價格:23.000,更改:0.00} ]。Highcharts(散射)工具提示notworking

此代碼不顯示工具提示

tooltip: { 
          crosshairs: true, 
          headerFormat: '<b>{point.x}</b>', 
          pointFormat: '<b>Volumn : {point.y}</b><br/>Price : {point.price}<br/>Change : {point.change}' 
         } 

回答

1

tooltip屬性並不意味着是直屬plotOptions,但該系列(或散射)的子屬性的plotOptions

在任何的內部的以下變化應該工作

plotOptions.series.tooltip

plotOptions: { 
    series: { 
     tooltip: { 
      crosshairs: true, 
      headerFormat: '<b>{point.x}</b>', 
      pointFormat: '<br /><b>Volumn : {point.y}</b><br/>Price : {point.price}<br/>Change : {point.change}' 
     } 
    } 
} 

plotOptions.scatter.tooltip

plotOptions: { 
    scatter: { 
     tooltip: { 
      crosshairs: true, 
      headerFormat: '<b>{point.x}</b>', 
      pointFormat: '<br /><b>Volumn : {point.y}</b><br/>Price : {point.price}<br/>Change : {point.change}' 
     } 
    } 
} 

series[i].tooltip

series: [{ 
     data: datax, 
     tooltip: { 
      crosshairs: true, 
      headerFormat: '<b>{point.x}</b>', 
      pointFormat: '<br /><b>Volumn : {point.y}</b><br/>Price : {point.price}<br/>Change : {point.change}' 
     } 
    }] 

@jsFiddle

+0

該scatter沒有股票圖表嗎? 在我使用Highcharts.StockChart之前 –

0

你需要使用的工具提示一般cofnigruation這樣可以去除plotOptions,並留下提示對象是這樣的:

xAxis: { 

}, 
tooltip:{ 
    crosshairs: true, 
     headerFormat: '<b>{point.x}</b>', 
     pointFormat: '<br /><b>Volumn : {point.y}</b><br/>Price : {point.price}<br/>Change : {point.change}' 
} 
+0

thx但它不工作... –

+0

scatter不能用於StockChart? –

+0

正常工作,請參閱示例http://jsfiddle.net/uZXPR/1/ –

0

我是在同樣的情況,什麼我錯過了我的index.js文件中的配置呼叫是

Highcharts.setOptions({ 
plotOptions: { 
area: { animation: false, enableMouseTracking: false, stickyTracking: true, shadow: false, dataLabels: { style: { textShadow: false } } }, 
arearange: { animation: false, enableMouseTracking: false, stickyTracking: true, shadow: false, dataLabels: { style: { textShadow: false } } }, 
areaspline: { animation: false, enableMouseTracking: false, stickyTracking: true, shadow: false, dataLabels: { style: { textShadow: false } } }, 
areasplinerange: { animation: false, enableMouseTracking: false, stickyTracking: true, shadow: false, dataLabels: { style: { textShadow: false } } }, 
bar: { animation: false, enableMouseTracking: false, stickyTracking: true, shadow: false, dataLabels: { style: { textShadow: false } } }, 
boxplot: { animation: false, enableMouseTracking: false, stickyTracking: true, shadow: false, dataLabels: { style: { textShadow: false } } }, 
bubble: { animation: false, enableMouseTracking: false, stickyTracking: true, shadow: false, dataLabels: { style: { textShadow: false } } }, 
column: { animation: false, enableMouseTracking: false, stickyTracking: true, shadow: false, dataLabels: { style: { textShadow: false } } }, 
columnrange: { animation: false, enableMouseTracking: false, stickyTracking: true, shadow: false, dataLabels: { style: { textShadow: false } } }, 
errorbar: { animation: false, enableMouseTracking: false, stickyTracking: true, shadow: false, dataLabels: { style: { textShadow: false } } }, 
funnel: { animation: false, enableMouseTracking: false, stickyTracking: true, shadow: false, dataLabels: { style: { textShadow: false } } }, 
gauge: { animation: false, enableMouseTracking: false, stickyTracking: true, shadow: false, dataLabels: { style: { textShadow: false } } }, 
heatmap: { animation: false, enableMouseTracking: false, stickyTracking: true, shadow: false, dataLabels: { style: { textShadow: false } } }, 
//line: { animation: false, enableMouseTracking: false, stickyTracking: true, shadow: false, dataLabels: { style: { textShadow: false } } }, 
pie: { animation: false, enableMouseTracking: false, stickyTracking: true, shadow: false, dataLabels: { style: { textShadow: false } } }, 
polygon: { animation: false, enableMouseTracking: false, stickyTracking: true, shadow: false, dataLabels: { style: { textShadow: false } } }, 
pyramid: { animation: false, enableMouseTracking: false, stickyTracking: true, shadow: false, dataLabels: { style: { textShadow: false } } }, 
scatter: { animation: false, enableMouseTracking: false, stickyTracking: true, shadow: false, dataLabels: { style: { textShadow: false } } }, 
//series: { animation: false, enableMouseTracking: false, stickyTracking: true, shadow: false, dataLabels: { style: { textShadow: false } } }, 
solidgauge: { animation: false, enableMouseTracking: false, stickyTracking: true, shadow: false, dataLabels: { style: { textShadow: false } } }, 
spline: { animation: false, enableMouseTracking: false, stickyTracking: true, shadow: false, dataLabels: { style: { textShadow: false } } }, 
treemap: { animation: false, enableMouseTracking: false, stickyTracking: true, shadow: false, dataLabels: { style: { textShadow: false } } }, 
waterfall: { animation: false, enableMouseTracking: false, stickyTracking: true, shadow: false, dataLabels: { style: { textShadow: false } } }, 
}, 
chart: { 
reflow: false, 
events: { 
redraw: function() { 
} 
}, 
animation: false 
}, 
exporting: { 
enabled: false 
}, 
credits: { 
enabled: false 
}, 
lang: { 
decimalPoint: ',', 
thousandsSep: '.' 
}, 
tooltip: { 
yDecimals: 2 // If you want to add 2 decimals 
} 
, 
colors: ['rgb(124, 181, 236)'] 
}); 

最後我發現這2天之後:) ... 我真的很抱歉在這裏忙於這個愚蠢的問題。當我在我的index.js上刪除了這個配置調用後,我所有的圖表工具提示都被修復了。 我希望我能幫助任何有同樣問題的人。