Hi,
I'm trying to do a example for FacetChart by using Nightly build. I couldn't able to get the chart in UI. Please see below for my code.
And the data class is as follows.
When I searched using firebug in the browser, I get the below HTML.
Here is my inheritance in .gwt.xml file
Can you please let me know what I'm missing and what is the issue with this code??
I have enabled the Analytics and Drawing module in this project.
I'm trying to do a example for FacetChart by using Nightly build. I couldn't able to get the chart in UI. Please see below for my code.
Code:
public void onModuleLoad() { final FacetChart chart = new FacetChart(); chart.setData(LogScalingChartData.getData()); chart.setFacets(new Facet("region", "Region"), new Facet("product", "Product")); chart.setValueProperty("sales"); chart.setChartType(ChartType.AREA); chart.setTitle("Sales by Product and Region"); chart.setHeight(500); chart.setWidth(500); chart.draw(); chart.show(); chart.bringToFront(); RootPanel.get("root").add(chart); }
Code:
import com.smartgwt.client.data.Record; public class LogScalingChartData extends Record { public LogScalingChartData(String region, String product, Integer sales) { setAttribute("region", region); setAttribute("product", product); setAttribute("sales", sales); } public static LogScalingChartData[] getData() { return new LogScalingChartData[] { new LogScalingChartData("West", "Cars", 37), new LogScalingChartData("North", "Cars", 29), new LogScalingChartData("East", "Cars", 80), new LogScalingChartData("South", "Cars", 87), new LogScalingChartData("West", "Trucks", 23), new LogScalingChartData("North", "Trucks", 45), new LogScalingChartData("East", "Trucks", 32), new LogScalingChartData("South", "Trucks", 67), new LogScalingChartData("West", "Motorcycles", 12), new LogScalingChartData("North", "Motorcycles", 4), new LogScalingChartData("East", "Motorcycles", 23), new LogScalingChartData("South", "Motorcycles", 45) }; } }
Code:
<div id="root"> <div id="isc_FacetChart_0_wrapper"> <div id="isc_0" class="normal" onscroll="return isc_FacetChart_0.$lh()" style="POSITION:relative;LEFT:0px;TOP:0px;WIDTH:500px;HEIGHT:500px;Z-INDEX:800018;-moz-box-sizing:border-box;-moz-outline-offset:-1px;OVERFLOW:-moz-scrollbars-none;" eventproxy="isc_FacetChart_0"> <div id="isc_1" style="POSITION:relative;VISIBILITY:inherit;Z-INDEX:800018;CURSOR:default;" eventproxy="isc_FacetChart_0"> </div> </div> </div> </div>
Code:
<inherits name='com.google.gwt.user.User'/> <inherits name="com.smartgwt.SmartGwt"/> <inherits name="com.smartgwt.Analytics"/> <inherits name="com.smartgwt.Drawing"/>
I have enabled the Analytics and Drawing module in this project.
Comment