How To Partially Fill The Bars in BarChart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
dj_cynical
Posts: 2
Joined: Tue Sep 04, 2018 11:54 am
antibot: No, of course not.

How To Partially Fill The Bars in BarChart

Post by dj_cynical » Tue Sep 04, 2018 11:59 am

Hi,

I have created a bar chart with 5 bars. By default all bars would be 100%. The bars would be by default white in colour with black outline. Now I want to fill the bars with GRAY colour partially (% wise) depending on the dataset value. For e.g - If the dataset value passed is 30 then the first bar would be filled with gray colour for 30% of it. Same is for other four bars. All will partially fill depending on the dataset value.

Is it possible in JFreeChart.

Please help as I am in a fix now.

Regards
-DJ

John Matthews
Posts: 513
Joined: Wed Sep 12, 2007 3:18 pm

Re: How To Partially Fill The Bars in BarChart

Post by John Matthews » Tue Sep 04, 2018 4:42 pm

You might try a stacked bar chart; StackedBarChartDemo7 in the gallery looks relevant.

Locked