高图帮助 – 在图表方面遇到问题

huangapple go评论76阅读模式
英文:

highcharts help - stuck with chart

问题

我正在尝试创建以下图表 https://postimg.cc/n981pM1y,使用Highcharts。我已经完成了这个示例 https://jsfiddle.net/w9vncpk0/17/,但是我无法使每个系列在同一行上分组。我开始思考也许不可能以这种方式实现,但我想听听其他人的意见。 c

英文:

I'm trying to do the following chart https://postimg.cc/n981pM1y with Highcharts. I have done this example https://jsfiddle.net/w9vncpk0/17/ but I can't get each series to be grouped on the same line. I started thinking that it is not possible to do it this way but I would like another opinion c

答案1

得分: 0

这个图表可以很容易地使用Highcharts创建。您只需要使用 stacking 逻辑。

例如:

plotOptions: {
  series: {
    stacking: 'normal'
  }
},
series: [{
    name: 'Apagado',
    id: 'Apagado',
    color: 'red',
    stack: 'LTP 3569',
    data: [
      [0, 2],
      [1, 2]
    ]
  },
  {
    name: 'Moderando',
    id: 'Moderando',
    color: 'yellow',
    stack: 'LTP 3569',
    data: [
      [0, 2],
      [1, 3]

    ]
  },
  {
    name: 'Conduciendo',
    id: 'Conduciendo',
    color: 'green',
    stack: 'LTP 3569',
    data: [
      [0, 23],
      [1, 20]

    ]
  }, {
    name: 'Apagado',
    color: 'red',
    linkedTo: 'Apagado',
    stack: 'LTP 3570',
    data: [
      [0, 4],
      [1, 5]
    ]
  },
  {
    name: 'Moderando',
    color: 'yellow',
    linkedTo: 'Moderando',
    stack: 'LTP 3570',
    data: [
      [0, 7],
      [1, 5]

    ]
  },
  {
    name: 'Conduciendo',
    color: 'green',
    stack: 'LTP 3570',
    linkedTo: 'Conduciendo',
    data: [
      [0, 2],
      [1, 1]
    ]
  }
}]

演示: https://jsfiddle.net/BlackLabel/ht53g8d6/

文档: https://www.highcharts.com/docs/advanced-chart-features/stacking-charts

英文:

This chart can be easily created with Highcharts. You need to only use stacking logic.

For example:

  plotOptions: {
series: {
stacking: 'normal'
}
},
series: [{
name: 'Apagado',
id: 'Apagado',
color: 'red',
stack: 'LTP 3569',
data: [
[0, 2],
[1, 2]
]
},
{
name: 'Moderando',
id: 'Moderando',
color: 'yellow',
stack: 'LTP 3569',
data: [
[0, 2],
[1, 3]
]
},
{
name: 'Conduciendo',
id: 'Conduciendo',
color: 'green',
stack: 'LTP 3569',
data: [
[0, 23],
[1, 20]
]
}, {
name: 'Apagado',
color: 'red',
linkedTo: 'Apagado',
stack: 'LTP 3570',
data: [
[0, 4],
[1, 5]
]
},
{
name: 'Moderando',
color: 'yellow',
linkedTo: 'Moderando',
stack: 'LTP 3570',
data: [
[0, 7],
[1, 5]
]
},
{
name: 'Conduciendo',
color: 'green',
stack: 'LTP 3570',
linkedTo: 'Conduciendo',
data: [
[0, 2],
[1, 1]
]
}
]

Live demo: https://jsfiddle.net/BlackLabel/ht53g8d6/

Docs: https://www.highcharts.com/docs/advanced-chart-features/stacking-charts

huangapple
  • 本文由 发表于 2023年2月24日 05:02:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/75550296.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定