Page 1 of 1

Candles not drawing correctly.

Posted: Wed Apr 30, 2008 7:24 pm
by 13048566
I'm using the CandleStick series type, and I set the UpCloseColor to Transparent, which is how many financial charts display Candles.

I set the DownCloseColor, the HighLowPen color, the Outline color, and the Pointer.Pen.Color to the color of the series which usually gives me the effect I'm looking for.

The problem is that when zoomed out so that the Open and Close are very close together, all that shows up is the vertical line for the high/low. It is not drawing the outline around the body of the candle.

Is there a way around this?

Thanks!

Posted: Mon May 05, 2008 7:17 am
by narcis
Hi TMac,

I'm not able to reproduce the issue here using code below and latest TeeChart for .NET v3 maintenance release. Could you please modify the code or send us a simple example project we can run "as-is" to reproduce the problem here and let us know the TeeChart version you are using?

Code: Select all

		public Form1()
		{
			InitializeComponent();
			InitializeChart();			
		}
		
		private void InitializeChart()
		{
			tChart1.Aspect.View3D = false;

			Steema.TeeChart.Styles.Candle candle1 = new Steema.TeeChart.Styles.Candle(tChart1.Chart);

			candle1.Style = Steema.TeeChart.Styles.CandleStyles.CandleStick;
			candle1.UpCloseColor = Color.Transparent;
			candle1.DownCloseColor = candle1.Color;
			candle1.HighLowPen.Color = candle1.Color;
			candle1.OutLine.Color = candle1.Color;
			candle1.Pen.Color = candle1.Color;

			candle1.FillSampleValues();
		}
You can post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.

Posted: Mon May 05, 2008 11:49 am
by 13048566
Try the following code. If you maximize the window, you'll see that every other bar shows up as just a vertical line with no horizontal line at all. Using the Magnifier in Vista, you can see that there is clearly no horizontal line.

Code: Select all

        TChart1.Aspect.View3D = False

        Dim candle1 As Steema.TeeChart.Styles.Candle = New Steema.TeeChart.Styles.Candle(TChart1.Chart)

        candle1.Style = Steema.TeeChart.Styles.CandleStyles.CandleStick
        candle1.UpCloseColor = Color.Transparent
        candle1.DownCloseColor = candle1.Color
        candle1.HighLowPen.Color = candle1.Color
        candle1.OutLine.Color = candle1.Color
        candle1.Pen.Color = candle1.Color

        For i As Integer = 0 To 100
            If i Mod 2 = 0 Then
                candle1.Add(i, 500, 2000, 450, 1500)
            Else
                candle1.Add(i, 1124, 1130, 1120, 1125)
            End If
        Next

Posted: Mon May 05, 2008 1:30 pm
by narcis
Hi TMac,

Thanks for the information. I could reproduce what you reported but I don't think it is a bug. I think it's just that every second candle range is two narrow compared to higher candle scale. If you zoom in the chart you'll see candle bars being drawn.

Posted: Mon May 05, 2008 1:40 pm
by 13048566
I agree that the reason it is not showing is because the area is so narrow, but if you change the UpCloseColor to Black it will show up.

I've seen this happen in my real app at times when the scale is not as big as I made it in this example. For example, if you make the high really high and the low really low, but the open and the close almost the same, then it won't draw the horizontal line. This means the user has no idea where the bar opened and closed at.

Is there a way to force it to draw the border around the open and close line even though it is tight. That seems to be the step that is being skipped, otherwise I would be able to see it, right?

Thanks,
T-Mac

Posted: Mon May 05, 2008 2:11 pm
by narcis
Hi T-Mac,

I've added your request to our wish-list to be reviewed and enhanced for next releases. There's no workaround I can think of at the moment.