【问题标题】:how to show column and area charts with different y axis with same category and same x axis in highcharts如何在highcharts中显示具有相同类别和相同x轴的不同y轴的柱形图和面积图
【发布时间】:2015-05-05 12:49:33
【问题描述】:

我想显示具有不同 y 轴但相同 x 轴和相同类别的面积图和柱形图。

   $('#container').highcharts({
    title: {
        text: 'Combination chart'
    },
    xAxis: {
        categories: ['Apples', 'Oranges', 'Pears', 'Bananas', 'Plums']
    },
    labels: {
        items: [{
            html: 'Total fruit consumption',
            style: {
                left: '50px',
                top: '18px',
                color: (Highcharts.theme && Highcharts.theme.textColor) || 'black'
            }
        }]
    },
    series: [{
        type: 'column',
        name: 'Jane',
        data: [3, 2, 1, 3, 4]
    }, {
        type: 'column',
        name: 'John',
        data: [2, 3, 5, 7, 6]
    }, {
        type: 'column',
        name: 'Joe',
        data: [4, 3, 3, 9, 0]
    }, {
        type: 'area',
        name: 'Average',
        data: [3, 2.67, 3, 6.33, 3.33],
        center: [0, 80],
        size: 100,
        showInLegend: false,
        dataLabels: {
            enabled: false
        }
    }]
});

我想要这样,这里只显示示例图像 (http://i.stack.imgur.com/H6rnm.png)

【问题讨论】:

    标签: jquery highcharts dotnethighcharts


    【解决方案1】:

    您可以使用 y 轴的 'top' 和 'height' 属性来实现:

    yAxis: [{
      height:100
    },{
      top:110,
      height:75
    }]
    

    例子:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-11-26
      • 2018-06-03
      • 2015-09-11
      • 1970-01-01
      • 2013-01-22
      • 2020-06-11
      • 1970-01-01
      • 2020-12-17
      相关资源
      最近更新 更多