- @http://jsfiddle.net/jugal/cABfL/?
, height yAxis top,
yAxis: [{
top: 300,
lineWidth: 2,
offset: 0,
height: 200,
tooltip: {
enabled: true,
formatter: function() {
return this.series.name + ": " + $wnd.Highcharts.numberFormat(this.y, 2);
}
}
},
{
height: 200,
lineWidth: 2,
offset: 0,
tooltip: {
enabled: true,
formatter: function() {
return this.value + 50;
}
}
}],
@http://www.highcharts.com/stock/demo/candlestick-and-volume
(Also what other ways are there to create a similar chart?). - , , , highchart , , .
.
, , 1 1 . , , , - , ( , ), , , , X - Y, , .. , , X.
, . ( lineWidth:50) ( Y ) , , . Y , . , Y , . , , , mouseOver . , , , , , ( , ) .
function createSeries(data, yAxisIndex) {
var i;
var series = [];
for (i = 0; i < data.length - 1; i++) {
var start = data[i];
var end = data[i + 1];
series.push({
yAxis: yAxisIndex,
animation: false,
stack: 0,
data: [[start, 0], [end, 0]],
lineWidth: 50,
marker: {
enabled: false
},
tooltip: {
pointFormat: function() {
return "";
}
},
events: {
mouseOver: function() {
alert(this.data[1].x - this.data[0].x);
}
},
showInLegend: false
});
}
return series;
}
, , - , highchart.
jsFiddle: http://jsfiddle.net/jugal/cABfL/