Page 1 of 2

2 Problems in new VCL vs old VCL 7.07

Posted: Wed Jul 29, 2015 1:42 pm
by 16575033
HI, in the old version 7.07 I could run following:

Code: Select all

procedure TForm7.Button3Click(Sender: TObject);
begin
  inherited;

  // Show 3D Gallery:
  with TFormTee3D.CreateChart(Self,Chart1) do
  try
    Align:=alNone;
    BorderStyle:=TeeBorderStyle;  // bsDialog
    Position:=poScreenCenter;
    PageControl1.ActivePage:=TabViews;
    PageControl1Change(PageControl1);
    ResetTab3D:=False;
    ShowModal;
  finally
    Free;
  end;
end;
That is not working anymore. What can I do?

Secondly, I could change the source in the old Library that there is a STyle psInvRainbow.
In the new Lib there is also no Inverse Rainbow Style. How can I add it again?
Could you add this Style-feature to the next update?
Thanks a lot.

Walter

Re: 2 Problems in new VCL vs old VCL 7.07

Posted: Wed Jul 29, 2015 2:22 pm
by narcis
Hi Walter,
walter0316 wrote: That is not working anymore. What can I do?
That was changed in the earliest v9 (aka v201x) development stage. Now you can do this:

Code: Select all

  // Show 3D Gallery:
  with TFormTee3D.Create(Self) do
  try
    ThePanel:=Chart1;
    Align:=alNone;
    BorderStyle:=TeeBorderStyle;  // bsDialog
    Position:=poScreenCenter;
    PageControl1.ActivePage:=TabViews;
    PageControl1Change(PageControl1);
    ResetTab3D:=False;
    ShowModal;
  finally
    Free;
  end;
walter0316 wrote: Secondly, I could change the source in the old Library that there is a STyle psInvRainbow.
In the new Lib there is also no Inverse Rainbow Style. How can I add it again?
I can not find psInvRainbow in our sources history, the only mention of it I find is from a customer at this forum as a custom palette suggestion. As suggested there you can create as a custom palette.

psRainbow palette being:

Code: Select all

  RainbowPalette:Array[0..24] of TColor=
  (
    $000099,
    $0000C3,
    $0000EE,
    $001AFF,
    $0046FF,
    $0073FF,
    $009FFF,
    $00CBFF,
    $00F7FF,
    $08F4E3,
    $11E7C3,
    $1BDAA3,
    $25CD83,
    $2EC063,
    $38B342,
    $42A622,
    $4B9A02,
    $6A870C,
    $8A751A,
    $AA6328,
    $CB5036,
    $EB3E44,
    $FF2A61,
    $FF1596,
    $FF00CC
  );
and code creating psRainbow below, will probably help you creating it.

Code: Select all

  procedure SetRainbowPalette;

    // Special case, internal Rainbow palette is in VCL format:
    {$IFDEF FMX}
    function InvertColor(const AColor:TColor):TColor;
    begin
      with TRGBA(result) do
      begin
        Red:=TRGBA(AColor).Blue;
        Green:=TRGBA(AColor).Green;
        Blue:=TRGBA(AColor).Red;

        // FMX opacity is inverted from VCL:
        if TRGBA(AColor).Alpha=0 then
           Alpha:=255;
      end;
    end;
    {$ENDIF}

  var t : Integer;
  begin
    if Assigned(ParentChart) then
    begin

      // Wish: Instead of using "Length(RainbowPalette)" here use: NumSteps.
      //
      // ie: Needs to calculate "middle" colors in between
      // if the NumSteps is bigger than 25.
      SetLength(ParentChart.ColorPalette,Length(RainbowPalette));
      for t:=0 to High(RainbowPalette) do
          ParentChart.ColorPalette[t]:={$IFDEF FMX}InvertColor{$ENDIF}(RainbowPalette[t]);

      // Default:
      for t:=0 to NumSteps-1 do
          DoAddPalette(tmpMin+ScaleValue*t,ParentChart.GetDefaultColor(t));

      ParentChart.ColorPalette:=nil; // should be OLD palette !!
    end;
  end;
walter0316 wrote: Could you add this Style-feature to the next update?
I added it to the wish-list (ID1259) to be considered for inclusion in future releases.

Re: 2 Problems in new VCL vs old VCL 7.07

Posted: Wed Jul 29, 2015 3:01 pm
by 16575033
Thanks a lot! I will try it tomorrow! :D

Re: 2 Problems in new VCL vs old VCL 7.07

Posted: Wed Jul 29, 2015 3:30 pm
by 16575033
if Assigned(ParentChart) then
ParentChart is not known. What I have to do?
thanks

Re: 2 Problems in new VCL vs old VCL 7.07

Posted: Wed Jul 29, 2015 3:47 pm
by 16575033
Is it correct, when I define PartenChart as my Chart1?
More Q:

WHen I define a User Palette. WHat must I define for MPISeries.PaletteStyle?

