Jump to content

TUniChart image clipping


rgreat

Recommended Posts

On 7/5/2019 at 9:10 PM, Sherzod said:

Thank you.

Can you please open a ticket in support portal?

On the other hand this solution is far from perfect.

image.png.f4a63ac310fa61c2a52e8a36220bc0d0.png

It adds very large unused borders around diagram.

 

Also seems like amount of text labels is not optimal, and quite low.

Only 2 labels on screenshot above. It could be at least 3:

image.png.e67fc4a72edd76801e9400a8cbc2e37e.png

1.19 not shown unless selected.

It is possible to remove or tune-up text filtering?

Link to comment
Share on other sites

These steps improve situation:

1. UniChart.LayoutConfig.BodyPadding := 0; (from 10)

2. For UniPieSeries.SeriesLabel.Display='inside' i recommend using:

config.innerPadding=10;
config.insetPadding=-10;

3. For UniPieSeries.SeriesLabel.Display='outer' and 'rotate' i recommend using:

config.innerPadding=10;
config.insetPadding=30; // or more (depending on labels length)

4. And finally we need a way to reduce calloutLine.length somehow to minimize unused space around diagram.

Dirty source hack:

function TUniCustomSeriesLabel.AsString(AFieldName: string): string;
begin
  if (AFieldName<>'') and (AFieldName[1]<>'[') then
    AFieldName := '"' + AFieldName + '"';

  Result  :=
        '{'+
        'field:'+AFieldName+
          IfThen(FEnabled and (FDisplay<>'none'),
            ',display:"'+ FDisplay +'"'+
            IfThen(FCalloutLine.FVisible, ',calloutLine:true','')+
            ',calloutLine: { length: 25 }'+ //  <----------------------------------------------------------- 20-30.
            IfThen(not FFont.IsDefault, ',font:"'+FFont.ToString(False, False, False, False)+'"','')+
            IfThen(not FFont.Color<>clWindowText, ','+FFont.ToColor(True, False),'')+
            IfThen(FOrientation<>tloHorizontal, ',orientation:"vertical"','')+
            IfThen(FPadding<>20, ',padding:'+IntToStr(FPadding),''),
          '')+
        '}';
end;

Can i set calloutLine at runtime?

5. Missing labels: 

image.png.9f28ffe0307002abfdb054ccc60a7a18.png image.png.bf417a46216f838444c941cbe73d4cb2.png

6. And finally:

Can i add units in hint?

These are stored in dataset, but seems like not all DS fields are loaded into Chart, so i cant just use them in JS.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...