我正在使用图表显示我的股票数据。我正在使用Highcharts。但我没有得到适当的输出。看到图像Highcharts/Highstocks jQuery - 滚动,缩放和页边距问题
问题:
保证金:
正如你可以看到在y轴上的利润率是非常高的,因为这是我OHLC数据显示效果非常瘦。几点都没有得到突出显示在鼠标悬停在:
当我尝试悬停在某些方面它并没有告诉我这一点的数据。它坚持以前的观点数据。蓝区绿荫底部:
正如你可以看到在底部的蓝色区域是根据特定区域中的数据不改变。滚动已发行:
当我尝试移动滚动条或尝试增加其大小,它被卡在最右侧。 (所以不能因为它卡住在右侧,当我尝试将其移动到移动滚动。)放大问题:
当我试着使用缩放选项来放大我不能够放大我的数据。对于所有的放大仍然等同于“全部”选项
我在this script做了一些修改:(两个窗格,烛台和体积)来接收我的数据。
我正在使用$ .getJSON从PHP文件检索所有实时数据并执行所有操作。
我无法创建它的小提琴,因为它是我的实时股票市场数据。
下面是代码:
$(function() {
$.getJSON('get_data.php?type=ohlc', function(data) {
// split the data set into ohlc and volume
var ohlc = [],
volume = [],
dataLength = data.length;
alert(data);
for (i = 0; i < dataLength; i++) {
ohlc.push([
data[i]['SQLDT'], // the date
parseFloat(data[i]['OPN']), // open
parseFloat(data[i]['HGH']), // high
parseFloat(data[i]['LWE']), // low
parseFloat(data[i]['CLS']) // close
]);
volume.push([
data[i]['SQLDT'], // the date
parseFloat(data[i]['VOL']) // the volume
])
}
// set the allowed units for data grouping
var groupingUnits = [[
'week', // unit name
[1] // allowed multiples
], [
'month',
[1, 2, 3, 4, 6]
]];
// create the chart
chart = new Highcharts.StockChart({
chart: {
renderTo: 'container',
alignTicks: false
},
rangeSelector: {
selected: 1
},
title: {
text: 'AAPL Historical'
},
xAxis:[ {
min: 10
},{
min: 10
}],
yAxis: [{
title: {
text: 'OHLC'
},
height: 200,
lineWidth: 2,
}, {
title: {
text: 'Volume'
},
top: 300,
height: 100,
offset: 0,
lineWidth: 2
}],
scrollbar: {
enabled: true
},
series: [{
type: 'candlestick',
name: 'AAPL',
data: ohlc,
dataGrouping: {
units: groupingUnits
}
}, {
type: 'column',
name: 'Volume',
data: volume,
yAxis: 1,
dataGrouping: {
units: groupingUnits
}
}]
});
});
});
请问我可以知道downvotes的原因吗? –
我在同一时间面临这些问题,他们可能不会出现许多原因bcz。我猜der可能只是编码中的一个bug,比如margin或者somethig bcoz,其中的图表非常失真 –