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

Blank space issue for Candle Sticks Graph

Post by Quant » Wed Feb 18, 2015 12:27 pm

while drawing Candle Stick Graph in Teechart.Net. When datavalue is not present for particular date it shows blank space (e.g.for Saturday, Sunday and Holiday.). previously when we were using Ocx version the candlestick graph was continuous without any blank space
Kindly see the attached file
Attachments
blankSpace.JPG
blankSpace.JPG (22.79 KiB) Viewed 22550 times

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Blank space issue for Candle Sticks Graph

Post by Christopher » Wed Feb 18, 2015 2:35 pm

Quant wrote:while drawing Candle Stick Graph in Teechart.Net. When datavalue is not present for particular date it shows blank space (e.g.for Saturday, Sunday and Holiday.). previously when we were using Ocx version the candlestick graph was continuous without any blank space
Kindly see the attached file
There is an example in the Feature Demo under:
%Program Files%\Steema Software\Steema TeeChart for .NET 201X 4.1.201X.XXXXX\Examples\DemoProject\bin\ExecutableDemo\TeeChartNetExamples.exe

Go to the "All Features tab" and then
Welcome !\Chart styles\Financial\Candle (OHLC)\Axis Labels no Weekends
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Quant
Advanced
Posts: 142
Joined: Tue Dec 30, 2014 12:00 am

Re: Blank space issue for Candle Sticks Graph

Post by Quant » Thu Feb 19, 2015 5:14 am

Thank you for your prompt response. I already gone through that example.
But that workaround of labels will not work for me.

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Blank space issue for Candle Sticks Graph

Post by Christopher » Thu Feb 19, 2015 9:52 am

Quant wrote:Thank you for your prompt response. I already gone through that example.
But that workaround of labels will not work for me.
Can you please send us the code that worked correctly for you in the OCX version?
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Quant
Advanced
Posts: 142
Joined: Tue Dec 30, 2014 12:00 am

Re: Blank space issue for Candle Sticks Graph

Post by Quant » Thu Feb 19, 2015 12:25 pm

Code: Select all

TChartMain.Series(0).asCandle.AddCandle(dtTemp.ToOADate(), OpenValue, HighValue, LowValue, CloseValue, dtTemp.Date.ToString(), (uint)TeeChart.EConstants.clTeeColor);
             

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Blank space issue for Candle Sticks Graph

Post by Christopher » Fri Feb 20, 2015 10:44 am

Hello,

In TeeChart AX there is a property called "RemoveGaps":
removegaps.PNG
removegaps.PNG (109.42 KiB) Viewed 22492 times
This property is not present in TeeChart .NET, so I have added this property as a feature request with id=1147. In the meantime, the only option is to use the technique I have described, I'm afraid.
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Quant
Advanced
Posts: 142
Joined: Tue Dec 30, 2014 12:00 am

Re: Blank space issue for Candle Sticks Graph

Post by Quant » Mon Feb 23, 2015 5:34 am

Hi Christopher,

We need the same property on urgent basis, since we can not use given workaround for our project. Using integer value in date field makes us compromise most of the user requirements. It also changes our most of the source code which is based on the ActiveX Version of TeeChart.

Please let us know when we can get this functionality.

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Blank space issue for Candle Sticks Graph

Post by Christopher » Mon Feb 23, 2015 8:37 am

Quant wrote:Please let us know when we can get this functionality.
This property will be considered for inclusion into the next maintenance release, due out at the middle of next month.
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Quant
Advanced
Posts: 142
Joined: Tue Dec 30, 2014 12:00 am

Re: Blank space issue for Candle Sticks Graph

Post by Quant » Mon Apr 20, 2015 12:31 pm

This property will be considered for inclusion into the next maintenance release, due out at the middle of next month.
We have downloaded the latest release of .Net TeeChart, but we haven't found the resolution for this Blank Space Issue.
Please let us know where we can find the same.

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Blank space issue for Candle Sticks Graph

Post by Christopher » Tue Apr 21, 2015 8:37 am

Quant wrote:
We have downloaded the latest release of .Net TeeChart, but we haven't found the resolution for this Blank Space Issue.
Please let us know where we can find the same.
In the latest release notes we have:
1147.PNG
1147.PNG (4.51 KiB) Viewed 22380 times
This property can be used like this:

Code: Select all

    Candle series1;

    private void InitializeChart()
    {
      tChart1.Aspect.View3D = false;
      tChart1.Legend.Visible = false;
      series1 = new Candle(tChart1.Chart);

      Random r = new Random();
      double tmpOpen;
      double tmpClose;
      int count = 0;
      DateTime dt = DateTime.Today; 
      TimeSpan ts = TimeSpan.FromDays(1);
      for (int t = 0; t < 13; t++)
      {
        tmpOpen = r.Next(100);
        tmpClose = tmpOpen - r.Next(100);
        if (dt.DayOfWeek != DayOfWeek.Saturday & dt.DayOfWeek !=
          DayOfWeek.Sunday)
        {
          ++count;
          series1.Add(dt, tmpOpen, tmpOpen + r.Next(50),
            tmpClose - r.Next(50), tmpClose);
        }
        dt += ts;
      }
    }

    private void checkBox1_CheckedChanged(object sender, EventArgs e)
    {
      series1.RemoveGaps = checkBox1.Checked;
    }
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Quant
Advanced
Posts: 142
Joined: Tue Dec 30, 2014 12:00 am

