Page 1 of 1

Legend for HorizBars/Line - Problem with Transparence

Posted: Thu Jan 10, 2019 1:11 pm
by 17485129
Hello,

I'm using TeeChart in a Java Desktop-Applikation. There are HorizBars and a Line in the chart. The series were displayed korrect in the legend (first attachement). When I set the legend transparent, the frame of the HorizBar-Series get the Color of the Line-Series (second attachement).

Do you have any suggestions how to to solve this problem?

Tanks in advance.

Kind Regards
Oliver

Re: Legend for HorizBars/Line - Problem with Transparence

Posted: Wed Jan 16, 2019 1:37 pm
by yeray
Hello,

I could reproduce it so I've added it to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=2141

Re: Legend for HorizBars/Line - Problem with Transparence

Posted: Thu Jan 17, 2019 9:11 am
by yeray
Hello,

I've just fixed the issue.
Since you own the sources, you can apply the fix to your sources. At CustomBar.java, change the drawLegendShape method for this one:

Code: Select all

	protected void drawLegendShape(IGraphics3D g, int valueIndex, Rectangle rect) {
		ChartPen oldPen = g.getPen();
		
		if (getBrush().getImage() != null)
			g.getBrush().setImage(bBrush.getImage());
		if (getPen().getVisible())
			g.setPen(getPen());
		
		super.drawLegendShape(g, valueIndex, rect);
		
		if (getPen().getVisible())
			g.setPen(oldPen);
	}

Re: Legend for HorizBars/Line - Problem with Transparence

Posted: Sat Jan 19, 2019 6:15 pm
by 17485129
Hello Yeray,

thank you for your answer. This fixed my problem.

regards, Oliver