javascript - HighCharts Orgcharts 可滚动容器
问题描述
我对 highcharts 组织结构图有疑问。问题是,那个图表会很大,我需要水平滚动条作为图表容器,或者让图表水平滚动。
我曾尝试启用图表的滚动条或使用 css 使图表容器可滚动,但没有运气,highcharts 试图使图表适合窗口大小,这对于这种情况是不可接受的。
尝试使用下面的 js 代码启用滚动条
scrollbar: {
enabled:true,
barBackgroundColor: 'gray',
barBorderRadius: 7,
barBorderWidth: 0,
buttonBackgroundColor: 'gray',
buttonBorderWidth: 0,
buttonArrowColor: 'yellow',
buttonBorderRadius: 7,
rifleColor: 'yellow',
trackBackgroundColor: 'white',
trackBorderWidth: 1,
trackBorderColor: 'silver',
trackBorderRadius: 7
},
并使用 css 对容器使用样式,例如
<style>
#container {
min-width: 300px;
margin: 1em auto;
border: 1px solid silver;
overflow: scroll !important;
}
#container h4 {
text-transform: none;
font-size: 14px;
font-weight: normal;
}
#container p {
font-size: 13px;
line-height: 16px;
}
</style>
结果可以在下面提供的小提琴中查看
https://jsfiddle.net/72v36msx/
所以问题是 - 有没有办法让图表水平滚动并获得漂亮的视图,而不会使节点变得如此之小,就像我提供的小提琴一样。
任何帮助将不胜感激 !
解决方案
该scrollbar
功能仅适用于 Highstock。创建自定义滚动条设置chart.width
为高于容器宽度的值。
CSS:
#container {
min-width: 300px;
overflow: scroll !important;
}
JS:
chart: {
width: 1200,
...
}
推荐阅读
- sql - Psql,pgAdmin 不显示插入的表,尽管项目正在运行,但我很困惑
- java - 在 PUT Spring Boot 中添加单个项目或项目列表 + 将项目列表发布到 Postman 中的 Java 列表
- scala - 当类型为 A (Scala) 时默认设置什么
- android - 两个具有相同效果的 OnClickListener(样板文件)
- wordpress - WordPress add_user_meta / update_user_meta 不工作(已解决)
- jquery - Boostrap 3 剪贴板和带有动态 ID 的工具提示
- javascript - 视频流与 nodejs 不和谐 webrtc
- python - 在不同的 CPU 上运行一个函数
- node.js - Mongoose:尝试查找存储在数组中的多个条件的文档
- python - 有什么方法可以计算 dtype('
我做了一个减去两个日期时间列的操作,以找出这两个日期之间的持续时间。我对 python 非常陌生,对网站也很陌生,我想知道如何处理 dtype('<m8[ns]'),因为结果输出如下:
ar = pd.to_datetime(['12/31/2015 23:55','1/1/2016 2:47']) print(ar[1]-ar[0])