如图所示:
在显示tooltip时,红框框中的内容是highstock自己生成,我该如何自定义它的日期格式,或是隐藏掉它。
以下为config:
{
rangeSelector: {
labelStyle: {
display: 'none'
},
buttonTheme: {
title: '',
display: 'none' // 不显示按钮
},
buttons: [{
type: 'minute',
count: 30,
text: '1m'
}, {
type: 'minute',
count: 150,
}, {
type: 'minute',
count: 450,
}, {
type: 'minute',
count: 900,
}, {
type: 'hour',
count: 30,
}, {
type: 'hour',
count: 120,
}, {
type: 'day',
count: 30,
}, {
type: 'week',
count: 30,
}, {
type: 'month',
count: 30,
},],
selected: rgSelected,
inputEnabled: false // 不显示日期输入框
},
xAxis: {
dateTimeLabelFormats: {
millisecond: '%H:%M:%S.%L',
second: '%H:%M:%S',
minute: '%H:%M',
hour: '%H:%M',
day: '%m-%d',
week: '%m-%d',
month: '%y-%m',
year: '%Y'
}
},
tooltip: {
shared: true,
},
exporting: {enabled: false},//隐藏导出图片
credits: {enabled: false},//隐藏highcharts的站点标志
yAxis: [{
labels: {
align: 'right',
x: -3
},
height: '60%',
lineWidth: 2
}, {
labels: {
align: 'right',
x: -3
},
top: '65%',
height: '35%',
offset: 0,
lineWidth: 2
}],
series: [{
type: 'candlestick',
name: symbol.toUpperCase(),
id: 'candlestick',
color: 'green', //'green',
lineColor: 'green',
upColor: 'red', // 或 rgba(0,0,0,0) //'red',
upLineColor: 'red',
animation: false,
zIndex: 1,
data: ohlc,
tooltip: {
split: false,
shared: true,
headerFormat: '<span>{point.key}</span><br />',
pointFormat: '<span style="color: {series.color};font-size:16px" colspan="2">{series.name} </span><br />' +
'<span>开盘:</span><span style="text-align: right">{point.open}</span><br/>' +
'<span>最高:</span><span style="text-align: right">{point.high}</span><br/>' +
'<span>最低:</span><span style="text-align: right">{point.low}</span><br/>' +
'<span>收盘:</span><span style="text-align: right">{point.close}</span><br/>',
},
dataGrouping: {
enabled: false // 取消根据日期进行数据分组
}
}, {
type: 'column',
name: '成交量',
data: volume,
color: '#7cb5ec',
animation: false,
yAxis: 1,
tooltip: {
split: false,
shared: true,
headerFormat: '<span>{point.key}</span><br />',
pointFormat: '<span>成交量:</span><span style="text-align: right">{point.y}</span><br/>'
},
}]
}
问题出现的环境背景及自己尝试过哪些方法
相关代码
// 请把代码文本粘贴到下方(请勿用图片代替代码)
楼主,请问做出来了吗?我也遇到这个问题了