MPAndroidChart icon indicating copy to clipboard operation
MPAndroidChart copied to clipboard

Limit Line is not showing at correct position in Horizontal Bar Chart when there is single entry but works well for multiple entries

Open LionsRepoVerse opened this issue 7 years ago • 0 comments

Please check the screenshots for more details

Single Record Single Record

Multiple Record Multiple Records

According to the code, the limit line should be shown on max value, but later I wish to apply it at the average value of all records

Code Snippet LimitLine ll1 = new LimitLine((int) maxAmount, context.getString(R.string.lbl_chart_average)); ll1.setLineWidth(1f); ll1.enableDashedLine(10f, 10f, 0f); ll1.setLabelPosition(LimitLine.LimitLabelPosition.RIGHT_TOP); ll1.setTextSize(10f); ll1.setTextColor(context.getResources().getColor(R.color.theme_secondary)); ll1.setLineColor(context.getResources().getColor(R.color.theme_secondary)); ll1.setTypeface(Utilities.getInstance().getFontTypeFace(context, R.font.roboto_medium)); ll1.setLabelPosition(LimitLine.LimitLabelPosition.RIGHT_BOTTOM); YAxis leftAxis = horizontalBarChart.getAxisLeft(); leftAxis.removeAllLimitLines(); leftAxis.addLimitLine(ll1);

Also the Left Axis (TOP) is not showing all labels even after being set as 4 Code Snippet for the same horizontalBarChart.getAxisLeft().setLabelCount(4, true);

LionsRepoVerse avatar Nov 13 '19 06:11 LionsRepoVerse