Skip to content

Colors for stacked bar chart #165

@Gullyfield

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!

Metadata

Metadata

Assignees

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