Modification in Gradient ?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
cborgeat
Newbie
Newbie
Posts: 8
Joined: Fri Apr 08, 2016 12:00 am

Modification in Gradient ?

Post by cborgeat » Mon Jun 06, 2016 3:27 pm

Hello, I have a problem i cant understand and solve. In one previous version we use Gradient of the shape in a TmapSeries (Teechart2013 with delphi XE)

But now the code not work anymore (TeeChart 2015 and delphi 10 Seattle).

You can see exaclly wath i mean in the attached picture.

Here is the code :

Code: Select all

  Fserie := TMapSeries(Fchart.Series[0]) ;
  Fserie.Shapes.Clear ;
  Fserie.Shapes.Add ;
  Fserie.Shapes.Polygon[0].Gradient.Visible := True ;
  Fserie.Shapes.Polygon[0].Gradient.StartColor := clBlue ;
  Fserie.Shapes.Polygon[0].Gradient.EndColor := clRed ;

    FChart.BottomAxis.Maximum := 60 ;
      FChart.LeftAxis.Maximum := 40 ;

      //Premier plat et premère rampe
      Fserie.Shapes[0].AddXY(24, 18.5) ;
      Fserie.Shapes[0].AddXY(22, 18.5) ;
      Fserie.Shapes[0].AddXY(15.2, 11.5) ;
      Fserie.Shapes[0].AddXY(1, 11.5) ;
      Fserie.Shapes[0].AddXY(1, 10.5) ;
      Fserie.Shapes[0].AddXY(16, 10.5) ;
      Fserie.Shapes[0].AddXY(24, 18.5) ;

      //Jointure
      Fserie.Shapes[0].AddXY(23, 18.5) ;
      Fserie.Shapes[0].AddXY(24.2, 19.5) ;

      //Premier step dans le plat
      Fserie.Shapes[0].AddXY(26, 19.5) ;
      Fserie.Shapes[0].AddXY(26, 20.25) ;
      Fserie.Shapes[0].AddXY(28, 20.25) ;
      Fserie.Shapes[0].AddXY(28, 18.75) ;
      Fserie.Shapes[0].AddXY(26, 18.75) ;
      Fserie.Shapes[0].AddXY(26, 19.5) ;
      Fserie.Shapes[0].AddXY(26, 18.75) ;
      Fserie.Shapes[0].AddXY(28, 18.75) ;
      Fserie.Shapes[0].AddXY(28, 19.5) ;

      //Deuxième step dans le plat
      Fserie.Shapes[0].AddXY(30, 19.5) ;
      Fserie.Shapes[0].AddXY(30, 20.25) ;
      Fserie.Shapes[0].AddXY(32, 20.25) ;
      Fserie.Shapes[0].AddXY(32, 18.75) ;
      Fserie.Shapes[0].AddXY(30, 18.75) ;
      Fserie.Shapes[0].AddXY(30, 19.5) ;
      Fserie.Shapes[0].AddXY(30, 18.75) ;
      Fserie.Shapes[0].AddXY(32, 18.75) ;
      Fserie.Shapes[0].AddXY(32, 19.5) ;

      //Jointure
      Fserie.Shapes[0].AddXY(34, 19.5) ;
      Fserie.Shapes[0].AddXY(35, 20.6) ;

      //Premier step dans la rampe
      Fserie.Shapes[0].AddXY(34.4, 21.1) ;
      //Fserie.Shapes[0].AddXY(31.4, 13.1) ;
      Fserie.Shapes[0].AddXY(36.2, 23) ;
      //Fserie.Shapes[0].AddXY(32.6, 12) ;
      Fserie.Shapes[0].AddXY(37.4, 21.8) ;
      Fserie.Shapes[0].AddXY(35.6, 19.9) ;
      Fserie.Shapes[0].AddXY(35, 20.6) ;
      Fserie.Shapes[0].AddXY(35.6, 19.9) ;
      //Fserie.Shapes[0].AddXY(32.6, 12) ;
      Fserie.Shapes[0].AddXY(37.4, 21.8) ;
      //Fserie.Shapes[0].AddXY(32, 12.6) ;
      Fserie.Shapes[0].AddXY(36.8, 22.5) ;

      Fserie.Shapes[0].AddXY(38.2, 23.8) ;

      //Deuxième step dans la rampe
      Fserie.Shapes[0].AddXY(37.6, 24.3) ;
      Fserie.Shapes[0].AddXY(39.4, 26.2) ;
      Fserie.Shapes[0].AddXY(40.6, 25) ;
      Fserie.Shapes[0].AddXY(38.8, 23.1) ;
      Fserie.Shapes[0].AddXY(38.2, 23.8) ;
      Fserie.Shapes[0].AddXY(38.8, 23.1) ;
      Fserie.Shapes[0].AddXY(40.6, 25) ;

      Fserie.Shapes[0].AddXY(40, 25.5) ;

      //Jointure
      Fserie.Shapes[0].AddXY(41.2, 26.7) ;
      Fserie.Shapes[0].AddXY(43, 26.7) ;

      //Plat finale
      Fserie.Shapes[0].AddXY(43, 26.7) ;
      Fserie.Shapes[0].AddXY(43, 27.7) ;
      Fserie.Shapes[0].AddXY(58, 27.7) ;
      Fserie.Shapes[0].AddXY(58, 25.9) ;
      Fserie.Shapes[0].AddXY(43, 25.9) ;
      Fserie.Shapes[0].AddXY(43, 26.7) ;

      //Retour en arrière
      Fserie.Shapes[0].AddXY(41.2, 26.7) ;
      Fserie.Shapes[0].AddXY(40, 25.5) ;
      Fserie.Shapes[0].AddXY(40.6, 25) ;
      Fserie.Shapes[0].AddXY(38.8, 23.1) ;
      Fserie.Shapes[0].AddXY(38.2, 23.8) ; 

      //Fserie.Shapes[0].AddXY(32, 12.6) ;
      Fserie.Shapes[0].AddXY(36.8, 22.5) ;
      //Fserie.Shapes[0].AddXY(32.6, 12) ;
      Fserie.Shapes[0].AddXY(37.4, 21.8) ;
      Fserie.Shapes[0].AddXY(35.6, 19.9) ;
      Fserie.Shapes[0].AddXY(35, 20.6) ;
      Fserie.Shapes[0].AddXY(34, 19.5) ;

      Fserie.Shapes[0].AddXY(32, 19.5) ;
      Fserie.Shapes[0].AddXY(32, 18.75) ;
      Fserie.Shapes[0].AddXY(30, 18.75) ;
      Fserie.Shapes[0].AddXY(30, 19.5) ;

      Fserie.Shapes[0].AddXY(28, 19.5) ;
      Fserie.Shapes[0].AddXY(28, 18.75) ;
      Fserie.Shapes[0].AddXY(26, 18.75) ;
      Fserie.Shapes[0].AddXY(26, 19.5) ;

      Fserie.Shapes[0].AddXY(24.2, 19.5) ;
      Fserie.Shapes[0].AddXY(23, 18.5) ;
    end ;
Gradient_Old_OK.png
Gradient_Old_OK.png (10.02 KiB) Viewed 4100 times
Gradient_New_NotOK.png
Gradient_New_NotOK.png (7.54 KiB) Viewed 4100 times
Any idee to help me to do the same as before ?

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

Re: Modification in Gradient ?

Post by Yeray » Thu Jun 09, 2016 8:28 am

Hello,

I'm not getting the same result than you with that code, neither with v2013:
shapes.png
shapes.png (12.94 KiB) Viewed 4091 times
testShapes.zip
(1.72 KiB) Downloaded 523 times
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