Incorrect legend color for the Candle series

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Jeff
Newbie
Newbie
Posts: 22
Joined: Thu Nov 30, 2006 12:00 am

Incorrect legend color for the Candle series

Post by Jeff » Tue May 01, 2007 1:39 am

It seems to me that the color of the series points shown in the legend box of a Candle series does not match the color of the candles.

Jeff

Edu
Advanced
Posts: 206
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia

Post by Edu » Wed May 02, 2007 8:14 am

Hi Jeff

Thanks for letting us know, I could reproduce the issue here and this seems to be a bug. I've added it (TF02012194) to our defect list to be fixed for future releases.
Best Regards,
Edu

Steema Support Central
http://support.steema.com/

FP_Oz
Newbie
Newbie
Posts: 22
Joined: Mon Oct 01, 2007 12:00 am

Re: TChart not good at visualising uncertainty

Post by FP_Oz » Wed Apr 06, 2011 11:29 pm

Dear Edu
As you can see, this problem has been around for many years now (this one was posted in 2007 and the problem is still there).
Edu wrote:Hi Jeff

Thanks for letting us know, I could reproduce the issue here and this seems to be a bug. I've added it (TF02012194) to our defect list to be fixed for future releases.
I'm quite hampered by this problem for many years now (seeking shelter in candle series from the ill-designed single box-whisker approach to visualise uncertainties) . Any idea if/when this one could be resolved?

Regards
Francis Pantus

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Incorrect legend color for the Candle series

Post by Sandra » Thu Apr 07, 2011 2:17 pm

Hello Francis,

Using next code and last version of TeeChart.Net it works fine for me, so the bug with number TF02012194 is fixed:

Code: Select all

        public Form1()
        {
            InitializeComponent();
            InitializeChart();
        }
        Steema.TeeChart.Styles.Candle Series1;
        private void InitializeChart()
        {
            Series1 = new Steema.TeeChart.Styles.Candle(tChart1.Chart);
            Series1.FillSampleValues();
            Series1.DownCloseColor = Color.Red;
            Series1.UpCloseColor = Color.Blue;
        }
And achieve next image:
CandleExample.jpg
CandleExample.jpg (97.32 KiB) Viewed 15864 times
Could you tell us which version are you using now?

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

FP_Oz
Newbie
Newbie
Posts: 10
Joined: Tue May 17, 2011 12:00 am

Re: Incorrect legend color for the Candle series

Post by FP_Oz » Tue May 17, 2011 11:41 pm

Hi Sandra,
I installed the latest version this morning (TeeChartNET2010VSNET2008_4.1.2011.04192.exe) and the problem is still as it was when I first reported the problem.
See attached file with image: legend for candle is orange, candle is blue.

The code I'm using:

Code: Select all

            LineSerie = New Steema.TeeChart.Styles.Line
            LineSerie.Title = tracename
            LineSerie.OutLine.Width = 1
            LineSerie.OutLine.Visible = m_ChartSettings.m_Outline
            CurTChrt.Series.Add(LineSerie)

            CndlSerie = New Steema.TeeChart.Styles.Candle
            ' insert line after candle so it show up in front of it
            CndlSerie.Title = tracename + "StDev"
            CndlSerie.UpCloseColor = LineSerie.Color
            CndlSerie.DownCloseColor = LineSerie.Color
            CalcCustumLeftAxes(CurTChrt)
            CurTChrt.Series.Add(CndlSerie)

Cheers
Francis Pantus

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

Re: Incorrect legend color for the Candle series

Post by Yeray » Fri May 20, 2011 9:57 am

Hello Francis,

Let me try to explain:
When the legend shows the values, the symbols in the legend are drawn according to the Open/Close values in each point. So the UpCloseColor/DownCloseColor are used here.
However, when the legend shows the series names, what color has to be shown, UpCloseColor or DownCloseColor? TeeChart doesn't make this decision for you so the color set in Series.Color is taken to draw the series symbol.
Doesn't it sound logic for you? What's the behavior you'd expect?
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

FP_Oz
Newbie
Newbie
Posts: 10
Joined: Tue May 17, 2011 12:00 am

Re: Incorrect legend color for the Candle series

Post by FP_Oz » Tue Jun 14, 2011 12:05 am

Thanks for the lecture, Yeray. I hope you were able to see the picture of the graph with the two series on it and the 'wrong' legend color for the candle series? As fas as I can see I make all colors the same as the color of the line series (see my code) .
Can you please tell me how to change the code so that the legend reflects the same color as the candle series?
Cheers
Francis

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Incorrect legend color for the Candle series

Post by Sandra » Wed Jun 15, 2011 2:10 pm

Hello Francis,

You need change the color to property of Candle Candle.Color too, so not enough just changing the color of UpCloseColor and DownCloseColor. You can do something as next:

Code: Select all

    private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;
            tracename = "LineSeries11";
            LineSeries = new Steema.TeeChart.Styles.Line(tChart1.Chart);
            LineSeries.Title = tracename;
            LineSeries.OutLine.Width = 1;
            LineSeries.FillSampleValues();
            
            CndlSeries = new Steema.TeeChart.Styles.Candle(tChart1.Chart);
            // insert line after candle so it show up in front of it
            CndlSeries.Title = tracename + "StDev";
            CndlSeries.Color= LineSeries.Color;
            CndlSeries.UpCloseColor = LineSeries.Color;
            CndlSeries.DownCloseColor = LineSeries.Color;
            CndlSeries.FillSampleValues();
        }
Please, could you tell us if previous code solve your problem?

I hope will helps.

Thanks,

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

FP_Oz
Newbie
Newbie
Posts: 10
Joined: Tue May 17, 2011 12:00 am

Re: Incorrect legend color for the Candle series

Post by FP_Oz » Tue Jun 28, 2011 7:25 pm

Hi Sandra,
That worked indeed and solved a very nagging problem, with many thanks for your help!!

Cheers
Francis

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Incorrect legend color for the Candle series

Post by Sandra » Wed Jun 29, 2011 7:52 am

Hello FP_Oz,

I am glad that the previous solution works for you. :)

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply