Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Vaadin Charts. How to change column label text color?

sayat sayat
6 years ago Jul 16, 2015 9:54am
Iain Brown
6 years ago Jul 16, 2015 9:08pm
sayat sayat
6 years ago Jul 17, 2015 3:33am
sayat sayat
6 years ago Jul 17, 2015 10:42am
sayat sayat
6 years ago Jul 17, 2015 11:40am
Guillermo Alvarez
6 years ago Jul 24, 2015 5:17pm

Hi,

I took a look at the issue, and found out that what happens is that when drilldown is enabled there's an specific style for points (columns in this case) where drilldown is enabled.

To get same style in points with drilldown enabled and points without drilldown enabled you should set the color in two different places:

Configuration conf = chart.getConfiguration();
        ...
        PlotOptionsColumn plotOptionsColumn = new PlotOptionsColumn();
        Labels labels = new Labels(true);
        plotOptionsColumn.setDataLabels(labels);

        Style labelsStyle = new Style();
        labelsStyle.setColor(SolidColor.RED);

        //set style for points without drilldown
        labels.setStyle(labelsStyle);
        ...
        //set style for points with drilldown
        conf.getDrilldown().setActiveDataLabelStyle(labelsStyle);

 

sayat sayat
6 years ago Jul 25, 2015 6:00am