Problem with Gradient and Marks lines in VolumePipe

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
MVBobj
Newbie
Newbie
Posts: 34
Joined: Fri Jul 17, 2015 12:00 am
Contact:

Problem with Gradient and Marks lines in VolumePipe

Post by MVBobj » Tue Apr 12, 2016 4:20 pm

Hi,

How do I set (or turn off) the gradient in the VolumePipe?
TeeChart1.jpg
TeeChart1.jpg (124.98 KiB) Viewed 5760 times
It makes no difference whether Gradient is checked or unchecked or set to Left Right or Top Bottom - the chart looks the same.

Also - how do I set the Maks Arrows for the VolumePipe? Because of the Series Cone Percent, the Mark can be some distance from its segment.
TeeChart2.jpg
TeeChart2.jpg (133.89 KiB) Viewed 5760 times
I'm not having much luck getting the Mark's Arrows to show up - above are the placement of the visible Pointers.

Thanks.
.

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Problem with Gradient and Marks lines in VolumePipe

Post by Yeray » Wed Apr 13, 2016 12:15 pm

Hello,
MVBobj wrote:How do I set (or turn off) the gradient in the VolumePipe?

It makes no difference whether Gradient is checked or unchecked or set to Left Right or Top Bottom - the chart looks the same.
I guess the gradient you are trying to disable is the 3D effect. If you set the chart to 2D then you won't see it.
MVBobj wrote:Also - how do I set the Maks Arrows for the VolumePipe? Because of the Series Cone Percent, the Mark can be some distance from its segment.

I'm not having much luck getting the Mark's Arrows to show up - above are the placement of the visible Pointers.
You can create a customized TVolumePipeSeries overriding the DrawMark method to change ChartRect.Top property before drawing each mark (and restore after the drawing). Ie:

Code: Select all

type
  TMyVolumePipeSeries = class(TVolumePipeSeries)
    protected
      procedure DrawMark(ValueIndex: Integer; const St: String; APosition: TSeriesMarkPosition); override;
  end;

  TVolumePipeSeriesAccess = class(TVolumePipeSeries)
  end;
//...
procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.View3D:=false;

  with Chart1.AddSeries(TMyVolumePipeSeries) as TMyVolumePipeSeries do
  begin
    FillSampleValues();
    Brush.Gradient.Visible:=false;

    Marks.Visible:=true;
  end;
end;

procedure TMyVolumePipeSeries.DrawMark(ValueIndex: Integer; const St: String;
  APosition: TSeriesMarkPosition);
var oldTop, xVal, yDisp, IDiff, overallWidth: Integer;
    BoundingPoints: TFourPoints;
    tmp: TCoordinate;
    tmpCone : Single;
begin
  oldTop:=ParentChart.ChartRect.Top;

  With ParentChart.ChartRect do
  Begin
    BoundingPoints[0]:= TeePoint(Left+2,Top+2);  //topleft

    tmpCone:=(ConePercent div 2)*0.01;
    tmp:={$IFNDEF FMX}Round{$ENDIF}(Top+(Bottom-Top) * tmpCone);

    BoundingPoints[1]:= TeePoint(Right-2, tmp); //topright

    tmp:={$IFNDEF FMX}Round{$ENDIF}(Bottom-((Bottom-Top) * tmpCone));

    BoundingPoints[2]:= TeePoint(Right-2, tmp); //bottomright
    BoundingPoints[3]:= TeePoint(Left+2,Bottom-2); //bottomleft
  end;

  IDiff:=BoundingPoints[1].Y-BoundingPoints[0].Y;
  overallWidth:=BoundingPoints[1].X-BoundingPoints[0].X;
  xVal:=TVolumePipeSeriesAccess(Self).CalcSegment(ValueIndex,YValues[ValueIndex])+BoundingPoints[0].X; //add left displacement
  yDisp:=Round((((xVal-BoundingPoints[0].X)/overallWidth)*IDiff));

  ParentChart.ChartRect.Top:=BoundingPoints[0].Y+yDisp;

  inherited;

  ParentChart.ChartRect.Top:=oldTop
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply