Legend checkbox styling

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
DaveSav
Newbie
Newbie
Posts: 18
Joined: Wed Jun 15, 2011 12:00 am

Legend checkbox styling

Post by DaveSav » Wed Feb 20, 2013 11:54 pm

Is there a way to style the checkboxes in the Legend?

If I have a black background, you can see the outline of the checkboxes, but not whether they are ticked.
checkboxes.png
checkboxes.png (7.98 KiB) Viewed 8486 times
Thanks,

Dave

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

Re: Legend checkbox styling

Post by Yeray » Fri Feb 22, 2013 4:18 pm

Hi Dave,

The issue is that we draw the checkboxes manually. And we actually draw 4 lines: top and left in Color.GRAY and right and bottom in Color.lightGray. But we don't draw any background so if what you have in the back is black, you won't see the state of the checkbox.
I've modified it so the Legend color will be used to draw a rectangle so you'll have a background. This way, you can still have a transparent legend or not, and you can now have transparent checkboxes (legend color = Color.transparent) or colored (legend.color = yourColor).

This will be available with the next maintenance release.
In the meanwhile you can try to use LegendResolver's getItemCoordinates to manually calculate each checkbox position (something relative to the coordinates argument provided) and draw the colored rectangle inside this method. I think this would do the trick.
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

DaveSav
Newbie
Newbie
Posts: 18
Joined: Wed Jun 15, 2011 12:00 am

Re: Legend checkbox styling

Post by DaveSav » Fri Feb 22, 2013 7:58 pm

No worries.

I'll just try with various shades of grey to white in the legend to get the best look for now.

Any hints to the next release date?

Thanks

Dave

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

Re: Legend checkbox styling

Post by Yeray » Tue Feb 26, 2013 10:51 am

Hi Dave,
DaveSav wrote:Any hints to the next release date?
We are working on it, but I'm afraid I can't tell you a date for it.
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

Post Reply