For the moment, I have a StackedBarChart with only one horizontal bar whith no axis visible and a classic Marker on it (a vertical line with the same height of the bar).
Code: Select all
JFreeChart chart = ChartFactory.createStackedBarChart(
null, "Ratio", "%", dataset, PlotOrientation.HORIZONTAL, false, false, false );
CategoryPlot plot = (CategoryPlot)chart.getPlot();
plot.setBackgroundPaint(new Color(0,0,0,0));
plot.setOutlineVisible(false);
CategoryAxis domainAxis = plot.getDomainAxis();
domainAxis.setVisible(false);
ValueAxis rangeAxis = plot.getRangeAxis();
rangeAxis.setVisible(false);
rangeAxis.setLabel(null);
final Marker start = new ValueMarker(valueMarker);
start.setPaint(Color.black);
start.setLabel(null);
start.setStroke(new BasicStroke(5.0f, BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND, 1.0f, null, 0.0f));
start.setLabelAnchor(RectangleAnchor.CENTER);
start.setLabelTextAnchor(TextAnchor.CENTER_RIGHT);
plot.addRangeMarker(start);
I need just one diamond Shape on my bar instead of the marker. What kind of object do I need (a sort of lineandshape without line) ?
thanks for the help