use of org.jfree.chart.axis.SymbolAxis in project processdash by dtuma.
the class TimeLogPhaseWaterfallChart method createChart.
private JFreeChart createChart(IntervalXYDataset dataset, ProcessUtil process, List<String> phases, GapSkipTracker gaps) {
JFreeChart result = ChartFactory.createXYBarChart(null, null, true, null, dataset, PlotOrientation.VERTICAL, false, true, false);
XYPlot xyplot = (XYPlot) result.getPlot();
DateAxis dateAxis = new DateAxis(null);
dateAxis.setTickMarksVisible(false);
dateAxis.setTickLabelsVisible(false);
dateAxis.setLowerMargin(0.01);
dateAxis.setUpperMargin(0.01);
setupGaps(gaps, dateAxis, xyplot);
xyplot.setDomainAxis(dateAxis);
String[] phaseNameList = new String[phases.size()];
for (int i = 0; i < phaseNameList.length; i++) phaseNameList[i] = Translator.translate(phases.get(i));
SymbolAxis symbolaxis = new SymbolAxis(null, phaseNameList);
symbolaxis.setGridBandsVisible(false);
xyplot.setRangeAxis(symbolaxis);
final XYBarRenderer renderer = (XYBarRenderer) xyplot.getRenderer();
renderer.setUseYInterval(true);
renderer.setDrawBarOutline(true);
renderer.setBaseOutlinePaint(Color.black);
new PhaseChartColorer(process, phases) {
public void setItemColor(Object key, int pos, Color c) {
renderer.setSeriesPaint(pos, c);
}
}.run();
int exceptionSeries = dataset.getSeriesCount() - 1;
renderer.setSeriesPaint(exceptionSeries, EXCEPTION_PAINT);
renderer.setSeriesFillPaint(exceptionSeries, EXCEPTION_PAINT);
renderer.setSeriesOutlinePaint(exceptionSeries, EXCEPTION_PAINT);
renderer.setBaseToolTipGenerator(new TooltipGenerator());
xyplot.setBackgroundPaint(Color.white);
xyplot.setDomainGridlinesVisible(false);
xyplot.setRangeGridlinePaint(Color.lightGray);
xyplot.setDrawingSupplier(DRAWING_SUPPLIER_FACTORY.newDrawingSupplier());
result.setAntiAlias(false);
result.setTextAntiAlias(true);
parameters.put("title", resources.getString("Title"));
return result;
}
Aggregations