公共查看onCreateView(LayoutInflater吹氣,ViewGroup中容器, 捆綁savedInstanceState){Android studio在graph.addSeries(系列)中顯示錯誤。 Android的工作室是表示一系列graph.add(系列)
// Inflate the layout for this fragment
View rootView= inflater.inflate(R.layout.fragment_graph, container, false);
GraphView graph = (GraphView) rootView.findViewById(R.id.graph);
BarGraphSeries<DataPoint> series = new BarGraphSeries<>(new DataPoint[] {
new DataPoint(0, 1),
new DataPoint(1, 5),
new DataPoint(2, 3),
new DataPoint(3, 2),
new DataPoint(4, 6)
});
graph.addSeries(series);
return rootView;
}