I draw two scline
the first is green
the second is blue
I change the color of parts scline green and blue when they exceed a precise value.
I display the legend
I want the first item in the legend green.
I want the second item of the legend is blue
but as scline have 2 colors that does not work, the legend has a default color.
how to customize the color of the legend
[ANSWERED] legend ans scline with diffenret colors
[ANSWERED] legend ans scline with diffenret colors
Last edited by jika on Tue Apr 09, 2013 8:21 am, edited 1 time in total.
Re: legend ans scline with diffenret colors
Hi,
The easiest way is to add two dummy series only for the legend. Then, you'll have 4 series, the two splines and the 2 dummies. And you can hide the splines from the legend, and use the dummies for it:
The easiest way is to add two dummy series only for the legend. Then, you'll have 4 series, the two splines and the 2 dummies. And you can hide the splines from the legend, and use the dummies for it:
Code: Select all
TChart1.Series(0).ShowInLegend = False
TChart1.Series(1).ShowInLegend = False
TChart1.Series(2).Color = vbGreen 'dummy1
TChart1.Series(3).Color = vbBlue 'dummy 2
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: legend ans scline with diffenret colors
yes I had thought of this.
but I also have checkbox on the items of the legend because I gives to the user the ability to hide or display series
but I also have checkbox on the items of the legend because I gives to the user the ability to hide or display series
Re: legend ans scline with diffenret colors
Hi,
You can use the OnMouseDown event to manually activate/deactivate the series you like when a legend item has been clicked.
Similar to this:
http://www.teechart.net/support/viewtop ... 26&p=61118
You can use the OnMouseDown event to manually activate/deactivate the series you like when a legend item has been clicked.
Similar to this:
http://www.teechart.net/support/viewtop ... 26&p=61118
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |