com.jjoe64.graphview
Class GraphView

java.lang.Object
  extended by LinearLayout
      extended by com.jjoe64.graphview.GraphView

public class GraphView
extends LinearLayout

GraphView creates a scaled line graph with x and y axis labels.


Nested Class Summary
static class GraphView.GraphViewData
          one data set for the graph
 
Constructor Summary
GraphView(Context context, GraphView.GraphViewData[] values, java.lang.String title, java.lang.String[] horlabels, java.lang.String[] verlabels)
           
 
Method Summary
protected  java.lang.String formatLabel(double value)
          formats the label can be overwritten
 boolean getDrawBackground()
           
 boolean isScrollable()
           
 void setDrawBackground(boolean drawBackground)
           
 void setScalable(boolean scalable)
          this forces scrollable = true
 void setScrollable(boolean scrollable)
          the user can scroll (horizontal) the graph.
 void setViewPort(double start, double size)
          set's the viewport for the graph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphView

public GraphView(Context context,
                 GraphView.GraphViewData[] values,
                 java.lang.String title,
                 java.lang.String[] horlabels,
                 java.lang.String[] verlabels)
Parameters:
context -
values - must be sorted by valueX ASC
title - [optional]
horlabels - [optional] if null, labels were generated automatically
verlabels - [optional] if null, labels were generated automatically
Method Detail

formatLabel

protected java.lang.String formatLabel(double value)
formats the label can be overwritten

Parameters:
value - x and y values
Returns:
value to display

getDrawBackground

public boolean getDrawBackground()

isScrollable

public boolean isScrollable()

setDrawBackground

public void setDrawBackground(boolean drawBackground)
Parameters:
drawBackground - true for a light blue background under the graph line

setScalable

public void setScalable(boolean scalable)
this forces scrollable = true

Parameters:
scalable -

setScrollable

public void setScrollable(boolean scrollable)
the user can scroll (horizontal) the graph. This is only useful if you use a viewport setViewPort(double, double) which doesn't displays all data.

Parameters:
scrollable -

setViewPort

public void setViewPort(double start,
                        double size)
set's the viewport for the graph.

Parameters:
start - x-value
size -