Marker for multiple categories in a BoxAndWhisker Plot

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
davidweber
Posts: 1
Joined: Thu Jun 08, 2006 11:18 am

Marker for multiple categories in a BoxAndWhisker Plot

Post by davidweber » Thu Jun 08, 2006 3:37 pm

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

Jyothy
Posts: 17
Joined: Fri Mar 24, 2006 6:46 am

Post by Jyothy » Wed Jun 21, 2006 10:04 am

If you want only lines to categorize the chart you can use XYLineAnnotation

to draw lines on graph

Locked