i am making my first chart in google visualization ,
trying to make a simple bar chart
I got this from the example :
VerticalPanel vp = new VerticalPanel();
Options options = Options.create();
options.setHeight(240);
options.setTitle("Company Performance");
options.setWidth(400);
options.set3D(true);
DataTable data = DataTable.create();
data.addColumn(ColumnType.STRING, "Year");
data.addColumn(ColumnType.NUMBER, "Sales");
data.addColumn(ColumnType.NUMBER, "Expenses");
data.addRows(4);
data.setValue(0, 0, "2004");
VisualizationWidget<BarChart, BarChart.Options> widget =
BarChart.createWidget(data, options);
BarChart viz = widget.getVisualization();
Label status = new Label();
viz.addSelectHandler(new SelectionDemo(viz, status));
vp.add(status);
vp.add(widget);
this line
VisualizationWidget<BarChart, BarChart.Options> widget =
BarChart.createWidget(data, options);
says
VisualizationWidget cannot be resolved to a type
compilation error :
[ERROR] Line 150: VisualizationWidget cannot be resolved to a type
[ERROR] Line 151: The method createWidget(DataTable, PieChart.Options) is undefined for the type BarChart
[ERROR] Line 154: SelectionDemo cannot be resolved to a type
i’m not able to understand whats this VisualizationWidget, if you could guide me how to resolve this
Thanks
It shows that you might forget to add a dependency of Visualization jar in your project.
you could try to add the dependency by hand to the .gwt.xml file in your project:
Add below code in your .html file:
Code