Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Charts are not displaying #250

Open
ZeeshanCoding13 opened this issue Mar 16, 2022 · 8 comments
Open

Charts are not displaying #250

ZeeshanCoding13 opened this issue Mar 16, 2022 · 8 comments

Comments

@ZeeshanCoding13
Copy link

ZeeshanCoding13 commented Mar 16, 2022

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;
}

@Shestac92
Copy link

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

@venusaim23
Copy link

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

@aeharake
Copy link

@Shestac92 Any updates?

@Alfie920
Copy link

Alfie920 commented May 11, 2023

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?

@abora97
Copy link

abora97 commented Jul 19, 2023

any update i have same problem chart not displaying

@abora97
Copy link

abora97 commented Jul 19, 2023

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

@abora97
Copy link

abora97 commented Jul 30, 2023

no still don't work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants