How to make a CombinedChart have two different scales on MPAndroidChart?

Viewed 2415

I have a CombinedChart and I would like that LineChart will take left axis as reference and BarChart will take right axis as reference but I could not get it out.

I am trying the following code:

barDataSet.setAxisDependency(YAxis.AxisDependency.RIGHT);
lineDataSet.setAxisDependency(YAxis.AxisDependency.LEFT);

but now both charts (LineChart and BarChart) are on the left (mixing them and right axis have disappeared).

Left and right axis have different granularity.

How can I properly make that each chart takes as reference one different Y axis (left or right respectively)?

Thanks in advance!

1 Answers
Related