结合了条形图(非柱形图)和箱形图的Highchart

时间:2018-06-27 16:23:36

标签: javascript highcharts

我想将箱形图和条形图结合起来。我想要达到的目标类似于以下内容(除了具有折线图的折线图以外):

Combination Bar Chart

到目前为止,我想出的是这样的: Column and Box Plot

JSFiddle

将其从“列”更改为“条”会导致水平箱形图。

Highcharts.chart('container', {
  chart: {
    defaultSeriesType: 'boxplot',
  },
  xAxis: [{
    categories: ['Cumulative', 'US-CA'],
    type: 'category'
  }, {
    opposite: true,
    reversed: true,
    inverted: true,
    type: 'linear', 
  }],
  yAxis: {
    type: 'linear'
  },
  series: [{
    data: [
      [0, 54, 72.56, 110.4, 176.99, 242.8]
    ],
    name: 'Cumulative',
    type: 'boxplot',
    xAxis: 0,
  }, {
    data: [
      [1, 61.9, 79.9, 112.7, 177, 231.731999999999]
    ],
    name: 'Individual Lab',
    type: 'boxplot',
    xAxis: 0,
  }, {
    data: [{
      x: 13,
      y: 250
    }, {
      x: 7,
      y: 220
    }, {
      x: 1,
      y: 182
    }, {
      x: 2,
      y: 280
    }],
    name: 'Cutoffs',
    type: 'column',
    xAxis: 1,
    zIndex: -1
  }]
});

0 个答案:

没有答案