Jump to content

Piechart Serieslabel will not clear


allenchow

Recommended Posts

Hi,

 

For now can you try this approach ?!:

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  Series1.Clear; // your TUniPieSeries
  // UniChart1 - your TUniChart
  UniSession.AddJS('Ext.defer(function(){'+ UniChart1.JSName +'.chart.store.loadData([]);'
                                          + UniChart1.JSName +'.chart.surface.removeAll();'
                                          + '}, 50)'
  );
end;
procedure TMainForm.UniFormReady(Sender: TObject);
begin
  // UniChart1 - your TUniChart
  UniSession.AddJS(UniChart1.JSName + '.chart.addListener("resize", function(){if (this.store.count() == 0) {this.surface.removeAll()}})');
end;

Best regards.

Link to comment
Share on other sites

Hi,

 

How about if the chart is not in the mainform? Thanks

 

If you meant this code ?:

UniSession.AddJS(UniChart1.JSName + '.chart.addListener("resize", function(){if (this.store.count() == 0) {this.surface.removeAll()}})');

Then try the following code:

 

UniChart1 -> ClientEvents -> UniEvents -> Ext.chart.Chart [chart] -> chart.beforeInit fn:

function chart.beforeInit(sender, config)
{
    sender.addListener("resize", function() {
        if (this.store.count() == 0) {
            this.surface.removeAll()
        }
    });
}

Best regards.

Link to comment
Share on other sites

Hi,

 

Ok

Then try this:

 

 UniSession.AddJS('Ext.defer(function(){'+ UniChart1.JSName +'.chart.store.loadData([]);'
                                                                + UniChart1.JSName +'.chart.surface.removeAll();'
                                                                + '}, 50)'
  ); 

 

 Correct -> UniSession.AddJS('Ext.defer(function(){'+ UniChart1.JSName +'.chart.store.loadData([]);'
                                                                + UniChart1.JSName +'.chart.surface.removeAll();'
                                                                + '}, 0)'
  );

 

Best regards.

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...