stacked bar chart with line chart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
BO
Posts: 61
Joined: Wed Mar 01, 2006 2:17 pm

stacked bar chart with line chart

Post by BO » Mon Jun 30, 2014 10:37 am

Hi
please tell me how cound i make the following chart
Image

- only range axis on the left (no range axis on the right)
- i can't use the marker for the line because it isn't horizontal :(
- i looked the DualAxisDemo1 but it has the secondary axis

thanks a lot

carulla
Posts: 4
Joined: Tue May 20, 2014 8:56 am
antibot: No, of course not.

Re: stacked bar chart with line chart

Post by carulla » Mon Jun 30, 2014 12:13 pm

Hi, you can use

Code: Select all

plot.mapDatasetToRangeAxis(indexDataset, indexPlot);


to force two datasets to use the same axis. Hope it helps you.

BO
Posts: 61
Joined: Wed Mar 01, 2006 2:17 pm

Re: stacked bar chart with line chart

Post by BO » Mon Jun 30, 2014 3:13 pm

it is OK for range axis
but not for domain axis (tried with categoryplot.mapDatasetToDomainAxis(1, 0);)

as you see on the above chart, i have 2 lines:
- line1 : from XY(16,12) to (29,12) and up to (30,15) and pass to (66,15)
- line2 : from XY(16,18) to (29,18) and up to (30,25) and pass to (66,25)

how could I use the same domain axis for those 2 lines?
thanks

edit:
here is my chart actually
Image

BO
Posts: 61
Joined: Wed Mar 01, 2006 2:17 pm

Re: stacked bar chart with line chart

Post by BO » Tue Jul 01, 2014 12:11 pm

got solution with createStackedXYAreaChart
(bad idea with StackedBarChart)

Locked