Skip to content

Hackathon 25.3: A Chart ignores the theme until styled mode is turned on, and the docs that list the style properties do not say so #12700

Description

@manolo

Description

A Chart renders with Highcharts' own palette on a hardcoded white plot area, whatever the colour scheme is. The --vaadin-charts-* style properties are inert: the component's stylesheet guards every one of them behind :where([styled-mode]), and Flow does not set it.

The switch is configuration.getChart().setStyledMode(true).

Reproduction

09-charts-styled-mode.zip is one view with the same chart twice, on a page in the dark colour scheme, and one line of difference between them. Run it with mvn spring-boot:run and open port 8110. default-vs-styled.png is what it draws.

What the SVG carries:

Default setStyledMode(true)
.highcharts-background fill #ffffff no attribute
series fill #2caffe no attribute
title colour rgb(102, 102, 102) the theme's, oklch(1 0.002 260 / 0.65)

So the default chart bakes its colours into the SVG, and on a dark page it is a white rectangle with Highcharts' own palette and grey labels beside a chart that reads correctly.

Why it matters

On Aura, and in dark mode, this is a white rectangle on a dark page and nothing says why. The default is also wrong for 25.3, where Aura and its colour schemes are the default theme.

Documentation

It is documented only on the Charts styling sub page. "Basic Use", which is what a reader opens to draw their first chart, does not mention it, and neither does the table of style properties that lists the properties it enables. That table also gives Lumo variables as its default values, in a release whose default theme is Aura; the shipped stylesheet actually falls back to the base --vaadin-* properties.

Expected

Styled mode on by default, or a note where the properties are listed saying none of them do anything until it is on.

Getting the project

09-charts-styled-mode.zip, 3 KB, sources only. Unzip it and:

mvn spring-boot:run

Found on 25.3.0-beta1.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions