Reputation: 1316
Following is the chart that I have, I want to add xaxis for both the charts depending on their data inputs,
where should I make the change or add xaxis so that I can define the min max limits for the xaxis.
here is the fiddle: http://jsfiddle.net/pratik24/n24s2fyk/3/
code:
$(function () {
$('#container').highcharts('StockChart', {
navigator:{
enabled: false
},
scrollbar:{
enabled: false
},
rangeSelector : {
selected : 1,
enabled:false
},
yAxis: [{
min: -1e6,
max: 1e6,
labels: {
align: 'left',
format : ''
},
title: {
text: 'OHLC'
},
height: '30%'
}, { min: -1e6,
max: 1e6,
labels: {
align: 'left',
x: -3,
format : ''
},
title: {
text: 'Volume'
},
top: '65%',
height: '35%',
offset: 0
}],
series: [{
inverted: true,
type: 'scatter',
name: 'AAPL',
data: [7.0, 6.9, 9.5, 14.5, 18.4],
yAxis: 0
}, {
inverted: true,
type: 'scatter',
name: 'Volume',
data: [3,6,8,5,2],
yAxis: 1
}]
});
});
Thanks in advance,
Upvotes: 1
Views: 206
Reputation: 1316
Here is the solution:
[http://jsfiddle.net/pratik24/uga37ox0/2/][1]
[http://jsfiddle.net/uga37ox0/1/][1]
thanks to the guys from highcharts suppot team
xAxis: [{
},{
offset: -245,
min: 0,
max: 10
}],
series: [{
inverted: true,
type: 'scatter',
name: 'AAPL',
data: [7.0, 6.9, 9.5, 14.5, 18.4],
yAxis: 0,
xAxis: 1
}, {
inverted: true,
type: 'scatter',
name: 'Volume',
data: [3,6,8,5,2],
yAxis: 1,
xAxis:0
}]
Upvotes: 1