Highcharts spline dataLabels overlapping

给你一囗甜甜゛ 提交于 2019-11-26 14:57:03

问题


I have a question about highchart's overlapping data labels. I have 2 spline data series and as you can see here http://jsfiddle.net/3E8V4/ some data labels are overlapping.

Question here is: is this overlapping even possible to prevent? If yes - how should I do it?

Code for plotoptions is like that:

plotOptions: {
            spline: {
                dataLabels: {
                    enabled: 'True',
                    crop: false,
                    overflow: 'none'
                },
                enableMouseTracking: false
            }
        },

回答1:


You can use that plugin for repositioning dataLabels: http://jsfiddle.net/menXU/1/ It's not perfect, since works only for max 2 series and requires disabled animations, or you will see little delay when repositioning dataLabels.

How to use? Copy StaggerDataLabels and isLabelOnLabel functions, and then use StaggerDataLabels in load and redraw events for chart.




回答2:


Sobis,

I don't have a answer that is exactly what you are expecting.

In this case what i would do is increase the max of yAxis by 10% of the maxi m of the data. provide zoom in/out. that will enable the user to get a values on top of the points

zoomType: 'xy'

here is an example http://jsfiddle.net/3E8V4/1/

hope you will find it useful



来源:https://stackoverflow.com/questions/20044479/highcharts-spline-datalabels-overlapping

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