Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 722

Summary: no candle body
Product: VCL TeeChart Reporter: SHIN Nara <shinnara>
Component: SeriesAssignee: Steema Issue Manager <issuemanager>
Status: RESOLVED FIXED    
Severity: major CC: narcis
Priority: High    
Version: 140220   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Chart Series: --- Delphi / C++ Builder RAD IDE Version:
Attachments: candle sample

Description SHIN Nara 2014-04-14 05:54:06 EDT
Series.AddCandle(0, 0, 2, -1 ,1) should make a candle body but should not.
Comment 1 SHIN Nara 2014-04-14 05:55:07 EDT
Created attachment 172 [details]
candle sample
Comment 2 narcís calvet 2014-04-14 11:01:10 EDT
TeeChart .NET does it correctly.
Comment 3 narcís calvet 2015-03-11 10:49:08 EDT
Source code users can fix it implementing TCandleSeries.CalcItem method like this:

procedure TCandleSeries.CalcItem(ValueIndex:Integer; out AItem:TCandleItem);
begin
  with AItem do
  begin
    tmpX:=CalcXPos(ValueIndex);

    { Vertical positions of Open, High, Low & Close values for this point }
    YOpen :=CalcYPosValue(OpenValues.Value[ValueIndex]);
    YHigh :=CalcYPosValue(HighValues.Value[ValueIndex]);
    YLow  :=CalcYPosValue(LowValues.Value[ValueIndex]);
    YClose:=CalcYPosValue(CloseValues.Value[ValueIndex]);

    Left:=CandleWidth div 2; { calc half Candle Width }
    Right:=CandleWidth-Left;
  end;
end;