Hi, I read some topics about setting the colors of a legend widget. However, I think that those topics are related to a fixed color for a specific item.
For example, parameter pDemand(iscen), I use an color per scenario to show different colors in a line chart via an annotation spAnnotion(iscen).
Now I want to show the same colors in the legend widget, So I made a parameter pLegend(iscen) with the same annotation spAnnotation(iscen). I would expect that the legend is using the same colors as the line chart.
But the colors of the legend are not changing?
Best answer by Gertjan
There is a way with custom CSS using properties of the items that are generated in the legend. Formally not supported, but easily achievable.
Below an example where I used the annotation-sc1 that was added to line, bar and legend items in the charts to change the colors. Here I skipped the WebUI::AnnotationIdentifier part as well, as in my case I just refer to the scenario name that is already propagated (btw, this does not work for all pivots of the bar chart, but if that is important, you can of course extend with a custom WebUI::AnnotationIdentifier and align colors with the legend.
Also attached an example.