Search in sources :

Example 1 with RendererOptions

use of br.com.digilabs.jqplot.elements.RendererOptions 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;
}
Also used : RendererOptions(br.com.digilabs.jqplot.elements.RendererOptions) BarChart(br.com.digilabs.jqplot.chart.BarChart) Highlighter(br.com.digilabs.jqplot.elements.Highlighter)

Aggregations

BarChart (br.com.digilabs.jqplot.chart.BarChart)1 Highlighter (br.com.digilabs.jqplot.elements.Highlighter)1 RendererOptions (br.com.digilabs.jqplot.elements.RendererOptions)1