最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Highcharts - Force Categories in x-axis to be shown, even without data - Stack Overflow

programmeradmin0浏览0评论

I'm wondering if there's a way to force Highcharts to show ALL of the categories passed into its x-axis without giving filler data to hack it into working. For example, / has 3 extra x-axis categories specified (foo, bar, baz) without any actual data (the series won't necessarily have data for the respective categories), and they aren't showing up on the chart. Can this be done? Thanks!

I'm wondering if there's a way to force Highcharts to show ALL of the categories passed into its x-axis without giving filler data to hack it into working. For example, http://jsfiddle.net/cbargren/Sdnqu/ has 3 extra x-axis categories specified (foo, bar, baz) without any actual data (the series won't necessarily have data for the respective categories), and they aren't showing up on the chart. Can this be done? Thanks!

Share Improve this question asked May 30, 2012 at 20:49 ChrisChris 1,0492 gold badges14 silver badges24 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 18

Set the max on the xAxis to the index of the last category you want to show. See this jsfiddle

xAxis: {
       categories: ['Apples', 'Bananas', 'Pears', 'Oranges', 'foo', 'bar', 'baz'],
       max:6
},
发布评论

评论列表(0)

  1. 暂无评论