I want to implement the scrollbar in highcharts, not highstock because it will cost additional money for my company (just for a scrollbar, does not make sense). I have tried this but apparently does not help me:
How to enable highcharts x and y axis scrollbars? .
There are some examples here:
http://jsfiddle.net/fj6d2/3076/
https://www.highcharts.com/blog/news/224-scrollbars-for-any-axis/
but with highstock, I want to do the same thing with Highchart.
From what I have found out Highcharts does not support scrollbars. If I just insert use overflow: scroll on a wrapped div of the chart, that would still make my title center in the middle of a long div and also the y axis will be hidden when I go to the right of that long div.
Is there any way to have ScrollBar with the above things on a highchart (NOT HIGHSTOCK) ?
Here is my option
let options = {
legend: {
itemStyle: {
fontWeight: 'bold',
fontSize: '13px'
},
// width: 780,
itemWidth: 130,
floating: false
},
xAxis: {
position: {align: 'left'},
text: null,
}, // ,
// tickLength: 0
type: 'category',
categories: categories,
min: 0// ,
// max: 10
},
navigator: {
enabled: false
},
scrollbar: {
enabled: true,
showFull: false,
barBackgroundColor: 'rgb(44,89,142)',
barBorderRadius: 0,
barBorderWidth: 0,
buttonBackgroundColor: 'rgb(44,89,142)',
buttonBorderWidth: 0,
buttonArrowColor: 'white'
},
yAxis: {
// minorTickInterval: 'auto',
title: {
/* style: {
textTransform: 'uppercase'
}*/
}, // ,
min: 0,
// max: 20,
},
// General
background: '#FFFFFF',
chart: {
height: 500,
width: 3900,
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false,
type: 'column',
backgroundColor: '#FFFFFF',
style: {
fontFamily: 'Lucida Grande, Lucida Sans Unicode, Arial, Helvetica,
sans-serif'
},
borderColor: '#ACB2BC',
borderWidth: 1,
events: { load: function fn() { console.log(this); /* this.width(800);
*/ } } // #container
},
plotOptions: {
bar: {
dataLabels: {
enabled: true
}
},
candlestick: {
lineColor: '#404048'
},
pie: {
dataLabels: {
enabled: true,
distance: -50,
style: {
fontWeight: 'bold',
color: 'white'
}
},
allowPointSelect: true,
cursor: 'pointer',
data: values,
showInLegend: true
}
},
series: [{
name: 'reports',
data: values
}],
credits: {
enabled: false
}
};
I am using React. I just pass the options to a Highcharts.
this.chart = new Highcharts['Chart'](
this.refs.chart,
this.props.options);