Jquery 如何启用Highcharts滚动条?
我试着做这件事Jquery 如何启用Highcharts滚动条?,jquery,scrollbar,highcharts,highstock,Jquery,Scrollbar,Highcharts,Highstock,我试着做这件事 scrollbar: { enabled: true } 但它不起作用 我尝试使用highstocks附带的highcharts.js。。这也不管用。 我做错什么了吗?类似的问题已经得到了回答 您可以参考以下内容: 如果您的代码仍然无法工作,您可以尝试更改以下内容: <script type="text/javascript" src="js/highcharts.js"></script> 最后,您可以添加一次要查看的数据点数量,例如“min
scrollbar: {
enabled: true
}
但它不起作用
我尝试使用highstocks附带的highcharts.js。。这也不管用。
我做错什么了吗?类似的问题已经得到了回答 您可以参考以下内容:
如果您的代码仍然无法工作,您可以尝试更改以下内容:
<script type="text/javascript" src="js/highcharts.js"></script>
最后,您可以添加一次要查看的数据点数量,例如“min:6”:
xAxis:{
类别:[一月、二月、三月、四月、五月、六月、七月、八月、九月、十月、十一月、十二月],
最小:6
},
在回答此问题时,可以通过highstock js添加滚动条。
我设法为我的柱状图实现了一个优雅而简单的滚动条解决方案,只使用highcharts js,不使用highstock,如下所示:
chart: {
type: 'column',
scrollablePlotArea: {
minWidth: {{ count($period_interval_categories) * 70}},
// nr of interval data x (40 + 30) where 40 are column width pixels and
// 30 is additional distancing between columns;
// Increase spacing pixels if needed
scrollPositionX: 1
}
},
plotOptions: {
column: {
stacking: 'normal',
pointWidth: 40, // column width in pixels
dataLabels: {
// enabled: true
}
}
},
其中,$period\u interval\u categories在我的图表中表示x轴上的周期,包括天、周、月等
请出示您的代码好吗?
<script type="text/javascript" src="https://code.highcharts.com/stock/highstock.js"></script>
scrollbar: {
enabled: true
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
min: 6 <!-- LOOK at this -->
},
chart: {
type: 'column',
scrollablePlotArea: {
minWidth: {{ count($period_interval_categories) * 70}},
// nr of interval data x (40 + 30) where 40 are column width pixels and
// 30 is additional distancing between columns;
// Increase spacing pixels if needed
scrollPositionX: 1
}
},
plotOptions: {
column: {
stacking: 'normal',
pointWidth: 40, // column width in pixels
dataLabels: {
// enabled: true
}
}
},