Вопрос

Anyone having some experience with the GraphView library? I need to draw a chart, the closest approximation is something like that damage/distance chart on Battlelog:

enter image description here

So as assumed here, 0 - 9m the damage would be constant, then falling down and starting with 50m constant again. Example from the developer's page which I want to try just to see what it would look like:

  GraphViewSeries exampleSeries = new GraphViewSeries(new GraphViewData[] {  
                  new GraphViewData(1, 2.0d)  
                  , new GraphViewData(2, 1.5d)  
                  , new GraphViewData(3, 2.5d)  
                  , new GraphViewData(4, 1.0d)  
            });  

            GraphView graphView = new LineGraphView(  
                  getActivity() // context  
                  , "GraphViewDemo" // heading  
            );  
            graphView.addSeries(exampleSeries); // data 

GraphViewData cannot be resolved however. Any suggestions from those who used that library or possible alternatives to achieve what I need (see picture above)?

Это было полезно?

Решение 2

Oh well, that's by bad. Just looked inside the lib code and found out that I had to import GraphView to get it working, though the ADT didn't suggest to do so.

Другие советы

This is a common problem and can be solved by following these steps:

  1. Right click your project
  2. Go to Build Path
  3. Select Configure Build Path
  4. Go to Order and Export
  5. Check your JAR file's box, single click on it and move it up below Android's dependencies.
  6. Clean your project and try to run it.
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top