Skip to content

Support for per-bar colors in bar charts #1228

@wissyfaty

Description

@wissyfaty

Hello,

I would like to assign a different color to each bar in a horizontal bar chart, but it seems the color parameter is
only available at the top-level (component) level and not at the row level.

Here is what I'm trying to achieve:

  SELECT
      'chart'                          AS component,
      'Comptes expirant prochainement' AS title,
      'bar'                            AS type,
      TRUE                             AS horizontal,
      TRUE                             AS labels;

  SELECT '30 jours' AS label,
      100           AS value,
      'green'       AS color;

  SELECT '60 jours' AS label,
      200           AS value,
      'orange'      AS color;

  SELECT '90 jours' AS label,
      300           AS value,
      'red'         AS color;

I would expect each bar to have its own color (green, orange, red), but currently only the top-level color parameter
is applied uniformly to all bars.

Is there a way to set a different color per row in a single-series bar chart? If not, would it be possible to add
color as a row-level parameter?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    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