vaadin / vaadin-charts-flow

Vaadin Charts for Flow
Other
7 stars 11 forks source link

Java Theming API & default theme #371

Closed flefebure closed 4 years ago

flefebure commented 4 years ago

Hi,

I try to use the Java Theming API reintroduced in https://github.com/vaadin/vaadin-charts-flow/issues/334

A problem I see is that the jsModule imports by default the default theme

Example if we set color #FFC0CB on a DataPoint , the dom element looks like :

<rect x="461.5" y="281.5" width="68" height="467" fill="#FFC0CB" stroke="#ffffff" stroke-width="1" opacity="1" class="highcharts-point highcharts-color-1" tabindex="-1" role="img" aria-label="2. order-management, 18,732." style="outline: 0px;"></rect>

The highcharts-color-1 class fill property take precedence on the rect fill attribute, so the color is the theme's one

My workaround is actually to set --vaadin-charts-color-* css variable, but I would prefer to avoid the import of the default CSS theme wen styledMode==false.

alvarezguille commented 4 years ago

Hi @flefebure, thanks for reporting this, we will take a look at this. As you mentioned it shouldn't be needed to set the custom css variables when using java styling API. This version is still in alpha stage, we should get this fixed before beta.