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.29k
stars
367
forks
source link
The changes are not applied in the app ?? the data is different but the resultant pie chart is the same. Please Help! #99
@Pranavg387
Unfortunately, in your snippet, I can't find Pie chart updating code. This issue comment describes how to update the Pie chart with new data without recreating it. This should solve your issue.
`package com.example.piechart;
import android.os.Bundle; import android.support.v7.app.AppCompatActivity;
import com.anychart.AnyChart; import com.anychart.AnyChartView; import com.anychart.chart.common.dataentry.DataEntry; import com.anychart.chart.common.listener.Event; import com.anychart.chart.common.listener.ListenersInterface; import com.anychart.charts.Pie; import com.anychart.enums.Align; import com.anychart.enums.LegendLayout;
import java.util.ArrayList; import java.util.List;
public class MainActivity extends AppCompatActivity {
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);
data.add(new ValueDataEntry("Apples", 6)); data.add(new ValueDataEntry("Pears", 7)); data.add(new ValueDataEntry("Bananas", 7)); data.add(new ValueDataEntry("Grapes", 1)); data.add(new ValueDataEntry("Oranges", 1));
} }`