简体   繁体   English

设置高图边距

[英]set highchart margin

I have built some highcharts charts and I am displaying them one at a time on mouseover. 我已经构建了一些highcharts图表,我在鼠标悬停时一次显示一个。 The jquery creates a floating div (depending on the cursor) with a border line jquery使用边框线创建一个浮动div(取决于光标)

1px solid black

and then the highchart method is being called to draw the chart. 然后调用高图方法绘制图表。

The thing is that highcharts exceed the boundary and left and bottom border is not shown. 问题是,highcharts超出了边界,左边和下边框没有显示。

I tried 'margin' : 我试过'保证金':

chart:
    {
      renderTo: 'graph',
      defaultSeriesType: 'line',
      zoomType: 'x',
      margin: [ 10, 10, 10, 10]
    },

and still it does the same thing. 并且它仍然做同样的事情。

You would need to set the margins to at least 70 in order for the highchart to display decently. 您需要将边距设置为至少70才能使高图显示得体。 Also, if you are using and you know the size of the div you may want to specify the height and width of the chart as well. 此外,如果您正在使用并且您知道div的大小,则可能还需要指定图表的高度宽度 I would make it slightly smaller than the div. 我会让它比div略小。 Here is an example . 这是一个例子

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM