Open mathuadi3 opened 5 years ago
Here is my code: when i run this, the screen just shows blank!!
linearLayout=findViewById(R.id.linearLayout_graph); AnyChartView chartView=new AnyChartView(getApplicationContext()); LinearLayout.LayoutParams layoutParams=new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); layoutParams.setMargins(10,10,10,10); layoutParams.weight=1.0f; layoutParams.gravity= Gravity.CENTER; chartView.setLayoutParams(layoutParams); chartView.setId(0);
Pie pie = AnyChart.pie(); List<DataEntry> data = new ArrayList<>(); data.add(new ValueDataEntry("Not Started", 5)); data.add(new ValueDataEntry("WIP", 45)); data.add(new ValueDataEntry("Closed", 25)); data.add(new ValueDataEntry("Lagging", 7)); data.add(new ValueDataEntry("Delayed", 2)); data.add(new ValueDataEntry("Not Started Delayed",1)); pie.data(data); pie.title("Activity Status"); pie.labels().position("outside"); pie.legend().title().enabled(true); pie.legend().title() .text("Status") .padding(0d, 0d, 10d, 0d); pie.legend() .position("center-bottom") .itemsLayout(LegendLayout.HORIZONTAL) .align(Align.CENTER); chartView.setChart(pie); linearLayout.addView(chartView);
@mathuadi3 I'm not sure that it's possible to create properly the anyChartView like this:
linearLayout=findViewById(R.id.linearLayout_graph); AnyChartView chartView=new AnyChartView(getApplicationContext());
Please, try the approach described in the guide.
Here is my code: when i run this, the screen just shows blank!!
linearLayout=findViewById(R.id.linearLayout_graph); AnyChartView chartView=new AnyChartView(getApplicationContext()); LinearLayout.LayoutParams layoutParams=new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); layoutParams.setMargins(10,10,10,10); layoutParams.weight=1.0f; layoutParams.gravity= Gravity.CENTER; chartView.setLayoutParams(layoutParams); chartView.setId(0);