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

Charts are not displaying

Open cigrastudio-dev opened this issue 3 years ago • 8 comments

Charts are not displaying at all. Only the watermark is shown at the bottom of the screen. Below is my code Activity.xml

<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".AnalyticsFragment">

<com.anychart.AnyChartView
    android:id="@+id/pie_chart"
    android:layout_width="match_parent"
    android:layout_height="match_parent"/>

</androidx.constraintlayout.widget.ConstraintLayout>

AnalyticsFragment.java public class AnalyticsFragment extends Fragment {

ArrayList pieEntries;

public AnalyticsFragment() {
    // Required empty public constructor
}



@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {

    View view = inflater.inflate(R.layout.fragment_analytics2, container, false);


    Pie pie = AnyChart.pie();

    List<DataEntry> data = new ArrayList<>();
    data.add(new ValueDataEntry("John", 10000));
    data.add(new ValueDataEntry("Jake", 12000));
    data.add(new ValueDataEntry("Peter", 18000));

    pie.data(data);

    AnyChartView anyChartView = (AnyChartView) view.findViewById(R.id.pie_chart);
    anyChartView.setChart(pie);

return view; }

cigrastudio-dev avatar Mar 16 '22 11:03 cigrastudio-dev

@SheroXee Unforutnately, we do not support Fragment. The only available approach to layout the Pie chart is described in the snippet.

Shestac92 avatar Mar 22 '22 16:03 Shestac92

Hey @Shestac92 even I'm facing the same issue. The graphs are not shown, only the watermark. In my case, there are no fragments, only activities. I also tried to directly copy paste code from provided code snippets. Even that does not work.

I'm using v1.1.4

venusaim23 avatar Apr 09 '22 11:04 venusaim23

@Shestac92 Any updates?

aeharake avatar Jan 19 '23 19:01 aeharake

I am having the same issue, with any of the Anychart's. I had it working temporarily, after installing Android Studio Flamingo, but unfortunately the issue returned upon updates to patch 1 and other updates to Android Studio.

@Shestac92 @aeharake @ZeeshanCoding13 @venusaim23

Any solution?

Alfie920 avatar May 11 '23 19:05 Alfie920

any update i have same problem chart not displaying

abora97 avatar Jul 19 '23 09:07 abora97

Any updates? @Shestac92 @aeharake @aeharake @venusaim23 @Alfie920

abora97 avatar Jul 19 '23 13:07 abora97

@abora97 @Shestac92 @aeharake @venusaim23 I was able to correct the issues.

Documented on Stackoverflow.com here: https://stackoverflow.com/questions/75988346/i-am-getting-errors-implementing-a-heatmap-chart-using-anychart-via-android-stud/76111541#76111541Anychart charts not drawing

I hope it helps you all.

Alfie920 avatar Jul 19 '23 14:07 Alfie920

no still don't work

abora97 avatar Jul 30 '23 06:07 abora97