Candles not drawing correctly.

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
TMac
Newbie
Newbie
Posts: 21
Joined: Mon Mar 10, 2008 12:00 am

Candles not drawing correctly.

Post by TMac » Wed Apr 30, 2008 7:24 pm

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!

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon May 05, 2008 7:17 am

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.
Best Regards,
Narcís Calvet / 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

TMac
Newbie
Newbie
Posts: 21
Joined: Mon Mar 10, 2008 12:00 am

Post by TMac » Mon May 05, 2008 11:49 am

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon May 05, 2008 1:30 pm

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.
Best Regards,
Narcís Calvet / 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

TMac
Newbie
Newbie
Posts: 21
Joined: Mon Mar 10, 2008 12:00 am

Post by TMac » Mon May 05, 2008 1:40 pm

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon May 05, 2008 2:11 pm

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.
Best Regards,
Narcís Calvet / 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