Re: 2 Problems in new VCL vs old VCL 7.07

Posted: Wed Jul 29, 2015 3:48 pm
by 16575033
I have doen this:

Code: Select all

  with MPISeries do
    begin
      PaletteSteps := 24;
      //PaletteStyle := psInvRainbow; InvRainbow wäre richtig, doch nicht im neuer Lib
      //PaletteStyle := psRainbow;
      SetINvRainbowPalette(Chart1);
      //StartColor := 8404992;
      StartColor := clGreen;
      UseColorRange := False;
      UsePalette := True;
      UsePaletteMin := True;
      PaletteStep := Lipo9Satz.MPiMAX / 23;
    end;

Re: 2 Problems in new VCL vs old VCL 7.07

Posted: Wed Jul 29, 2015 3:55 pm
by 16575033
Hey, I found in the EDIT CHART Window an INVERT BUtton!!! I think I can use this for inverting the Rainbow and then it is defined as user pallete. right?

Re: 2 Problems in new VCL vs old VCL 7.07

Posted: Wed Jul 29, 2015 6:55 pm
by 16575033
I get an ACCESS VIALOTION after SHOWMODAL!!
Could you reproduse this? Please help.

Thanks

Code: Select all

procedure TForm7.Button3Click(Sender: TObject);
begin
  //inherited;

  // Show 3D Gallery:
  with TFormTee3D.Create(Self) do
  try
    ThePanel:=Chart1;
    Align:=alNone;
    BorderStyle:=TeeBorderStyle;  // bsDialog
    Position:=poScreenCenter;
    PageControl1.ActivePage:=TabViews;
    PageControl1Change(PageControl1);
    ResetTab3D:=False;
    ShowModal;
  finally
    Free;
  end;
  
(*      problem in new vcl
  
  // Show 3D Gallery:
  with TFormTee3D.CreateChart(Self,Chart1) do
  try
    Align:=alNone;
    BorderStyle:=TeeBorderStyle;  // bsDialog
    Position:=poScreenCenter;
    PageControl1.ActivePage:=TabViews;
    PageControl1Change(PageControl1);
    ResetTab3D:=False;
    ShowModal;
  finally
    Free;
  end;
  *)
end;

Re: 2 Problems in new VCL vs old VCL 7.07

Posted: Thu Jul 30, 2015 7:57 am
by narcis
walter0316 wrote:Is it correct, when I define PartenChart as my Chart1?
This is at series level, it should be series' ParentChart property, for example:

Code: Select all

Chart1[0].ParentChart
walter0316 wrote:WHen I define a User Palette. WHat must I define for MPISeries.PaletteStyle?
Nothing. You should define your custom palette as in the example here or the example at All Features\Welcome!\Chart Styles\Extended\Contour\Palette and Color range in the new features demo, available at TeeChart's program group.

Re: 2 Problems in new VCL vs old VCL 7.07

Posted: Thu Jul 30, 2015 8:01 am
by narcis
walter0316 wrote:Hey, I found in the EDIT CHART Window an INVERT BUtton!!! I think I can use this for inverting the Rainbow and then it is defined as user pallete. right?
Where did you found that exactly?

Thanks.

Re: 2 Problems in new VCL vs old VCL 7.07

Posted: Thu Jul 30, 2015 8:04 am
by narcis
walter0316 wrote:I get an ACCESS VIALOTION after SHOWMODAL!!
Could you reproduse this?
No, I can't reproduce it. Which Delphi version are you using? Can you please attach a simple example project we can run "as-is" to reproduce the problem here?

Thanks in advance.

Re: 2 Problems in new VCL vs old VCL 7.07

Posted: Thu Jul 30, 2015 8:22 am
by 16575033
You can find the INVERT BUtton on the

Edit Chart by clicking on the chart and then select the Series and then see my attached Screenshoot.
You just have to select Rainbow and then click on INVERT button.

Re: 2 Problems in new VCL vs old VCL 7.07

Posted: Thu Jul 30, 2015 8:44 am
by 16575033
here I have done a sample with the ACCESS VIOLATION. I use Delphi XE6 with the latest VCL Teechart.

Re: 2 Problems in new VCL vs old VCL 7.07

Posted: Thu Jul 30, 2015 10:01 am
by narcis
walter0316 wrote: Edit Chart by clicking on the chart and then select the Series and then see my attached Screenshoot.
You just have to select Rainbow and then click on INVERT button.
Excellent! Chart editor is so extensive... :wink:

Re: 2 Problems in new VCL vs old VCL 7.07

Posted: Thu Jul 30, 2015 10:30 am
by narcis
Hi Walter,
walter0316 wrote:here I have done a sample with the ACCESS VIOLATION. I use Delphi XE6 with the latest VCL Teechart.
Sorry, my bad, I was not choosing any options in the editor. I have added it (Bug #1260) to the bug list to be fixed for future releases.