首页 > 解决方案 > 如何更改 HighChart 中“yAxis 标签”的宽度?

问题描述

我正在制作一个看起来像这样的多重图表: 在此处输入图像描述

我发现 HighCharts 可能是我的最佳来源。然后我有一个看起来像这样的图表:http: //jsfiddle.net/bardirian/7cpzxeth/1/show

正如您在 JSFiddle 中看到的,“yAxis 标签”的宽度未对齐。

这是我尝试过的,但不起作用:

g.highcharts-axis-labels.highcharts-yaxis-labels text {
  width:100px!important;
}

有人可以帮助以 100px 显示所有“yaxis-labels”吗?

标签: csshighcharts

解决方案


您将不得不使用chart.marginLeft API Doc

  chart: {
      type: 'scatter',
      plotBorderWidth: 3,
      zoomType: 'xy',
      backgroundColor:null,
      marginLeft:80
  },

小提琴


推荐阅读