Can I paint graph with gaps for TCandleSeries?
Can I paint graph with gaps for TCandleSeries?
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.
- Attachments
-
- candle_test.zip
- (3.3 KiB) Downloaded 218 times
Re: Can I paint graph with gaps for TCandleSeries?
Hi actforex,
No, I'm afraid TCandleseries' csLine mode doesn't allow null points. But you could transform your TCandleseries to be a TLineSeries. Here it is an example from the beginning:
No, I'm afraid TCandleseries' csLine mode doesn't allow null points. But you could transform your TCandleseries to be a TLineSeries. Here it is an example from the beginning:
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;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Can I paint graph with gaps for TCandleSeries?
Thank you, but this is not exactly what's needed. If possible, please include this task in the development plan. This is a minor fix, but it would be very helpful for us.
So far I have managed to solve the problem by actually adding two lines into TCandleSeries.DrawValue:
begin
if IsNull(ValueIndex) then //TF02013524
begin
OldP.X := MaxInt; // (!)
Exit;
end;
...
if FCandleStyle=csLine then // Line
begin
...
if (ValueIndex<>tmpFirst) and (OldP.X <> MaxInt) then // (!)
...
So far I have managed to solve the problem by actually adding two lines into TCandleSeries.DrawValue:
begin
if IsNull(ValueIndex) then //TF02013524
begin
OldP.X := MaxInt; // (!)
Exit;
end;
...
if FCandleStyle=csLine then // Line
begin
...
if (ValueIndex<>tmpFirst) and (OldP.X <> MaxInt) then // (!)
...
Re: Can I paint graph with gaps for TCandleSeries?
Hi actforex,
Thank you for the suggestion. I've added it to the wish list to be studied for inclusion asap (TV52014649).
Thank you for the suggestion. I've added it to the wish list to be studied for inclusion asap (TV52014649).
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Can I paint graph with gaps for TCandleSeries?
Hi actforex,
Just wanted to let you know that I fixed TV52014649 for the next maintenance release.
You can implemented the fix in DrawValue method pending candles with CandleStyle=csLine like this:
Just wanted to let you know that I fixed TV52014649 for the next maintenance release.
You can implemented the fix in DrawValue method pending candles with CandleStyle=csLine like this:
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
Best Regards,
Narcís Calvet / 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 |