Jump to content

Piechart Serieslabel will not clear


allenchow

Recommended Posts

When I modify values of pieseries, I use clear method,

but the serieslabel (calloutline display outside) sticks were still there and will not clear by themselves.

 

Also I can't assign serieslabel.calloutline directly, no such property .

 

Please fixed . Thanks !

Link to comment
Share on other sites

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...