Legend for HorizBars/Line - Problem with Transparence

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
Oliver
Newbie
Newbie
Posts: 6
Joined: Fri Dec 14, 2018 12:00 am

Legend for HorizBars/Line - Problem with Transparence

Post by Oliver » Thu Jan 10, 2019 1:11 pm

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
Attachments
Legend - 1988.png
Legend - 1988.png (52.83 KiB) Viewed 1148 times
Legend transparent - 1988.png
Legend transparent - 1988.png (52.98 KiB) Viewed 1148 times

Yeray
Site Admin
Site Admin
Posts: 8705
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Legend for HorizBars/Line - Problem with Transparence

Post by Yeray » Wed Jan 16, 2019 1:37 pm

Hello,

I could reproduce it so I've added it to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=2141
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Yeray
Site Admin
Site Admin
Posts: 8705
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Legend for HorizBars/Line - Problem with Transparence

Post by Yeray » Thu Jan 17, 2019 9:11 am

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);
	}
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Oliver
Newbie
Newbie
Posts: 6
Joined: Fri Dec 14, 2018 12:00 am

Re: Legend for HorizBars/Line - Problem with Transparence

Post by Oliver » Sat Jan 19, 2019 6:15 pm

Hello Yeray,

thank you for your answer. This fixed my problem.

regards, Oliver

Post Reply