question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question] How to group Bar Chart data?

See original GitHub issue

Hi I want to achive this kind of chart with 2 datasets

my data look like this

const data1 = [
  {label: 'bad', svg: {fill: '#E55300'}, value: 5},
  {label: 'marginal', svg: {fill: '#EB742F'}, value: 10},
  {label: 'fair', svg: {fill: '#F5A77A'}, value: 20},
  {label: 'good', svg: {fill: '#9BD4DE'}, value: 30},
  {label: 'satisfactory', svg: {fill: '#1D8091'}, value: 10},
];
const data2 = [
  {label: 'bad', svg: {fill: '#E55300'}, value: 10},
  {label: 'marginal', svg: {fill: '#EB742F'}, value: 21},
  {label: 'fair', svg: {fill: '#F5A77A'}, value: 32},
  {label: 'good', svg: {fill: '#9BD4DE'}, value: 44},
  {label: 'satisfactory', svg: {fill: '#1D8091'}, value: 75},
];
const data3 = [
  {label: 'bad', svg: {fill: '#E55300'}, value: 50},
  {label: 'marginal', svg: {fill: '#EB742F'}, value: 81},
  {label: 'fair', svg: {fill: '#F5A77A'}, value: 77},
  {label: 'good', svg: {fill: '#9BD4DE'}, value: 33},
  {label: 'satisfactory', svg: {fill: '#1D8091'}, value: 21},
];

andd i group them like this

const barDataY = [
    {
      data: data1,
      svg: {
        stroke: 'red',
        strokeWidth: 2,
      },
    },
    {
      data: data2,
      svg: {
        stroke: 'dodgerblue',
        strokeWidth: 2,
      },
    },
    {
      data: data3,
      svg: {
        stroke: 'grey',
        strokeWidth: 2,
      },
    },
  ];

instead getting the chart that i wanted, i got barchart like this i wonder how do i group them by its data set, not by its value?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
ashokkumar88commented, Jan 5, 2021

@geovrisco Thanks.

0reactions
geovriscocommented, Jan 6, 2021

@ashokkumar88 no problem dude, glad that i could help

Read more comments on GitHub >

github_iconTop Results From Across the Web

A Complete Guide to Grouped Bar Charts | Tutorial by Chartio
A grouped bar chart allows for values to be compared on levels of two different categorical variables. Use this guide to learn how...
Read more >
Grouped Bar Chart in Excel - How to Create? (10 Steps)
1. u003cbr/u003eu003cimg alt=u0022Grouped-Bar-Chart-Example-1.0.1u0022 src=u0022https://www.wallstreetmojo.com/wp-content/uploads/2019/08/Grouped-Bar-Chart ... 2. u003cbr/u003eu003cimg alt=u0022Grouped-Bar-Chart-Example-1.0.1.5u0022 src=u0022https://www.wallstreetmojo.com/wp-content/uploads/2019/08/Grouped-Bar-Chart ... 3. u003cbr/u003eu003cimg alt=u0022Grouped-Bar-Chart-Example-1.2.0u0022 src=u0022https://www.wallstreetmojo.com/wp-content/uploads/2019/08/Grouped-Bar-Chart ...
Read more >
Creating a Grouped Bar Chart - Excel - eduCBA
Example #1 – Creating Grouped Bar Chart · 1. Select the table and go to the Insert menu, click on Recommended Charts and...
Read more >
How do I group different questions onto one bar chart?
Best Answer · Set the X-Axis to your field group · Then setup up your metric using the Top Box / Bottom Box...
Read more >
How To Make A Multiple Bar Graph In Excel - YouTube
In this tutorial, I'm going to show you how to easily create a multiple bar graph in Microsoft Excel. A multiple bar graph...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found