highchartsの公式ページにある棒グラフを参考に勉強してます。
縦軸の限界値が12ですが、これを10とか20とか任意に設定したい場合どうすれば良いのでしょうか?
【経緯】
と言いいますのは、これを参考に縦軸に「確率」を設定しようと思っています。
確率なので縦軸の範囲は「0~100%」に収めたいです。
ですが、このままだとデータによって限界値が自動で決まるため
限界値が120%とかになってしまいます。「0~120%」というのは気持ち悪いです・・・。
どこか設定するプロパティなどがあれば教えていただけますでしょうか?
宜しくお願い致します。
以下、公式サイトのサンプルのままですが掲載させていただきます。
html
1<script src="https://code.highcharts.com/highcharts.js"></script> 2<script src="https://code.highcharts.com/modules/data.js"></script> 3<script src="https://code.highcharts.com/modules/exporting.js"></script> 4 5<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div> 6 7<table id="datatable"> 8 <thead> 9 <tr> 10 <th></th> 11 <th>Jane</th> 12 <th>John</th> 13 </tr> 14 </thead> 15 <tbody> 16 <tr> 17 <th>Apples</th> 18 <td>3</td> 19 <td>4</td> 20 </tr> 21 <tr> 22 <th>Pears</th> 23 <td>2</td> 24 <td>0</td> 25 </tr> 26 <tr> 27 <th>Plums</th> 28 <td>5</td> 29 <td>11</td> 30 </tr> 31 <tr> 32 <th>Bananas</th> 33 <td>1</td> 34 <td>1</td> 35 </tr> 36 <tr> 37 <th>Oranges</th> 38 <td>2</td> 39 <td>4</td> 40 </tr> 41 </tbody> 42</table>
javascript
1return '<b>' + this.series.name + '</b><br/>' + 2 this.point.y + ' ' + this.point.name.toLowerCase();$(function () { 3 $('#container').highcharts({ 4 data: { 5 table: 'datatable' 6 }, 7 chart: { 8 type: 'column' 9 }, 10 title: { 11 text: 'Data extracted from a HTML table in the page' 12 }, 13 yAxis: { 14 allowDecimals: false, 15 title: { 16 text: 'Units' 17 } 18 }, 19 tooltip: { 20 formatter: function () { 21 return '<b>' + this.series.name + '</b><br/>' + 22 this.point.y + ' ' + this.point.name.toLowerCase(); 23 } 24 } 25 }); 26});
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。