Range zero baseline obscured by bars

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
FreeRadical
Posts: 2
Joined: Mon Nov 07, 2016 8:43 pm
antibot: No, of course not.

Range zero baseline obscured by bars

Post by FreeRadical » Mon Nov 07, 2016 8:51 pm

Hello,

I am setting CategoryPlot.setRangeZeroBaselineVisible(true), but the bars on the chart overwrite the line. This doesn't occur on charts with only one series. Does anyone know why that would occur? Thank you. I'm using 1.0.19.

I was hoping to attach a small screenshot (56K), but I don't see the ability to do that.

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

Re: Range zero baseline obscured by bars

Post by paradoxoff » Tue Nov 08, 2016 10:34 am

FreeRadical wrote: I am setting CategoryPlot.setRangeZeroBaselineVisible(true), but the bars on the chart overwrite the line. This doesn't occur on charts with only one series. Does anyone know why that would occur?
A CategoryPlot always renders the grid lines (and the zero baselines) first and then the bars, so I do not see why the number of series should make a difference.
FreeRadical wrote:I was hoping to attach a small screenshot (56K), but I don't see the ability to do that.
See here.
The linked thread should either appear in the FAQ section or be made sticky.

FreeRadical
Posts: 2
Joined: Mon Nov 07, 2016 8:43 pm
antibot: No, of course not.

Re: Range zero baseline obscured by bars

Post by FreeRadical » Tue Nov 08, 2016 4:15 pm

paradoxoff, thank you for the reply. It looks like I can't change this unless I modify the code so I will give up on displaying the zero baseline.

The reason I was motivated to do it is the gap between the bottom of the bars and the x-axis line with the ticks on it. That looks bad to me. And I don't want to use the border around the chart because there is no option to turn off the sides you don't want to display.

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

Re: Range zero baseline obscured by bars

Post by paradoxoff » Wed Nov 09, 2016 9:27 am

If all you need is a line drawn a y=0, then you could simply use a ValueMarker and add that as rangeMarker to the plot.
If you want to hide parts of the axis (i. e. the axis line and tick marks but not the axis label and the tick labels), then you can use a transparent paint.

Locked