Jump to content

TuniChart canvas


AntonioM

Recommended Posts

Hello 

I'm using Unigui 1.0.1424

I have a (BIG) problem: When I change data in a TUnichart (by clearing and reloading the series) in screen it looks ok, but when I save the image in server (I need that to create a html report), the PNG file shows previous data and overlapped legends in vertical axis, as if it not has been cleared before rendering.

Any help?

Could I manually clear the PNG canvas of the Chart before render (save image)?

Thank You in advance

Antonio Torregrosa

 

Link to comment
Share on other sites

I attach some screen captures. Please note that in screen chart appears right, but when I generate PNG by saveimage procedure this file has "rubbish".

I have several apps in production, so I don't want to upgrade unless I am sure this error is fixed.

Chart #1 (screen) - 2 series, 3 records

image.thumb.png.4871c6f0faecd2850b9718b266c5836d.png

Chart #1 (PNG image)

image.png.be722a1f717d47075084aaa3a5d8b08a.png

Chart #2 (screen) - 2 series, 1 record

image.thumb.png.6ca4a7d03066e0b365977accae64a852.png

Chart #2 (PNG) - Here you can see "rubbish" from previous chart (in bars and in left vertical axis)

image.png.515e89fbb3b3dd242c45143cd8ce55ce.png

 

Link to comment
Share on other sites

Hello. Here you are a simple sample: A chart, two series (Bars), a UniImage and two buttons. Rubbish appear when series has less records than previous.

 

unit Main;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics,
  Controls, Forms, uniGUITypes, uniGUIAbstractClasses,
  uniGUIClasses, uniGUIRegClasses, uniGUIForm, uniButton, uniChart, uniImage,
  uniGUIBaseClasses, uniPanel;

type
  TMainForm = class(TUniForm)
    UniChart1: TUniChart;
    UniImage1: TUniImage;
    UniBarSeries1: TUniBarSeries;
    UniBarSeries2: TUniBarSeries;
    UniButton1: TUniButton;
    UniButton2: TUniButton;
    procedure UniButton1Click(Sender: TObject);
    procedure UniChart1ChartImage(Sender: TUniCustomChart; Image: TGraphic);
    procedure UniButton2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

function MainForm: TMainForm;

implementation

{$R *.dfm}

uses
  uniGUIVars, MainModule, uniGUIApplication;

function MainForm: TMainForm;
begin
  Result := TMainForm(UniMainModule.GetFormInstance(TMainForm));
end;

procedure TMainForm.UniButton1Click(Sender: TObject);
var t, q : integer;
begin
    UNiChart1.SeriesList[0].Clear;
    UNiChart1.SeriesList[1].Clear;
    t:=random(10)+1;
    for q:=1 to t do begin
      UNiChart1.SeriesList[0].Add(random(100),inttostr(q));
      UNiChart1.SeriesList[1].Add(random(100),'');
    end;
end;

procedure TMainForm.UniButton2Click(Sender: TObject);
begin
    UniChart1.SaveImage;
end;

procedure TMainForm.UniChart1ChartImage(Sender: TUniCustomChart; Image: TGraphic);
begin
    UNiImage1.Picture.Assign(Image);
end;

initialization
  RegisterAppFormClass(TMainForm);

end.
 

image.thumb.png.d52945f3d6f0a909ee2fb45d7d8b745b.png

 

 

Link to comment
Share on other sites

  • 7 months later...

Please repeat the "Generate Data" button and click each time on first "Get Image" Button.

If you don't see rubbish (in Y labels) and overlapped bars in image (like in this image), then we can be sure that the problem is in the Unigui/Sencha version. In this case I'd like to know if I can patch just this component, so I can not update my Unigui version by now.

I'm using Unigui 1.0.1424 (proffesional, registered to  atorregrosa@tricom.es) and Delphi 10.3.

image.thumb.png.d52945f3d6f0a909ee2fb45d7d8b745b.png

Regards

PD The Second "Get Image" button was for testing if I can get the image directly from object, but it only works in client side, not in server side (and I can't change the filename and destination folder).

Thx in advance

Link to comment
Share on other sites

2 hours ago, Sherzod said:

With the latest builds I couldn't reproduce. Can you please upgrade to the latest builds?

Sorry, but now I have 3 apps in production and upgrading suposes to buy a license renovation, plus rebuild and review all apps.

Probably I'll update Unigui after this summer.

Thanks anyway.

Link to comment
Share on other sites

  • 2 weeks later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...