自动xAxis如何在高图中标记旋转

时间:2016-05-11 09:11:53

标签: highcharts

我使用Highchart绘制我的图表。我用:

 <div class="player">
    <div class="mediaplayer">
      <video id="video1">
        <source src="http://clips.vorwaerts-gmbh.de/VfE_html5.mp4" type="video/mp4" />
      </video>
      <video id="video2">
        <source src="http://clips.vorwaerts-gmbh.de/VfE_html5.mp4" type="video/mp4" />
      </video>
  </div>
  <table>
    <tr>
      <th>Time</th>
      <td>
          <input class="time-slider" type="range" disabled value="0" step="any" />
      </td>
    </tr>
    <tr>
      <td>
          <input value="Play" type="button" class="play" />
      </td>
    </tr>
    <tr>
      <td>
         <input value="Stop" type="button" class="pause" />
      </td>
    </tr>
    <tr>
      <th>Mute</th>
      <td>
        <input class="muted" type="checkbox" />
      </td>
    </tr>
    <tr>
      <th>Volume</th>
      <td>
        <input class="volume-slider" type="range" value="1" max="1" step="0.01" />
      </td>
    </tr>
  </table>
</div>

用于在标签数量较大时旋转xaxis标签。 但我希望标签数量很大时标签会自动旋转。 有没有办法做到这一点? 我该怎么办?

谢谢

1 个答案:

答案 0 :(得分:3)

默认情况下,Highchart会自动旋转。您可以使用:

xAxis: {
        labels: {
            autoRotation: [-10, -20, -30, -40, -50, -60, -70, -80, -90]
        }
    },

参见此链接中的示例: http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/xaxis/labels-autorotation-0-90/

或默认情况下: http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/xaxis/labels-autorotation-default/