{"action":"created","issue":{"url":"https://api.github.com/repos/PhilJay/MPAndroidChart/issues/3856","repository_url":"https://api.github.com/repos/PhilJay/MPAndroidChart","labels_url":"https://api.github.com/repos/PhilJay/MPAndroidChart/issues/3856/labels{/name}","comments_url":"https://api.github.com/repos/PhilJay/MPAndroidChart/issues/3856/comments","events_url":"https://api.github.com/repos/PhilJay/MPAndroidChart/issues/3856/events","html_url":"https://github.com/PhilJay/MPAndroidChart/issues/3856","id":304078618,"number":3856,"title":"IndexOutOfBoundsException when animating barChart","user":{"login":"santi8194","id":4406788,"avatar_url":"https://avatars2.githubusercontent.com/u/4406788?v=4","gravatar_id":"","url":"https://api.github.com/users/santi8194","html_url":"https://github.com/santi8194","followers_url":"https://api.github.com/users/santi8194/followers","following_url":"https://api.github.com/users/santi8194/following{/other_user}","gists_url":"https://api.github.com/users/santi8194/gists{/gist_id}","starred_url":"https://api.github.com/users/santi8194/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/santi8194/subscriptions","organizations_url":"https://api.github.com/users/santi8194/orgs","repos_url":"https://api.github.com/users/santi8194/repos","events_url":"https://api.github.com/users/santi8194/events{/privacy}","received_events_url":"https://api.github.com/users/santi8194/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-10T15:25:53Z","updated_at":"2018-04-02T07:47:30Z","closed_at":null,"author_association":"NONE","body":"I get an IndexOutOfBoundsException when I animate the barchart with \r\n`chart.animateXY(500,500, Easing.EasingOption.EaseOutBack, Easing.EasingOption.EaseOutBack);`\r\n\r\nif I comment out the line\r\n`chart.animateXY(500,500, Easing.EasingOption.EaseOutBack, Easing.EasingOption.EaseOutBack);`\r\nno error occurs\r\n\r\nThis is the first view lines of the error message:\r\n`\tFATAL EXCEPTION: main\r\n\tProcess: sikon.dito.co.sikonapp, PID: 2046\r\n\tjava.lang.IndexOutOfBoundsException: Index: 6, Size: 6\r\n\t  at java.util.ArrayList.get(ArrayList.java:411)\r\n\t  at com.github.mikephil.charting.data.DataSet.getEntryForIndex(DataSet.java:286)\r\n\t  at com.github.mikephil.charting.buffer.BarBuffer.feed(BarBuffer.java:51)\r\n\t  at com.github.mikephil.charting.renderer.BarChartRenderer.drawDataSet(BarChartRenderer.java:142)\r\n\t  at com.github.mikephil.charting.renderer.BarChartRenderer.drawData(BarChartRenderer.java:80)\r\n\t  at com.github.mikephil.charting.charts.BarLineChartBase.onDraw(BarLineChartBase.java:232)`\r\n\r\nThis is my code:\r\n\r\n    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\r\n\r\n        .\r\n        .\r\n        .\r\n\r\n        chart = (BarChart) view.findViewById(R.id.chart_evolucion_activacion);\r\n\r\n        styleBarChart(chart);\r\n        generateChartDummyData();\r\n\r\n        return view;\r\n    }\r\n\r\n    private void styleBarChart(final BarChart chart) {\r\n        chart.getAxisRight().setEnabled(false);\r\n        chart.getXAxis().setEnabled(false);\r\n        chart.getDescription().setEnabled(false);\r\n        chart.getLegend().setEnabled(false);\r\n        chart.setHighlightPerTapEnabled(false);\r\n        chart.setHighlightPerDragEnabled(false);\r\n        chart.setNoDataText(\"No hay datos\");\r\n        chart.setDrawGridBackground(false);\r\n        chart.setNoDataTextColor(App.getContext().getResources().getColor(R.color.color_principal_dark));\r\n\r\n        chart.animateXY(500,500, Easing.EasingOption.EaseOutBack, Easing.EasingOption.EaseOutBack);\r\n\r\n        YAxis left = chart.getAxisLeft();\r\n        left.setAxisLineWidth(0);\r\n        left.setTextColor(App.getContext().getResources().getColor(R.color.color_principal_dark));\r\n        left.setDrawGridLines(false);\r\n        left.setValueFormatter(new LargeValueFormatter());\r\n    }\r\n\r\n    public void generateChartDummyData() {\r\n\r\n        List<BarEntry> entries1 = new ArrayList<BarEntry>();\r\n\r\n        for (int i = 0; i < 6; i++) {\r\n            switch (i) {\r\n                case 0:\r\n                    entries1.add(new BarEntry(i, 15600));\r\n                    break;\r\n                case 1:\r\n                    entries1.add(new BarEntry(i, 11700));\r\n                    break;\r\n                case 2:\r\n                    entries1.add(new BarEntry(i, 17800));\r\n                    break;\r\n                case 3:\r\n                    entries1.add(new BarEntry(i, 18200));\r\n                    break;\r\n                case 4:\r\n                    entries1.add(new BarEntry(i, 17900));\r\n                    break;\r\n                case 5:\r\n                    entries1.add(new BarEntry(i, 17000));\r\n                    break;\r\n            }\r\n        }\r\n\r\n        setChartData(entries1);\r\n    }\r\n\r\n    public void setChartData(List<BarEntry> entries) {\r\n        BarDataSet set = new BarDataSet(entries, \"BarDataSet\");\r\n        set.setColor(App.getContext().getResources().getColor(R.color.color_principal_dark));\r\n\r\n        BarData lineData = new BarData(set);\r\n        lineData.setValueTextColor(App.getContext().getResources().getColor(R.color.color_principal_dark));\r\n        lineData.setValueFormatter(new LargeValueFormatter());\r\n        \r\n        chart_evolucion_activacion.setData(lineData);\r\n        chart_evolucion_activacion.invalidate();\r\n    }"},"comment":{"url":"https://api.github.com/repos/PhilJay/MPAndroidChart/issues/comments/377877456","html_url":"https://github.com/PhilJay/MPAndroidChart/issues/3856#issuecomment-377877456","issue_url":"https://api.github.com/repos/PhilJay/MPAndroidChart/issues/3856","id":377877456,"user":{"login":"MGaetan89","id":1009664,"avatar_url":"https://avatars3.githubusercontent.com/u/1009664?v=4","gravatar_id":"","url":"https://api.github.com/users/MGaetan89","html_url":"https://github.com/MGaetan89","followers_url":"https://api.github.com/users/MGaetan89/followers","following_url":"https://api.github.com/users/MGaetan89/following{/other_user}","gists_url":"https://api.github.com/users/MGaetan89/gists{/gist_id}","starred_url":"https://api.github.com/users/MGaetan89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MGaetan89/subscriptions","organizations_url":"https://api.github.com/users/MGaetan89/orgs","repos_url":"https://api.github.com/users/MGaetan89/repos","events_url":"https://api.github.com/users/MGaetan89/events{/privacy}","received_events_url":"https://api.github.com/users/MGaetan89/received_events","type":"User","site_admin":false},"created_at":"2018-04-02T07:47:30Z","updated_at":"2018-04-02T07:47:30Z","author_association":"NONE","body":"The crash was already reporting in #2952.\r\nHave you tried setting the data before trying to animate the chart?"}}
{"actor":{"display_login":"MGaetan89"}}