{"action":"created","issue":{"url":"https://api.github.com/repos/PhilJay/MPAndroidChart/issues/1458","repository_url":"https://api.github.com/repos/PhilJay/MPAndroidChart","labels_url":"https://api.github.com/repos/PhilJay/MPAndroidChart/issues/1458/labels{/name}","comments_url":"https://api.github.com/repos/PhilJay/MPAndroidChart/issues/1458/comments","events_url":"https://api.github.com/repos/PhilJay/MPAndroidChart/issues/1458/events","html_url":"https://github.com/PhilJay/MPAndroidChart/issues/1458","id":132613583,"number":1458,"title":"Showing BarData set in combine chart","user":{"login":"jatindersi","id":17155287,"avatar_url":"https://avatars.githubusercontent.com/u/17155287?v=3","gravatar_id":"","url":"https://api.github.com/users/jatindersi","html_url":"https://github.com/jatindersi","followers_url":"https://api.github.com/users/jatindersi/followers","following_url":"https://api.github.com/users/jatindersi/following{/other_user}","gists_url":"https://api.github.com/users/jatindersi/gists{/gist_id}","starred_url":"https://api.github.com/users/jatindersi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jatindersi/subscriptions","organizations_url":"https://api.github.com/users/jatindersi/orgs","repos_url":"https://api.github.com/users/jatindersi/repos","events_url":"https://api.github.com/users/jatindersi/events{/privacy}","received_events_url":"https://api.github.com/users/jatindersi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-10T05:56:25Z","updated_at":"2016-02-10T08:59:47Z","closed_at":null,"body":"I am trying to combine multiple charts together. Its working fine in case of linedataset. But as i try to add bardata in combinechart  the chart is cutting  from edges its not displaying all bardataset values in chart please let me know where i need modification so that it will work in bardataset in combinechart"},"comment":{"url":"https://api.github.com/repos/PhilJay/MPAndroidChart/issues/comments/182261701","html_url":"https://github.com/PhilJay/MPAndroidChart/issues/1458#issuecomment-182261701","issue_url":"https://api.github.com/repos/PhilJay/MPAndroidChart/issues/1458","id":182261701,"user":{"login":"jatindersi","id":17155287,"avatar_url":"https://avatars.githubusercontent.com/u/17155287?v=3","gravatar_id":"","url":"https://api.github.com/users/jatindersi","html_url":"https://github.com/jatindersi","followers_url":"https://api.github.com/users/jatindersi/followers","following_url":"https://api.github.com/users/jatindersi/following{/other_user}","gists_url":"https://api.github.com/users/jatindersi/gists{/gist_id}","starred_url":"https://api.github.com/users/jatindersi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jatindersi/subscriptions","organizations_url":"https://api.github.com/users/jatindersi/orgs","repos_url":"https://api.github.com/users/jatindersi/repos","events_url":"https://api.github.com/users/jatindersi/events{/privacy}","received_events_url":"https://api.github.com/users/jatindersi/received_events","type":"User","site_admin":false},"created_at":"2016-02-10T08:59:47Z","updated_at":"2016-02-10T08:59:47Z","body":" private void setUpCombineBarChart()\r\n    {\r\n        Chart = new CombinedChart(getActivity());\r\n        Chart.setDescription(\"\");\r\n        Chart.setNoDataTextDescription(\"No Chart Data Available.\");\r\n        Chart.setBackgroundColor(Color.WHITE);\r\n        Chart.setDrawGridBackground(false);\r\n        Chart.setDrawBarShadow(false);\r\n        Chart.getLegend().setEnabled(false);\r\n\r\n\r\n        // draw bars behind lines\r\n        Chart.setDrawOrder(new CombinedChart.DrawOrder[]{\r\n                CombinedChart.DrawOrder.BAR, CombinedChart.DrawOrder.BUBBLE, CombinedChart.DrawOrder.CANDLE, CombinedChart.DrawOrder.LINE, CombinedChart.DrawOrder.SCATTER\r\n        });\r\n        MyMarkerView mv = new MyMarkerView(getActivity(), R.layout.custom_marker_view);\r\n        Chart.setMarkerView(mv);\r\n        YAxis rightAxis = Chart.getAxisRight();\r\n        rightAxis.setDrawGridLines(false);\r\n        rightAxis.setDrawLabels(false);\r\n        rightAxis.setEnabled(false);\r\n\r\n        YAxis leftAxis = Chart.getAxisLeft();\r\n        leftAxis.setValueFormatter(new LargeValueFormatter());\r\n        leftAxis.setDrawGridLines(false);\r\n        leftAxis.setSpaceTop(30f);\r\n\r\n        XAxis xAxis = Chart.getXAxis();\r\n        xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);\r\n        xAxis.setEnabled(true);\r\n        xAxis.setLabelRotationAngle(45);\r\n        xAxis.setSpaceBetweenLabels(0);\r\n        xAxis.setTextSize(9);\r\n\r\n        ArrayList<String> xVals = null;\r\n        ArrayList<Entry> yVals = null;\r\n        ArrayList<BarEntry> yValsBar = null;\r\n        ArrayList<ILineDataSet> dataSets = new ArrayList<ILineDataSet>();\r\n        ArrayList<IBarDataSet> dataSetsBar = new ArrayList<IBarDataSet>();\r\n        String setvalue = \"\";\r\n        if (Util.isEngLocale())\r\n        {\r\n            CombinedData data = null;\r\n            for (int j = 0; j < ChartGlobal.chartList.size(); j++)\r\n            {\r\n\r\n                if (ChartGlobal.chartList.get(j).isSelected())\r\n                {\r\n\r\n                    xVals = new ArrayList<>();\r\n                    yVals = new ArrayList<>();\r\n                    yValsBar = new ArrayList<>();\r\n\r\n                    for (int i = 0; i < ChartGlobal.chartList.get(j).valuesEn.size(); i++)\r\n                    {\r\n                        xVals.add(ChartGlobal.chartList.get(j).valuesEn.get(i).valueX);\r\n                        float val = Float.parseFloat(ChartGlobal.chartList.get(j).valuesEn.get(i).valueY);\r\n                        yVals.add(new Entry(val, i));\r\n                        yValsBar.add(new BarEntry(val, i));\r\n                        setvalue = ChartGlobal.chartList.get(j).nameEn;\r\n                        if (data == null)\r\n                            data = new CombinedData(xVals);\r\n//                        if (ChartGlobal.chartList.get(j).display.equalsIgnoreCase(\"line\"))\r\n//                        {\r\n//                            data.setData(generateLineData(yVals, setvalue, j));\r\n//                        }\r\n//                        else if (ChartGlobal.chartList.get(j).display.equalsIgnoreCase(\"column\"))\r\n//                        {\r\n//                            data.setData(generateBarData(yValsBar, setvalue, j));\r\n//                        }\r\n//                        Chart.setData(data);\r\n                    }\r\n                    if(ChartGlobal.chartList.get(j).valuesEn.size()>0)\r\n                    {\r\n                        if (ChartGlobal.chartList.get(j).display.equalsIgnoreCase(\"line\"))\r\n                        {\r\n                            LineDataSet d = new LineDataSet(yVals, \"\");\r\n                            d.setLineWidth(2.5f);\r\n                            d.setCircleSize(4f);\r\n                            int totalYAxis = 0;\r\n                            String title = \"\";\r\n                            for (int i = 0; i < ChartGlobal.chartList.get(j).valuesEn.size(); i++)\r\n                            {\r\n                                if (ChartViewActivity.isInteger(ChartGlobal.chartList.get(j).valuesEn.get(i).valueY))\r\n                                {\r\n                                    totalYAxis = totalYAxis + Integer.parseInt(ChartGlobal.chartList.get(j).valuesEn.get(i).valueY);\r\n                                }\r\n                            }\r\n                            title = totalYAxis + \"\\n\" + ChartGlobal.chartList.get(j).nameEn;\r\n                            d.setLabel(title);\r\n                            d.setValueTextSize(15f);\r\n                            d.setColor((ColorTemplate.rgb(ChartGlobal.chartList.get(j).rgbColor)));\r\n                            d.setCircleColor((ColorTemplate.rgb(ChartGlobal.chartList.get(j).rgbColor)));\r\n                            dataSets.add(d);\r\n                            LineData datavalue = new LineData(xVals, dataSets);\r\n                            data.setData(datavalue);\r\n                            Chart.setData(data);\r\n                            //Chart.invalidate();\r\n                        }\r\n                        else if (ChartGlobal.chartList.get(j).display.equalsIgnoreCase(\"column\"))\r\n                        {\r\n                             BarDataSet barset = new BarDataSet(yValsBar,\"\");\r\n                             //barset.setBarSpacePercent(30f);\r\n\r\n                            barset.setColor((ColorTemplate.rgb(ChartGlobal.chartList.get(j).rgbColor)));\r\n                            int totalYAxis = 0;\r\n                            String title = \"\";\r\n                            for (int i = 0; i < ChartGlobal.chartList.get(j).valuesEn.size(); i++)\r\n                            {\r\n                                if (ChartViewActivity.isInteger(ChartGlobal.chartList.get(j).valuesEn.get(i).valueY))\r\n                                {\r\n                                    totalYAxis = totalYAxis + Integer.parseInt(ChartGlobal.chartList.get(j).valuesEn.get(i).valueY);\r\n                                }\r\n                            }\r\n                            title = totalYAxis + \"\\n\" + ChartGlobal.chartList.get(j).nameEn;\r\n                            barset.setLabel(title);\r\n                            barset.setValueTextSize(15.0f);\r\n                            dataSetsBar.add(barset);\r\n                            BarData dataBar = new BarData(xVals, dataSetsBar);\r\n                            dataBar.setValueFormatter(new LargeValueFormatter());\r\n                            // add space between the dataset groups in percent of bar-width\r\n                            // dataBar.setGroupSpace(100f);\r\n                            //  data.setValueTypeface(tf);\r\n\r\n                            data.setData(dataBar);\r\n                            Chart.setData(data);\r\n                            //  Chart.invalidate();\r\n                        }\r\n                    }\r\n                    if (xVals.size() > 3)\r\n                    {\r\n                        Chart.setDragEnabled(true); // on by default\r\n                       // Chart.setVisibleXRange(5f, 15f);\r\n                    }\r\n                }\r\n            }\r\n\r\n        } else\r\n        {\r\n            CombinedData data = null;\r\n            for (int j = 0; j < ChartGlobal.chartList.size(); j++)\r\n            {\r\n\r\n                if (ChartGlobal.chartList.get(j).isSelected())\r\n                {\r\n\r\n                    xVals = new ArrayList<>();\r\n                    yVals = new ArrayList<>();\r\n                    yValsBar = new ArrayList<>();\r\n\r\n                    for (int i = 0; i < ChartGlobal.chartList.get(j).valuesAr.size(); i++)\r\n                    {\r\n                        xVals.add(ChartGlobal.chartList.get(j).valuesAr.get(i).valueX);\r\n                        float val = Float.parseFloat(ChartGlobal.chartList.get(j).valuesAr.get(i).valueY);\r\n                        yVals.add(new Entry(val, i));\r\n                        yValsBar.add(new BarEntry(val, i));\r\n                        setvalue = ChartGlobal.chartList.get(j).nameAr;\r\n                        if (data == null)\r\n                            data = new CombinedData(xVals);\r\n//                        if (ChartGlobal.chartList.get(j).display.equalsIgnoreCase(\"line\"))\r\n//                        {\r\n//                            data.setData(generateLineData(yVals, setvalue, j));\r\n//                        } else if (ChartGlobal.chartList.get(j).display.equalsIgnoreCase(\"column\"))\r\n//                        {\r\n//                            data.setData(generateBarData(yValsBar, setvalue, j));\r\n//                        }\r\n//                        Chart.setData(data);\r\n                    }\r\n                    if(ChartGlobal.chartList.get(j).valuesAr.size()>0)\r\n                    {\r\n                        if (ChartGlobal.chartList.get(j).display.equalsIgnoreCase(\"line\"))\r\n                        {\r\n                            LineDataSet d = new LineDataSet(yVals, \"\");\r\n                            d.setLineWidth(2.5f);\r\n                            d.setCircleSize(4f);\r\n                            int totalYAxis = 0;\r\n                            String title = \"\";\r\n                            for (int i = 0; i < ChartGlobal.chartList.get(j).valuesAr.size(); i++)\r\n                            {\r\n                                if (ChartViewActivity.isInteger(ChartGlobal.chartList.get(j).valuesAr.get(i).valueY))\r\n                                {\r\n                                    totalYAxis = totalYAxis + Integer.parseInt(ChartGlobal.chartList.get(j).valuesAr.get(i).valueY);\r\n                                }\r\n                            }\r\n                            title = totalYAxis + \"\\n\" + ChartGlobal.chartList.get(j).nameAr;\r\n                            d.setLabel(title);\r\n                            d.setValueTextSize(15.0f);\r\n                            d.setColor((ColorTemplate.rgb(ChartGlobal.chartList.get(j).rgbColor)));\r\n                            d.setCircleColor((ColorTemplate.rgb(ChartGlobal.chartList.get(j).rgbColor)));\r\n                            dataSets.add(d);\r\n                            LineData datavalue = new LineData(xVals, dataSets);\r\n                            data.setData(datavalue);\r\n                            Chart.setData(data);\r\n                           // Chart.invalidate();\r\n                        } else if (ChartGlobal.chartList.get(j).display.equalsIgnoreCase(\"column\"))\r\n\r\n                        {\r\n                            BarDataSet barset = new BarDataSet(yValsBar, \"\");\r\n                          //  barset.setBarSpacePercent(60f);\r\n                            int totalYAxis = 0;\r\n                            String title = \"\";\r\n                            for (int i = 0; i < ChartGlobal.chartList.get(j).valuesAr.size(); i++)\r\n                            {\r\n                                if (ChartViewActivity.isInteger(ChartGlobal.chartList.get(j).valuesAr.get(i).valueY))\r\n                                {\r\n                                    totalYAxis = totalYAxis + Integer.parseInt(ChartGlobal.chartList.get(j).valuesAr.get(i).valueY);\r\n                                }\r\n                            }\r\n                            title = totalYAxis + \"\\n\" + ChartGlobal.chartList.get(j).nameAr;\r\n                            barset.setLabel(title);\r\n                            barset.setValueTextSize(15.0f);\r\n                            barset.setColor((ColorTemplate.rgb(ChartGlobal.chartList.get(j).rgbColor)));\r\n                            dataSetsBar.add(barset);\r\n                            BarData dataBar = new BarData(xVals, dataSetsBar);\r\n\r\n//        data.setValueFormatter(new LargeValueFormatter());\r\n\r\n                            // add space between the dataset groups in percent of bar-width\r\n                            dataBar.setGroupSpace(80f);\r\n                            //  data.setValueTypeface(tf);\r\n                            data.setData(dataBar);\r\n                            Chart.setData(data);\r\n                            // Chart.invalidate();\r\n                        }\r\n                    }\r\n                if(xVals.size()>3)\r\n                {\r\n                    Chart.setDragEnabled(true); // on by default\r\n                    //Chart.setVisibleXRange(5f,15f);\r\n                }\r\n                }\r\n            }\r\n\r\n        }\r\n\r\n\r\n        Chart.invalidate();\r\n        mparentchartcontainer.addView(Chart);\r\n\r\n\r\n    }\r\n\r\n****This is the code that i am using  its working fine in case of LIneDataset but in case of bardataset i am not getting proper display of result i modified Combinechart calcminmax() Method and it show all bar values but below labels are still not ok**"}}