allenchow Posted December 14, 2016 Posted December 14, 2016 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 ! Quote
Sherzod Posted December 14, 2016 Posted December 14, 2016 Hi, Сan you make a small test case for this, if will not be difficult for you ?! Best regards. Quote
allenchow Posted December 14, 2016 Author Posted December 14, 2016 actually you can check the piechart demo, after click clear button, all 'sticks' are still remain... Quote
Sherzod Posted December 15, 2016 Posted December 15, 2016 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. Quote
allenchow Posted December 16, 2016 Author Posted December 16, 2016 How about if the chart is not in the mainform? Thanks Quote
Sherzod Posted December 16, 2016 Posted December 16, 2016 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. Quote
allenchow Posted December 16, 2016 Author Posted December 16, 2016 Not work ....I've attached a sample ChartTest.rar Quote
Sherzod Posted December 16, 2016 Posted December 16, 2016 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. Quote
allenchow Posted December 16, 2016 Author Posted December 16, 2016 Finally it works. Thanks a lot !! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.