Page 1 of 1

Candle(OHLC) to HighLow type series disappeared

Posted: Tue Jun 02, 2015 11:45 am
by 16071129
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.

Re: Candle(OHLC) to HighLow type series disappeared

Posted: Tue Jun 02, 2015 3:51 pm
by Christopher
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);
    }

Re: Candle(OHLC) to HighLow type series disappeared

Posted: Thu Jun 04, 2015 4:52 am
by 16071129
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.

Re: Candle(OHLC) to HighLow type series disappeared

Posted: Thu Jun 04, 2015 11:04 am
by Christopher
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.