Page 1 of 2

Blank space issue for Candle Sticks Graph

Posted: Wed Feb 18, 2015 12:27 pm
by 16071129
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

Re: Blank space issue for Candle Sticks Graph

Posted: Wed Feb 18, 2015 2:35 pm
by Christopher
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

Re: Blank space issue for Candle Sticks Graph

Posted: Thu Feb 19, 2015 5:14 am
by 16071129
Thank you for your prompt response. I already gone through that example.
But that workaround of labels will not work for me.

Re: Blank space issue for Candle Sticks Graph

Posted: Thu Feb 19, 2015 9:52 am
by Christopher
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?

Re: Blank space issue for Candle Sticks Graph

Posted: Thu Feb 19, 2015 12:25 pm
by 16071129

Code: Select all

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

Re: Blank space issue for Candle Sticks Graph

Posted: Fri Feb 20, 2015 10:44 am
by Christopher
Hello,

In TeeChart AX there is a property called "RemoveGaps":
removegaps.PNG
removegaps.PNG (109.42 KiB) Viewed 25341 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.

Re: Blank space issue for Candle Sticks Graph

Posted: Mon Feb 23, 2015 5:34 am
by 16071129
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.

Re: Blank space issue for Candle Sticks Graph

Posted: Mon Feb 23, 2015 8:37 am
by Christopher
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.

Re: Blank space issue for Candle Sticks Graph

Posted: Mon Apr 20, 2015 12:31 pm
by 16071129
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.

Re: Blank space issue for Candle Sticks Graph

Posted: Tue Apr 21, 2015 8:37 am
by Christopher
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 25229 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;
    }

Re: Blank space issue for Candle Sticks Graph

Posted: Fri Apr 24, 2015 9:44 am
by 16071129

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.

Re: Blank space issue for Candle Sticks Graph

Posted: Fri Apr 24, 2015 11:19 am
by Christopher
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;
    }

Re: Blank space issue for Candle Sticks Graph

Posted: Fri Apr 24, 2015 11:40 am
by 16071129
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

Re: Blank space issue for Candle Sticks Graph

Posted: Thu Jun 25, 2015 12:25 pm
by 16071129
Our problem still continues with series.RemoveGaps property. It shows blank screen when set to "true".

Re: Blank space issue for Candle Sticks Graph

Posted: Fri Jun 26, 2015 7:48 am
by Christopher
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.