Re: Blank space issue for Candle Sticks Graph

Post by Quant » Fri Apr 24, 2015 9:44 am

Code: Select all

                    Candle newSeries = new Candle();
                    newSeries.VertAxis = VerticalAxis.Right;
                    newSeries.UpCloseColor = Color.White;
                    newSeries.DownCloseColor = Color.Black;
                    newSeries.CandleWidth = 2;
                    newSeries.TreatNulls = TreatNullsStyle.Skip;
                    newSeries.Marks.Style = MarksStyles.Value;
                    newSeries.Marks.MultiLine = true;
                    newSeries.Title = "Title1";

                    for (int i = 0; i < chartObj.totalSampleValues; i++)
                    {
                        date = (DateTime)dataTable.Rows[i][0];
                        open = dataTable.Rows[i][1];
                        close = dataTable.Rows[i][2];
                        high = dataTable.Rows[i][3];
                        low = dataTable.Rows[i][4];

                        labels.Add(date.ToShortDateString());
                        closeValues.Add(close.ToString());
                        //newSeries.Add(i, open, high, low, close);
                        newSeries.Add(date, open, high, low, close);
                    }
                    //newSeries.Labels = labels; 
                    newSeries.RemoveGaps = true;
                    this.tChart1.Series.Add(newSeries);
                    newSeries = (Candle)tChart1.Series[0];
                   
We are using above code for removing blank space issues in our main project; but is shows us blank screen.
Error comes at "newSeries.RemoveGaps = true;" this line.

Note: While in sample project this feature works as expected.

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Blank space issue for Candle Sticks Graph

Post by Christopher » Fri Apr 24, 2015 11:19 am

Hello,

Without access to your data, I'm afraid I cannot reproduce your issue. Can you please modify the code snippet below so I can reproduce your issue here?

Code: Select all

    Candle newSeries;
    private void InitializeChart()
    {
      newSeries = new Candle();
      newSeries.VertAxis = VerticalAxis.Right;
      newSeries.UpCloseColor = Color.White;
      newSeries.DownCloseColor = Color.Black;
      newSeries.CandleWidth = 2;
      newSeries.TreatNulls = TreatNullsStyle.Skip;
      newSeries.Marks.Style = MarksStyles.Value;
      newSeries.Marks.MultiLine = true;
      newSeries.Title = "Title1";

      DateTime date = DateTime.Today;
      double open, close, high, low;
      Random rnd = new Random();

      for (int i = 0; i < 20; i++)
      {
        date = date.AddDays(1);
        open = rnd.NextDouble();
        high = open + rnd.NextDouble();
        close = high - rnd.NextDouble();
        low = close - rnd.NextDouble();

        //labels.Add(date.ToShortDateString());
        //closeValues.Add(close.ToString());
        //newSeries.Add(i, open, high, low, close);

        if (date.DayOfWeek != DayOfWeek.Saturday & date.DayOfWeek !=
          DayOfWeek.Sunday)
        {
          newSeries.Add(date, open, high, low, close);
        }

      }
      //newSeries.Labels = labels; 
      newSeries.RemoveGaps = true;
      this.tChart1.Series.Add(newSeries);
      newSeries = (Candle)tChart1.Series[0];
      tChart1.Axes.Bottom.Labels.Angle = 90;

    }


    private void checkBox1_CheckedChanged(object sender, EventArgs e)
    {
      newSeries.RemoveGaps = !newSeries.RemoveGaps;
    }
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Quant
Advanced
Posts: 142
Joined: Tue Dec 30, 2014 12:00 am

Re: Blank space issue for Candle Sticks Graph

Post by Quant » Fri Apr 24, 2015 11:40 am

Without access to your data, I'm afraid I cannot reproduce your issue. Can you please modify the code snippet below so I can reproduce your issue here?
We are using a DataTable with Following Fields
1] Date
2] Open
3] Close
4] High
5] Low

Quant
Advanced
Posts: 142
Joined: Tue Dec 30, 2014 12:00 am

Re: Blank space issue for Candle Sticks Graph

Post by Quant » Thu Jun 25, 2015 12:25 pm

Our problem still continues with series.RemoveGaps property. It shows blank screen when set to "true".

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Blank space issue for Candle Sticks Graph

Post by Christopher » Fri Jun 26, 2015 7:48 am

Quant wrote:Our problem still continues with series.RemoveGaps property. It shows blank screen when set to "true".
As per the instructions for posting in this forum, which you can read here, can you please provide a Short, Self Contained, Correct (Compilable), Example (explanation here) with which we can reproduce your problem.

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

Post Reply