Skip to content

Colors for stacked bar chart #165

Description

@Gullyfield

Hello!

I am trying to render a stacked bar chart, and I'd like each of the segments in a bar to be a different color.

My simple mind says that'd need an array eg:

fill: (red, blue,green,yellow)

That does not work for me.

#let data = (
  ([1], 1,3,5,7,9),
  ([2], 2,3,4,5,6),
  ([3], 5,6,7,8,9)
)
#canvas({
chart.barchart(mode: "stacked",
                 size: (3, auto),
				 bar-style: (fill: (red, blue, green, yellow)),
                 value-key: (..range(1, 6)),
                 x-tick-step: 6,
                 data
				 )
                
}
)
error: expected color, gradient, tiling, or none, found array

I've tried a few other things, but I am clearly clueless. Please advise!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions