Borders of Category Markers

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
chrisTr
Posts: 5
Joined: Mon Nov 27, 2017 5:09 pm
antibot: No, of course not.

Borders of Category Markers

Post by chrisTr » Mon Nov 27, 2017 5:30 pm

Hello,

I wanted to integrate Category Markers at my bar chart and used the example source code of "CategoryMarkerDemo2.java" for creating these. I am using 3D Bar Charts and I got markers which do not include the whole bars and they are so much smaller than the other ones.

I wanted to get different background colors for each category. Is there any chance to increase the width of Category Markers? I don't want to decrease the space between the categories.

Btw: Is it possible to upload a screenshot of my diagram? So It's easier to show you my problem.

Greetings,

Christian Trost

paradoxoff
Posts: 1634
Joined: Sat Feb 17, 2007 1:51 pm

Re: Borders of Category Markers

Post by paradoxoff » Mon Nov 27, 2017 8:54 pm

Upload an image of your chart to one of the free image hosters, then post a link to the image here.

chrisTr
Posts: 5
Joined: Mon Nov 27, 2017 5:09 pm
antibot: No, of course not.

Re: Borders of Category Markers

Post by chrisTr » Tue Nov 28, 2017 9:49 am

Here is a screenshot of my problem. http://fs5.directupload.net/images/171128/t5i5ogff.png

paradoxoff
Posts: 1634
Joined: Sat Feb 17, 2007 1:51 pm

Re: Borders of Category Markers

Post by paradoxoff » Tue Nov 28, 2017 8:58 pm

I can't say that I have understood exactly what is wrong. I assume that the medium gray areas, that can hardly be distinguished from the plot walls, are the markers?
I checked the code for BarRenderer3D, and this renderer doesnot override drawDomainMarker (which it should).
I can only advice to have a look at the drawRangeMarker method of BarRenderer3D, understand how the 3D effect is created, and then write a correct drawDomainMarker method.
Personally, I do not use the pseudo-3D feature of JFreeChart, so I can't help directly.

chrisTr
Posts: 5
Joined: Mon Nov 27, 2017 5:09 pm
antibot: No, of course not.

Re: Borders of Category Markers

Post by chrisTr » Wed Nov 29, 2017 9:52 am

Yes, the medium gray areas are the markers. I wanted to get a different color for each category to make it easier to understand the diagram. If I don't use the 3D BarRenderer, is it possible to change the width of the markers that it has the same width like the areas without marker?

paradoxoff
Posts: 1634
Joined: Sat Feb 17, 2007 1:51 pm

Re: Borders of Category Markers

Post by paradoxoff » Wed Nov 29, 2017 10:09 am

chrisTr wrote:If I don't use the 3D BarRenderer, is it possible to change the width of the markers that it has the same width like the areas without marker?
A CategoryMarker will either be drawn as a line or as a rectangle, depending on the return value of getDrawAsLine(). The rectangle will cover the entire space of a category. All categories have the same widths by default. There is no difference between categories with and without markers.

chrisTr
Posts: 5
Joined: Mon Nov 27, 2017 5:09 pm
antibot: No, of course not.

Re: Borders of Category Markers

Post by chrisTr » Wed Nov 29, 2017 11:22 am

Ok. I thought about if it could be possible to make the CategoryMarker wider than the category itself. But that's only possible if I change the source code for drawing the domain marker or?

paradoxoff
Posts: 1634
Joined: Sat Feb 17, 2007 1:51 pm

Re: Borders of Category Markers

Post by paradoxoff » Wed Nov 29, 2017 12:57 pm

Alternatively, you can write a custom CategoryAnnotation that is doing the job. IN this way, you do not have to change the source code of JFreeChart.
Some time ago, I have written a set of annotations that can serve as marker replacements. Here is a link to the forum thread, where you will find a link to the patch.

chrisTr
Posts: 5
Joined: Mon Nov 27, 2017 5:09 pm
antibot: No, of course not.

Re: Borders of Category Markers

Post by chrisTr » Wed Nov 29, 2017 2:56 pm

I will look at it. Thank you for this information.

Locked