Reputation: 9
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
// 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;
}
Upvotes: 0
Views: 1091
Reputation: 1
I have resolved this problem by adding adding Graphview.3.0.0 jar . Initially i was working with Graphview.4.2.1 so same error was coming , but when I add lower version , everything was working well .
Upvotes: 0
Reputation: 6417
current version is 4.2.1 so you should change it to
compile 'com.jjoe64:graphview:4.2.1'
Upvotes: 0
Reputation: 9
i have tackled that error. I just changed dependencies compile 'com.jjoe64:graphview:4.2.2' to compile 'com.jjoe64:graphview:4.0.1' in build.gradle.
Upvotes: 0