AnyChart-Android icon indicating copy to clipboard operation
AnyChart-Android copied to clipboard

Pie charts stopped loading all of a sudden!!

Open mathuadi3 opened this issue 5 years ago • 1 comments

I have been using anycharts for 6-7 months now. Things were working fine. But suddenly the charts completely stopped loading. There has been no change in the code.

private void getPieChart() {
        APIlib.getInstance().setActiveAnyChartView(ns_PieChart);
        Pie pie = AnyChart.pie();

        pie.tooltip()
                .displayMode(TooltipDisplayMode.UNION)
                .format("No. of Activities : {%Value} ");

        ArrayList<Integer> flagArray = new ArrayList<>();
        ArrayList<DataEntry> group = new ArrayList<>();
        for (String programGroup : programGroupSpinner_List) {
            int flag = 0;
            for (ActivityData activityData : activityList) {
                if (activityData.getProgramGroup().equalsIgnoreCase(programGroup) &&
                        activityData.getStatusId().equalsIgnoreCase("1")) {
                    flag = flag + 1;
                }
            }
            flagArray.add(flag);
            group.add(new ValueDataEntry(programGroup, flag));
        }
        int b = 0;
        for (int a = 0; a < group.size(); a++) {
            if (flagArray.get(a) != 0) {
                b++;
            }
        }
        if (b == 0) {
            ns_no_text.setVisibility(View.VISIBLE);
            ns_PieChart.setVisibility(GONE);
        } else {
            pie.data(group);
            pie.animation(true);
            pie.legend().enabled(false);
            ns_PieChart.setChart(pie);
        }
    }

I have debugged my code too, there seems to be no error. Just the anychart stopped loading. Also, Is there any limit to the number of data being fed to anychart, ie. my ProgramGroupList has around 200 elements. NEED HELP! THANKS! Screenshot_1588853205

mathuadi3 avatar May 08 '20 07:05 mathuadi3

@mathuadi3 This period of time didn't update the library, there were no changes. The number of points is limited only by hardware and browser resources. 200 points is not a problem for a pie chart. Try to clean the project and rebuild it.

Shestac92 avatar May 08 '20 09:05 Shestac92