简体   繁体   中英

Highcharts horizontal bar chart categories are sized incorrectly

I'm having a problem with Highcharts where each bar chart category is way too tall in a horizontal arrangement.

Here is an example:

类别大小错误的示例

The code used to generate the chart is as follows:

chart2 = new Highcharts.Chart({
        chart: {
          renderTo: 'wordchart1',
          defaultSeriesType: 'bar'
        },
        title: {
          text: 'Word Frequency Distribution'
        },
        xAxis: {
          categories: ['LIL POP SHOP','SWEET BOX','LITTLE BABY\'S ICE CREAM','SUGAR PHILLY','Please pick one:'              ],
          title: {
            text: ''
          }
        },
        yAxis: {
          min: 0,
          title: {
            text: 'Word Frequency Analysis',
            align: 'high'
          }
        },
        plotOptions: {
          bar: {
            dataLabels: {
              enabled: true
            }
          }
        },
        series: [{
          name: 'Word Frequency Analysis',
          data: [89,43,32,24,3              ]              }]
        });
      });

Any idea what may be the problem? Thanks!

您还可以定义pointWidth: http ://api.highcharts.com/highcharts#plotOptions.bar.pointWidth

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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