Candle(OHLC) to HighLow type series disappeared

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

Candle(OHLC) to HighLow type series disappeared

Post by Quant » Tue Jun 02, 2015 11:45 am

dear steema,
When i tried to convert series type Candle(OHLC) to HighLow type series disappeared from chart. Even when i tried on TeeChart Example demo, the same problem occurs.

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

Re: Candle(OHLC) to HighLow type series disappeared

Post by Christopher » Tue Jun 02, 2015 3:51 pm

Hello,
Quant wrote: When i tried to convert series type Candle(OHLC) to HighLow type series disappeared from chart. Even when i tried on TeeChart Example demo, the same problem occurs.
That's because OHLC series types can only be converted into other series types which are derived from OHLC. As HighLow is not derived from OHLC the conversion fails.

However, you can use something like this:

Code: Select all

    Candle candle = new Candle();

    private void InitializeChart()
    {
      tChart1.Aspect.View3D = false;
      tChart1.Series.Add(candle).FillSampleValues(200);
    }

    private HighLow ConvertCandleToHighLow(Candle c)
    {
      HighLow result = new HighLow();

      for (int i = 0; i < c.Count; i++)
      {
        result.Add(c.DateValues[i], c.HighValues[i], c.LowValues[i]);
      }

      return result;
    }
 
    private void button4_Click_1(object sender, EventArgs e)
    {
      HighLow h = ConvertCandleToHighLow(candle);
      tChart1.Series.Remove(candle);
      tChart1.Series.Add(h);
    }
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: Candle(OHLC) to HighLow type series disappeared

Post by Quant » Thu Jun 04, 2015 4:52 am

Dear Steema,
Sorry to say that, but we cant use this resolution in our application as series in our graph can contain millons of records. also we gave feature to our application user to change series type as per his requirement at runtime.
So we requre this feature to work with Series.ChangeType() like other types are working.

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

Re: Candle(OHLC) to HighLow type series disappeared

Post by Christopher » Thu Jun 04, 2015 11:04 am

Quant wrote:So we requre this feature to work with Series.ChangeType() like other types are working.
This ticket id=1222 has now been fixed.
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