I am working in project in project that needs implement chart , I decide use MPAndroidChart its work just fine but I need some things done to be perfect to me
First can I change bars to specific image or it takes just images , as I have 3D image as bars in app design .
Second Can I put the legend to the right of chart in two line like image below and change legend text color
my java code
mChart = (BarChart) view.findViewById(R.id.chart);
mChart.setDescription("");
Legend mLegend = mChart.getLegend();
//mLegend.setPosition(Legend.LegendPosition.RIGHT_OF_CHART_CENTER);
FillBarChart(mChart);
}
private void FillBarChart(BarChart barChart) {
ArrayList<BarEntry> entries = new ArrayList<>();
entries.add(new BarEntry(87f, 0));
entries.add(new BarEntry(90f, 1));
ArrayList<String> labels = new ArrayList<>();
labels.add("Omeprazole 20 mg");
labels.add("Esomeprazole 40 mg");
BarDataSet dataSet = new BarDataSet(entries, " ");
dataSet.setBarSpacePercent(40f);
BarData barData = new BarData(labels, dataSet);
dataSet.setColors(new int[]{R.color.omeprazole_color , R.color.esomeprazole_color} , getActivity());
barChart.setData(barData);
barChart.animateY(3000 , Easing.EasingOption.EaseOutBack );
}
