Can I paint graph with gaps for TCandleSeries?
Posted: Tue Jan 19, 2010 8:56 am
Hello. Can I paint graph with gaps for TCandleSeries in CandleStyle := csLine mode? AddNull method doesn't work. Example is attached in candle_test.zip.
Steema Software - Customer Support Forums
http://216.92.101.67/support/
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var Series_Candle: TCandleSeries;
CandleCopy: TChartSeries;
begin
Chart1.View3D:=false;
Series_Candle:=Chart1.AddSeries(TCandleSeries.Create(self)) as TCandleSeries;
Series_Candle.AddCandle(1, 5, 15, 4, 10);
Series_Candle.AddCandle(2, 8, 10, 1, 6);
Series_Candle.AddNull(3);
Series_Candle.AddCandle(4, 8, 14, 5, 10);
Series_Candle.AddCandle(5, 6, 10, 6, 7);
CandleCopy:=CloneChartSeries(Series_Candle);
ChangeSeriesType(CandleCopy,TLineSeries);
Series_Candle.Active:=false;
end;
Code: Select all
if FCandleStyle=csLine then // Line
begin
P:=TeePoint(tmpX,YClose);
tmpFirst:=FirstDisplayedIndex;
if (ValueIndex<>tmpFirst) and (not IsNull(ValueIndex)) then
begin
if not IsNull(ValueIndex-1) then
begin
AssignVisiblePenColor(Self.Pen,tmpColor);
BackMode:=cbmTransparent;
if View3D then LineWithZ(OldP,P,MiddleZ)
else Line(OldP,P);
end;
OldP:=P;
end
else if ValueIndex=tmpFirst then OldP:=P;
end