Hi
I would like to use the GroupedStackedBarRenderer() renderer for the chart I'm working on. Here's what it looks like so far:
My client wants the bars to be flatter as in the old legacy verison of jFree and also in the following demo:
I have tried both of the following which did not work
renderer.setBarPainter(new StandardBarPainter());
and als0
ChartTheme legacy = StandardChartTheme.createLegacyTheme();
ChartFactory.setChartTheme(legacy);
Ideas?
Thanks
Elliot
StandardBarPainter
-
- Posts: 45
- Joined: Thu Jun 26, 2014 8:24 am
- antibot: No, of course not.
- Location: Germany, Aachen
Re: StandardBarPainter
hey,
mabye a silly idea, but why don´t you just squeeze the Y-Axis? So only difference between these two charts I see, is that the second one is way smaller in the Y-Axis and larger in the X-Axis.
Or do I misunderstand you?
Greetings Tobi
mabye a silly idea, but why don´t you just squeeze the Y-Axis? So only difference between these two charts I see, is that the second one is way smaller in the Y-Axis and larger in the X-Axis.
Or do I misunderstand you?
Greetings Tobi
Re: StandardBarPainter
Hi Tobi
Thanks for the idea but I don't think it's going to help.
The difference as far as I can tell is that there really is a gradient in the bar color going from a more intense hue towards a lighter shade in the first image; this is not present in the second image.
This gives the illusion that the surface is rounded and reflecting some light. It uses a "GradientBarPainter"
Elliot
Thanks for the idea but I don't think it's going to help.
The difference as far as I can tell is that there really is a gradient in the bar color going from a more intense hue towards a lighter shade in the first image; this is not present in the second image.
This gives the illusion that the surface is rounded and reflecting some light. It uses a "GradientBarPainter"
Elliot
Re: StandardBarPainter
I found a really good post which gave me the answer.
http://stackoverflow.com/questions/7076 ... 67#7092567
I changed
plot.getRenderer()).setBarPainter(new StandardBarPainter();
to
((BarRenderer) plot.getRenderer()).setBarPainter(new StandardBarPainter());
The last required a new import:
import org.jfree.chart.renderer.category.BarRenderer;
I would love someone to explain the difference between the two statements which look the same but obviously the cast to BarRenderer was important.
This gave me an image with a vertical rather than horizontal gradient:
I then removed the following which I hadn't noticed before
renderer.setGradientPaintTransformer(
new StandardGradientPaintTransformer(
GradientPaintTransformType.HORIZONTAL));
and changed it to this:
renderer.setGradientPaintTransformer(null);
The final image looks flat ( which I think is really boring but that's what the client wants LOL ):
E.
http://stackoverflow.com/questions/7076 ... 67#7092567
I changed
plot.getRenderer()).setBarPainter(new StandardBarPainter();
to
((BarRenderer) plot.getRenderer()).setBarPainter(new StandardBarPainter());
The last required a new import:
import org.jfree.chart.renderer.category.BarRenderer;
I would love someone to explain the difference between the two statements which look the same but obviously the cast to BarRenderer was important.
This gave me an image with a vertical rather than horizontal gradient:
I then removed the following which I hadn't noticed before
renderer.setGradientPaintTransformer(
new StandardGradientPaintTransformer(
GradientPaintTransformType.HORIZONTAL));
and changed it to this:
renderer.setGradientPaintTransformer(null);
The final image looks flat ( which I think is really boring but that's what the client wants LOL ):
E.
-
- Posts: 45
- Joined: Thu Jun 26, 2014 8:24 am
- antibot: No, of course not.
- Location: Germany, Aachen
Re: StandardBarPainter
Oh well, sorry that i misunderstood your question. I could have told you that earlier than how that works. But great that you found it yourself.
Greetings
Greetings