Hi Isomorphic,
We are experiencing a Chart flashing/blinking behaviour in IE11 when the replacement of the canvas happens in a timer thread. This is not a problem for Chrome or Firefox.
This is a regression, as it did not occur in the following SmartGWT version.
SmartClient Version: SNAPSHOT_v10.1d_2015-10-25/Pro Deployment (built 2015-10-25)
We don't know exactly when the issue starting happening, however, we have confirmed it became an issue as far back as the following SmartGWT version.
SmartClient Version: v10.1p_2016-04-28/Pro Deployment (built 2016-04-28)
We are currently using the following SmartGWT version, which still exhibits the issue.
SmartClient Version: v10.1p_2016-11-13/Pro Deployment (built 2016-11-13)
We have created a very simple test case to demonstrate the behaviour.
Click the Flash button to replace the canvas using a Timer thread. (Reproduces the issue)
Click the No Flash button to replace the canvas not using a Timer thread.
Sandbox9.java
SimpleChartData1.java
SimpleChartData2.java
Thanks
We are experiencing a Chart flashing/blinking behaviour in IE11 when the replacement of the canvas happens in a timer thread. This is not a problem for Chrome or Firefox.
This is a regression, as it did not occur in the following SmartGWT version.
SmartClient Version: SNAPSHOT_v10.1d_2015-10-25/Pro Deployment (built 2015-10-25)
We don't know exactly when the issue starting happening, however, we have confirmed it became an issue as far back as the following SmartGWT version.
SmartClient Version: v10.1p_2016-04-28/Pro Deployment (built 2016-04-28)
We are currently using the following SmartGWT version, which still exhibits the issue.
SmartClient Version: v10.1p_2016-11-13/Pro Deployment (built 2016-11-13)
We have created a very simple test case to demonstrate the behaviour.
Click the Flash button to replace the canvas using a Timer thread. (Reproduces the issue)
Click the No Flash button to replace the canvas not using a Timer thread.
Sandbox9.java
Code:
package com.sandbox.client; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.user.client.Timer; import com.sandbox.client.data.SimpleChartData1; import com.sandbox.client.data.SimpleChartData2; import com.smartgwt.client.core.KeyIdentifier; import com.smartgwt.client.types.ChartType; import com.smartgwt.client.util.Page; import com.smartgwt.client.util.PageKeyHandler; import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.Button; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.Window; import com.smartgwt.client.widgets.chart.FacetChart; import com.smartgwt.client.widgets.cube.Facet; import com.smartgwt.client.widgets.events.ClickEvent; import com.smartgwt.client.widgets.events.ClickHandler; import com.smartgwt.client.widgets.layout.VLayout; public class Sandbox9 implements EntryPoint { private Canvas currentCanvas; private int counter = 0; @Override public void onModuleLoad() { final Window window = new Window(); window.setHeight100(); window.setWidth100(); VLayout layout = new VLayout(); layout.setWidth100(); layout.setHeight100(); Button buttonFlash = new Button(); buttonFlash.setTitle("Flash"); buttonFlash.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { Timer scheduleReplace = new Timer() { @Override public void run() { replaceCanvas(window); } }; scheduleReplace.schedule(0); } }); Button buttonNoFlash = new Button(); buttonNoFlash.setTitle("No Flash"); buttonNoFlash.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { replaceCanvas(window); } }); layout.addMember(buttonFlash); layout.addMember(buttonNoFlash); layout.addMember(window); layout.draw(); }; private void replaceCanvas(Window window) { if (currentCanvas != null) { window.removeItem(currentCanvas); if (currentCanvas instanceof FacetChart) { ((FacetChart) currentCanvas).destroyItems(); } currentCanvas.destroy(); } FacetChart chart = getChart(); currentCanvas = chart; window.setTitle("Some Title"); window.addItem(chart); window.show(); } private FacetChart getChart() { FacetChart chart; if ((counter % 2) == 0) { chart = new FacetChart(); chart.setData(SimpleChartData1.getData()); chart.setFacets(new Facet("product", "Product")); chart.setValueProperty("sales"); } else { chart = new FacetChart(); chart.setData(SimpleChartData2.getData()); chart.setFacets(new Facet("other", "Other")); chart.setValueProperty("count"); } counter++; chart.setChartType(ChartType.PIE); return chart; } }
Code:
package com.sandbox.client.data; import com.smartgwt.client.data.Record; public class SimpleChartData1 extends Record { public SimpleChartData1(String product, Integer sales) { setAttribute("product", product); setAttribute("sales", sales); } public static SimpleChartData1[] getData() { return new SimpleChartData1[] { new SimpleChartData1("West-Cars", 37), new SimpleChartData1("North-Cars", 29), new SimpleChartData1("East-Cars", 80), new SimpleChartData1("South-Cars", 87), new SimpleChartData1("West-Trucks", 23), new SimpleChartData1("North-Trucks", 45), new SimpleChartData1("East-Trucks", 32), new SimpleChartData1("South-Trucks", 67), new SimpleChartData1("West-Motorcycles", 12), new SimpleChartData1("North-Motorcycles", 4), new SimpleChartData1("East-Motorcycles", 23), new SimpleChartData1("South-Motorcycles", 45) }; } }
Code:
package com.sandbox.client.data; import com.smartgwt.client.data.Record; public class SimpleChartData2 extends Record { public SimpleChartData2(String other, Integer sales) { setAttribute("other", other); setAttribute("count", sales); } public static SimpleChartData2[] getData() { return new SimpleChartData2[] { new SimpleChartData2("A", 10), new SimpleChartData2("B", 20), new SimpleChartData2("C", 30), new SimpleChartData2("D", 40) }; } }
Comment