Search code examples
javaandroidteechart

How to set TChart transparency?


I want my TChart series to be filled with semi-transparent gradients. The following works for pies, but not bars and areas:

// Works:
pie.setTransparency(30);

// Does not work:
area.setTransparency(30);
area.getGradient().setTransparency(30);

// Not present: bar.setTransparency(30);
// Does not work:
bar.getGradient().setTransparency(30);

What am I missing here? How do I make my bar and area series semi-transparent?


Solution

  • The Area and Bar transparencies work fine for me here through the Brush:

    area.getBrush().setTransparency(30);
    
    bar.getBrush().setTransparency(30);
    

    What doesn't seem to work fine for me here either is the transparency with the gradient, so I've added it to the wish list to be revised for future releases (TJ71016474).