highcharts context menu hidden for small charts

霸气de小男生 提交于 2020-01-24 00:47:06

问题


I am migrating a dashboard type screen to highcharts and would like to use the default context menu (for exporting various image formats and printing the chart).

The problem is that a lot of these charts are small gauge type charts and the context menu gets hidden when charts get below a certain size, mainly due to the fact that the context menu appears above the button for small charts size.

Is there anyway to make the context menu always appear below the button? I know I can limit the options and this will solve the problem but I would ideally like to use the default options list. Also I don't really want to have to calculate positions and move it myself.

See jsfiddle

see code at jsfiddle

回答1:


Add the following styles to the context menu.

.highcharts-contextmenu {
    bottom: auto !important;
    top: 5px;
}

FIDDLE




回答2:


Not sure if it would work for your situation, but have you considered using their pie chart with the legend at the bottom?

http://www.highcharts.com/demo/pie-legend



来源:https://stackoverflow.com/questions/15800674/highcharts-context-menu-hidden-for-small-charts

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!