hi all
i've implemented a BoxAndWhisker plot with a BoxAndWhiskerCategoryDataset in a CategoryPlot.
the plot has 22 categories. my problem is, that i want to mark multiple categories with the same color without a gap between the colorations of the single categories but with a category margin.
what i did:
i marked with the following method each category with a CategoryMarker.
private void addCategoryMarker(CategoryPlot plot, String categoryName, Color color, String markerLabel) {
// add a category marker
CategoryMarker marker = new categoryMarker(categoryName, color, new BasicStroke(1.0f));
marker.setDrawAsLine(false);
marker.setLabel(markerLabel);
marker.setLabelFont(new Font("Dialog", Font.PLAIN, 11));
marker.setLabelTextAnchor(TextAnchor.TOP_LEFT);
marker.setLabelOffset(new RectangleInsets(2, 5, 2, 5));
plot.addDomainMarker(marker, Layer.BACKGROUND);
}
if i set the category margin of the x-axis to 0, there are no gaps between the categories and the coloration is as i want it to be [xAxis.setCategoryMargin(0.0);].
but, i don't want to have no gaps between the categories, i just want to have no gaps between the coloration.
i also tried out an IntervalMarker, but this marker is only suitable for the RangeAxis and not for the DomainAxis.
does anybody know the right way to do it?
regards david
Marker for multiple categories in a BoxAndWhisker Plot
-
- Posts: 1
- Joined: Thu Jun 08, 2006 11:18 am