swimlane / ngx-charts

:bar_chart: Declarative Charting Framework for Angular
https://swimlane.github.io/ngx-charts/
MIT License
4.3k stars 1.15k forks source link

how I set two sets of data in vertical bar stacked column chart #937

Open Ravi20jan opened 6 years ago

Ravi20jan commented 6 years ago

I'm submitting a ... (check one with "x")

Current behavior

Expected behavior

Reproduction of the problem

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

my Data set is ---> data = [ { 'name': 'Jan', 'series': [ { 'name': '2010', 'value': 600, }, { 'name': '2011', 'value': 29 }, { 'name': '2012', 'value': 70 }, { 'name': '2014', 'value': 25 } ] }, ];

I want to create two bar in Jan column

marjan-georgiev commented 6 years ago

I'm not sure I understand your question. Are you trying to render two bars? In that case you need another group in your data:

[
  {
    "name": "Germany",
    "series": [
      {
        "name": "2010",
        "value": 7300000
      },
      {
        "name": "2011",
        "value": 8940000
      }
    ]
  },
​
  {
    "name": "USA",
    "series": [
      {
        "name": "2010",
        "value": 7870000
      },
      {
        "name": "2011",
        "value": 8270000
      }
    ]
  }
]