Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Because you didn't provide much information i post here the steps i took...</p> <p>First that all i add the jquery and highcharts javascript files into webapp/js folder</p> <p>now, edit your application servlet (the one that extends AbstractApplicationServlet)... there is a method <strong><code>writeAjaxPageHtmlHeader</code></strong> where you must add the url for the above two js files. that is here: <a href="https://vaadin.com/forum/-/message_boards/view_message/254632#_19_message_254632" rel="nofollow">https://vaadin.com/forum/-/message_boards/view_message/254632#_19_message_254632</a></p> <p>i use maven in my project so, add the dependencies (if you aren't using maven add the jars into WEB-INF/lib folders)</p> <p>later, i recompile the app widgetset with gwt:clean, vaadin:update-widgetset and gwt-compile maven plugins (if not using maven the command is Ctrl+6 i think)</p> <p>finally the code for adding a chart into a component can be like this:</p> <pre><code>package com.x.y.z; import java.util.LinkedHashSet; import java.util.Map; import com.invient.vaadin.charts.InvientChartsConfig; import com.x.y.Manager; import com.x.y.util.ApplicationHelper; public class SalesChat extends AbstractChart { private static final long serialVersionUID = -793793426045107314L; public SalesChat(InvientChartsConfig chartConfig) { super(chartConfig); } @Override public void build() { Manager manager = (Manager)ApplicationHelper.getApplicationContext().getBean("manager"); Map&lt;String, Integer&gt; sales = manager.weeklySales(); XYSeries series = new XYSeries("Sales"); LinkedHashSet&lt;DecimalPoint&gt; points = new LinkedHashSet&lt;DecimalPoint&gt;(); for( String string : sales.keySet() ){ DecimalPoint point = new DecimalPoint(series, string, sales.get(string)); point.setName( string + " " + sales.get(string).toString()); points.add( point ); } series.setSeriesPoints(points); addSeries(series); setWidth("279px"); setHeight("240px"); } } </code></pre> <p>later...</p> <pre><code>InvientChartsConfig chartConfig = new InvientChartsConfig(); chartConfig.getTitle().setText("Sales"); chartConfig.getGeneralChartConfig().setType(SeriesType.PIE); SalesChat chart = new SalesChat(chartConfig); chart.build(); VerticalLayout layout = new VerticalLayout(); layout.addComponent(chart); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload