簡體   English   中英

如何用高圖在x軸上創建斷點?

[英]How do I create a break on the x-axis with highcharts?

由於一個非常大的值,我試圖在我的X軸上添加一個中斷。 highcharts文檔建議我可以像這樣傳遞breaks

  breaks: [{
    from: 1000,
    to: 6000
  }]

但是,我的x軸仍顯示相同的方式。 我究竟做錯了什么?

 $(function() { $('#container').highcharts({ chart: { type: 'bar' }, xAxis: { categories: ['Africa', 'America', 'Asia', 'Europe', 'Oceania'], breaks: [{ from: 1000, to: 6000 }] }, plotOptions: { bar: { dataLabels: { enabled: true } } }, series: [{ name: 'Year 1800', data: [107, 31, 635, 203, 2] }, { name: 'Year 1900', data: [133, 156, 947, 408, 6] }, { name: 'Year 2012', data: [1052, 954, 8250, 740, 38] }] }); }); 
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script src="http://code.highcharts.com/highcharts.js"></script> <script src="http://code.highcharts.com/modules/broken-axis.js"></script> <div id="container" style="min-width: 310px; max-width: 800px; height: 400px; margin: 0 auto"></div> 

您希望在這種情況下在yAxis上中斷。

yAxis: {
    breaks: [{
        from: 1000,
        to: 8000,
        breakSize: 500 // Adjust accordingly
    }]
},

http://jsfiddle.net/nicholasduffy/mh18tdpy/

http://api.highcharts.com/highcharts#yAxis.breaks.breakSize

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM