Blank space issue for Candle Sticks Graph

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Quant
Advanced
Posts: 142
Joined: Tue Dec 30, 2014 12:00 am

Re: Blank space issue for Candle Sticks Graph

Post by Quant » Sat Jun 27, 2015 7:25 am

We are facing very strage issue, while in our main project "RemoveGaps=True" shows blank screen, it works perfectly on a sample project.

Following is the sample code we used for OHLC with RemoveGaps:

Code: Select all

DataTable CashVolume;
CashVolume = Graph.GetCashVolume() //DB Proc to Get OHLC Data

DateTime date;
double open = 0, close = 0, high = 0, low = 0, vol = 0;

Candle newSeries = new Candle();
newSeries.VertAxis = VerticalAxis.Right;
newSeries.UpCloseColor = Theme.TeeChartSeriesUpColor; 
newSeries.DownCloseColor = Theme.TeeChartSeriesDownColor;
            
newSeries.TreatNulls = TreatNullsStyle.Skip;
newSeries.Marks.Style = MarksStyles.Value;
newSeries.Marks.MultiLine = true;
this.tChart1.Series.Add(newSeries);

for (int i = 0; i < CashVolume.Rows.Count; i++)
{
	date = (DateTime)CashVolume.Rows[i][(int)Graph.CashVolumeCol.TimeStamp];
	open = (double)(CashVolume.Rows[i][(int)Graph.CashVolumeCol.OpenPrice]);
	close = (double)(CashVolume.Rows[i][(int)Graph.CashVolumeCol.ClosePrice]);
	high = (double)(CashVolume.Rows[i][(int)Graph.CashVolumeCol.HighPrice]);
	low = (double)(CashVolume.Rows[i][(int)Graph.CashVolumeCol.LowPrice]);


	newSeries.Add(date, open, high, low, close);
}
newSeries.RemoveGaps = true;
Also we found that RemoveGaps property is only available for some of the chart types like Candle. But it is not available for Bar chart or Volume chart. For example following code example gives us chart having gaps for weekend, which is an error.

Code: Select all

DataTable CashVolume;
CashVolume = Graph.GetCashVolume() //DB Proc to Get OHLC Data

DateTime date;
double open = 0, close = 0, high = 0, low = 0, vol = 0;

Bar newBarSeries = new Bar();
newBarSeries.VertAxis = VerticalAxis.Right;
this.tChart1.Series.Add(newBarSeries);

for (int i = 0; i < CashVolume.Rows.Count; i++)
{
	date = (DateTime)CashVolume.Rows[i][(int)Graph.CashVolumeCol.TimeStamp];
	vol = (int)(CashVolume.Rows[i][(int)Graph.CashVolumeCol.Volume]);
	newBarSeries.Add(date, vol);
}
Bar Chart.png
Bar Chart Having Space for Weekend
Bar Chart.png (12.66 KiB) Viewed 5271 times
It should be available for all available financial charts.

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

Re: Blank space issue for Candle Sticks Graph

Post by Narcís » Mon Jun 29, 2015 9:11 am

Hello Quant,
Quant wrote: We are facing very strage issue, while in our main project "RemoveGaps=True" shows blank screen, it works perfectly on a sample project.
You should try to find what is different between the two projects and has an influence on the subject. Once you get to that point please send us a simple example project we can run "as-is" to reproduce the problem here.
Quant wrote: Also we found that RemoveGaps property is only available for some of the chart types like Candle. But it is not available for Bar chart or Volume chart. For example following code example gives us chart having gaps for weekend, which is an error.

It should be available for all available financial charts.
RemoveGaps was implemented for those series will mostly display DateTime values. Which series types you'd expect implementing RemoveGaps? Please bear in mind that not every TeeChart uses such series styles for financial purposes but for others: scientific, statistical, etc. Also, you can remove weekends as shown in the All Features\Welcome !\Chart styles\Financial\Candle (OHLC)\Axis Labels no Weekends example at the features demo included with TeeChart.
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