Skip to content

Multiple bars in a single plot #1031

Description

@PatrickBuTaxdoo

Hello!

I want to display multiple bars in a single plot. I cannot find anything related in the docs, and also no example for that.
Adding multiple bars is not an issue by itself, but the bars are overlapping, and I cannot find an option to adjust the width of the bars. This is what I am getting:

grafik

using this code:

Plot.plot({
    marks: [
      Plot.barX(data, {
        y: 'stat',
        x: 'old',
        fill: '#4e79a7',
      }),
      Plot.barX(data, {
        y: 'stat',
        x: 'new',
        height: 5,
        fill: '#cc5555',
        dy: 10,
      }),
    ],
    x: {grid: true, label: 'Time (seconds)'},
    y: {grid: true, label: 'Metric'},
  });

How can I plot multiple bars, or just adjust the width/height of the bars?

strokeWidth, strokeHeight, height and width on the barX options do not seem to work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions