AnyChart / AnyChart-Android

AnyChart Android Chart is an amazing data visualization library for easily creating interactive charts in Android apps. It runs on API 19+ (Android 4.4) and features dozens of built-in chart types.
2.31k stars 369 forks source link

Pie charts stopped loading all of a sudden!! #166

Open mathuadi3 opened 4 years ago

mathuadi3 commented 4 years ago

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

Shestac92 commented 4 years ago

@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.