use of br.com.digilabs.jqplot.elements.Highlighter in project openmeetings by apache.
the class PollResultsDialog method renderHead.
@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
response.render(JavaScriptHeaderItem.forReference(JqPlotJavascriptResourceReference.get()));
response.render(CssHeaderItem.forReference(JqPlotCssResourceReference.get()));
Chart<?> c1 = new PieChart<>(null);
c1.getChartConfiguration().setHighlighter(new Highlighter());
for (Chart<?> chart : new Chart<?>[] { c1, new BarChart<Integer>(null) }) {
for (String resource : JqPlotUtils.retriveJavaScriptResources(chart)) {
response.render(JavaScriptHeaderItem.forReference(new JavaScriptResourceReference(JqPlotBehavior.class, removeMinified(resource))));
}
}
}
use of br.com.digilabs.jqplot.elements.Highlighter in project openmeetings by apache.
the class PollResultsDialog method barChart.
private BarChart<Integer> barChart(RoomPoll p) {
String[] ticks = getTicks(p);
BarChart<Integer> barChart = new BarChart<>(null);
barChart.addValue(Arrays.asList(getValues(p)));
barChart.getSeriesDefaults().setRendererOptions(new RendererOptions().setHighlightMouseDown(true).setShowDataLabels(true).setFill(false).setSliceMargin(4).setLineWidth(5).setBarDirection("horizontal"));
Highlighter h = new Highlighter();
h.setShow(true);
h.setFormatString("%s, %P");
h.setTooltipLocation(Location.ne);
h.setShowTooltip(true);
h.setUseAxesFormatters(false);
ChartConfiguration<Long> cfg = barChart.getChartConfiguration();
cfg.setLegend(null).setHighlighter(h);
cfg.axesInstance().setXaxis(null);
cfg.axesInstance().yAxisInstance().setTicks(ticks).setRenderer(JqPlotResources.CategoryAxisRenderer);
return barChart;
}
Aggregations