├── settings.gradle ├── doc ├── package-list ├── resources │ └── inherit.gif ├── allclasses-noframe.html ├── allclasses-frame.html ├── overview-frame.html ├── index.html ├── stylesheet.css ├── com │ └── jjoe64 │ │ └── graphview │ │ ├── compatible │ │ ├── package-frame.html │ │ ├── package-tree.html │ │ ├── package-summary.html │ │ ├── ScaleGestureDetector.SimpleOnScaleGestureListener.html │ │ └── RealScaleGestureDetector.html │ │ ├── package-frame.html │ │ ├── class-use │ │ ├── GraphView.html │ │ └── GraphView.GraphViewData.html │ │ ├── package-use.html │ │ ├── package-tree.html │ │ ├── ValueDependentColor.html │ │ ├── GraphViewDataInterface.html │ │ ├── package-summary.html │ │ └── CustomLabelFormatter.html ├── deprecated-list.html ├── constant-values.html ├── index-files │ ├── index-1.html │ ├── index-4.html │ ├── index-2.html │ ├── index-5.html │ └── index-3.html ├── overview-tree.html └── help-doc.html ├── GVBar.png ├── GVLine.jpg ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── WordPressGraphView ├── gradle.properties-example ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── jjoe64 │ │ └── graphview │ │ ├── IndexDependentColor.java │ │ ├── ValueDependentColor.java │ │ ├── GraphViewDataInterface.java │ │ ├── compatible │ │ ├── RealScaleGestureDetector.java │ │ └── ScaleGestureDetector.java │ │ ├── CustomLabelFormatter.java │ │ ├── BarGraphView.java │ │ ├── LineGraphView.java │ │ ├── GraphViewSeries.java │ │ └── GraphViewStyle.java └── build.gradle ├── .gitignore ├── README.md ├── gradlew.bat ├── gradlew └── license.txt /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':WordPressGraphView' 2 | -------------------------------------------------------------------------------- /doc/package-list: -------------------------------------------------------------------------------- 1 | com.jjoe64.graphview 2 | com.jjoe64.graphview.compatible 3 | -------------------------------------------------------------------------------- /GVBar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wordpress-mobile/GraphView/trunk/GVBar.png -------------------------------------------------------------------------------- /GVLine.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wordpress-mobile/GraphView/trunk/GVLine.jpg -------------------------------------------------------------------------------- /doc/resources/inherit.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wordpress-mobile/GraphView/trunk/doc/resources/inherit.gif -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wordpress-mobile/GraphView/trunk/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /WordPressGraphView/gradle.properties-example: -------------------------------------------------------------------------------- 1 | ossrhUsername=hello 2 | ossrhPassword=world 3 | 4 | signing.keyId=byebye 5 | signing.password=secret 6 | signing.secretKeyRingFile=/home/user/secret.gpg 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Jul 09 11:48:51 CEST 2014 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip 7 | -------------------------------------------------------------------------------- /WordPressGraphView/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WordPressGraphView/src/main/java/com/jjoe64/graphview/IndexDependentColor.java: -------------------------------------------------------------------------------- 1 | package com.jjoe64.graphview; 2 | 3 | /** 4 | * you can change the color of an element depending on the index in the series. 5 | * takes only effect in BarGraphView 6 | */ 7 | public interface IndexDependentColor { 8 | public int get(int index); 9 | } 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # generated files 2 | build/ 3 | 4 | # Local configuration file (sdk path, etc) 5 | local.properties 6 | tools/deploy-mvn-artifact.conf 7 | 8 | # Intellij project files 9 | *.iml 10 | *.ipr 11 | *.iws 12 | .idea/ 13 | 14 | # Gradle 15 | .gradle/ 16 | gradle.properties 17 | 18 | # Idea 19 | .idea/workspace.xml 20 | *.iml 21 | 22 | # OS X 23 | .DS_Store 24 | 25 | # dependencies 26 | -------------------------------------------------------------------------------- /doc/allclasses-noframe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | All Classes 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | All Classes 20 |
21 | 22 | 23 | 24 | 29 | 30 |
GraphView 25 |
26 | GraphView.GraphViewData 27 |
28 |
31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /doc/allclasses-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | All Classes 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | All Classes 20 |
21 | 22 | 23 | 24 | 29 | 30 |
GraphView 25 |
26 | GraphView.GraphViewData 27 |
28 |
31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /WordPressGraphView/src/main/java/com/jjoe64/graphview/ValueDependentColor.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of GraphView. 3 | * 4 | * GraphView is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * GraphView is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with GraphView. If not, see . 16 | * 17 | * Copyright Jonas Gehring 18 | */ 19 | 20 | package com.jjoe64.graphview; 21 | 22 | /** 23 | * you can change the color depending on the value. 24 | * takes only effect in BarGraphView 25 | */ 26 | public interface ValueDependentColor { 27 | public int get(GraphViewDataInterface data); 28 | } 29 | -------------------------------------------------------------------------------- /WordPressGraphView/src/main/java/com/jjoe64/graphview/GraphViewDataInterface.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of GraphView. 3 | * 4 | * GraphView is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * GraphView is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with GraphView. If not, see . 16 | * 17 | * Copyright Jonas Gehring 18 | */ 19 | 20 | package com.jjoe64.graphview; 21 | 22 | /** 23 | * the base interface for the graphview data. 24 | * you can use your own data models, when they implement 25 | * this interface. 26 | */ 27 | public interface GraphViewDataInterface { 28 | public double getX(); 29 | public double getY(); 30 | } 31 | -------------------------------------------------------------------------------- /WordPressGraphView/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | dependencies { 6 | classpath 'com.android.tools.build:gradle:2.3.3' 7 | classpath 'com.novoda:bintray-release:0.5.0' 8 | } 9 | } 10 | 11 | apply plugin: 'com.android.library' 12 | apply plugin: 'maven' 13 | apply plugin: 'com.novoda.bintray-release' // must be applied after your artifact generating plugin (eg. java / com.android.library) 14 | 15 | repositories { 16 | jcenter() 17 | } 18 | 19 | android { 20 | publishNonDefault true 21 | 22 | compileSdkVersion 19 23 | buildToolsVersion "25.0.3" 24 | 25 | defaultConfig { 26 | versionName "3.4.1" 27 | versionCode 1 28 | minSdkVersion 8 29 | targetSdkVersion 19 30 | } 31 | } 32 | 33 | publish { 34 | artifactId = 'graphview' 35 | userOrg = 'wordpress-mobile' 36 | groupId = 'org.wordpress' 37 | uploadName = 'graphview' 38 | description = 'Android library for programmatic visual diagram creation' 39 | publishVersion = android.defaultConfig.versionName 40 | licences = ['LGPL-3.0'] 41 | website = 'https://github.com/wordpress-mobile/GraphView' 42 | dryRun = 'false' 43 | autoPublish = 'true' 44 | } 45 | -------------------------------------------------------------------------------- /doc/overview-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Overview List 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 23 | 24 |
22 |
25 | 26 | 27 | 28 | 38 | 39 |
All Classes 29 |

30 | 31 | Packages 32 |
33 | com.jjoe64.graphview 34 |
35 | com.jjoe64.graphview.compatible 36 |
37 |

40 | 41 |

42 |   43 | 44 | 45 | -------------------------------------------------------------------------------- /doc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Generated Documentation (Untitled) 8 | 9 | 20 | 22 | 23 | 24 | 25 | 26 | 27 | <H2> 28 | Frame Alert</H2> 29 | 30 | <P> 31 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. 32 | <BR> 33 | Link to<A HREF="com/jjoe64/graphview/package-summary.html">Non-frame version.</A> 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /doc/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* Javadoc style sheet */ 2 | 3 | /* Define colors, fonts and other style attributes here to override the defaults */ 4 | 5 | /* Page background color */ 6 | body { background-color: #FFFFFF; color:#000000 } 7 | 8 | /* Headings */ 9 | h1 { font-size: 145% } 10 | 11 | /* Table colors */ 12 | .TableHeadingColor { background: #CCCCFF; color:#000000 } /* Dark mauve */ 13 | .TableSubHeadingColor { background: #EEEEFF; color:#000000 } /* Light mauve */ 14 | .TableRowColor { background: #FFFFFF; color:#000000 } /* White */ 15 | 16 | /* Font used in left-hand frame lists */ 17 | .FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 18 | .FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 19 | .FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 20 | 21 | /* Navigation bar fonts and colors */ 22 | .NavBarCell1 { background-color:#EEEEFF; color:#000000} /* Light mauve */ 23 | .NavBarCell1Rev { background-color:#00008B; color:#FFFFFF} /* Dark Blue */ 24 | .NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;color:#000000;} 25 | .NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;color:#FFFFFF;} 26 | 27 | .NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} 28 | .NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} 29 | 30 | -------------------------------------------------------------------------------- /WordPressGraphView/src/main/java/com/jjoe64/graphview/compatible/RealScaleGestureDetector.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of GraphView. 3 | * 4 | * GraphView is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * GraphView is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with GraphView. If not, see . 16 | * 17 | * Copyright Jonas Gehring 18 | */ 19 | 20 | package com.jjoe64.graphview.compatible; 21 | 22 | import android.annotation.SuppressLint; 23 | import android.content.Context; 24 | import android.view.ScaleGestureDetector; 25 | 26 | @SuppressLint("NewApi") 27 | public class RealScaleGestureDetector extends ScaleGestureDetector { 28 | public RealScaleGestureDetector(Context context, final com.jjoe64.graphview.compatible.ScaleGestureDetector fakeScaleGestureDetector, final com.jjoe64.graphview.compatible.ScaleGestureDetector.SimpleOnScaleGestureListener fakeListener) { 29 | super(context, new android.view.ScaleGestureDetector.SimpleOnScaleGestureListener() { 30 | @Override 31 | public boolean onScale(ScaleGestureDetector detector) { 32 | return fakeListener.onScale(fakeScaleGestureDetector); 33 | } 34 | }); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /doc/com/jjoe64/graphview/compatible/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.jjoe64.graphview.compatible 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | com.jjoe64.graphview.compatible 20 | 21 | 22 | 27 | 28 |
23 | Interfaces  24 | 25 |
26 | ScaleGestureDetector.SimpleOnScaleGestureListener
29 | 30 | 31 | 32 | 33 | 40 | 41 |
34 | Classes  35 | 36 |
37 | RealScaleGestureDetector 38 |
39 | ScaleGestureDetector
42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /WordPressGraphView/src/main/java/com/jjoe64/graphview/CustomLabelFormatter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of GraphView. 3 | * 4 | * GraphView is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * GraphView is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with GraphView. If not, see . 16 | * 17 | * Copyright Jonas Gehring 18 | */ 19 | 20 | package com.jjoe64.graphview; 21 | 22 | /** 23 | * if you want to show different labels, 24 | * you can use this label formatter. 25 | * As Input you get the raw value (x or y) and 26 | * you return a String that will be displayed. 27 | * {@code 28 | * graphView.setCustomLabelFormatter(new CustomLabelFormatter() { 29 | public String formatLabel(double value, boolean isValueX) { 30 | if (isValueX) { 31 | if (value < 5) { 32 | return "small"; 33 | } else if (value < 15) { 34 | return "middle"; 35 | } else { 36 | return "big"; 37 | } 38 | } 39 | return null; // let graphview generate Y-axis label for us 40 | } 41 | }); 42 | * } 43 | */ 44 | public interface CustomLabelFormatter { 45 | 46 | /** 47 | * will be called when the labels were generated 48 | * @param value the raw input value (x or y) 49 | * @param isValueX true if value is a x-value, false if otherwise 50 | * @return the string that will be displayed. return null if you want graphview to generate the label for you. 51 | */ 52 | String formatLabel(double value, boolean isValueX); 53 | 54 | } 55 | -------------------------------------------------------------------------------- /WordPressGraphView/src/main/java/com/jjoe64/graphview/BarGraphView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of GraphView. 3 | * 4 | * GraphView is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * GraphView is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with GraphView. If not, see . 16 | * 17 | * Copyright Jonas Gehring 18 | */ 19 | 20 | package com.jjoe64.graphview; 21 | 22 | import android.content.Context; 23 | import android.graphics.Canvas; 24 | import android.util.AttributeSet; 25 | 26 | import com.jjoe64.graphview.GraphViewSeries.GraphViewSeriesStyle; 27 | 28 | /** 29 | * Draws a Bar Chart 30 | * @author Muhammad Shahab Hameed 31 | */ 32 | public class BarGraphView extends GraphView { 33 | public BarGraphView(Context context, AttributeSet attrs) { 34 | super(context, attrs); 35 | } 36 | 37 | public BarGraphView(Context context, String title) { 38 | super(context, title); 39 | } 40 | 41 | @Override 42 | protected void onBeforeDrawSeries() { 43 | } 44 | 45 | @Override 46 | public void drawSeries(Canvas canvas, GraphViewDataInterface[] values, float graphwidth, float graphheight, 47 | float border, double minX, double minY, double diffX, double diffY, 48 | float horstart, GraphViewSeriesStyle style) { 49 | float colwidth = (graphwidth - (2 * border)) / values.length; 50 | 51 | paint.setStrokeWidth(style.thickness); 52 | paint.setColor(style.color); 53 | 54 | // draw data 55 | for (int i = 0; i < values.length; i++) { 56 | float valY = (float) (values[i].getY() - minY); 57 | float ratY = (float) (valY / diffY); 58 | float y = graphheight * ratY; 59 | 60 | // hook for value dependent color 61 | if (style.getValueDependentColor() != null) { 62 | paint.setColor(style.getValueDependentColor().get(values[i])); 63 | } 64 | 65 | canvas.drawRect((i * colwidth) + horstart, (border - y) + graphheight, ((i * colwidth) + horstart) + (colwidth - 1), graphheight + border - 1, paint); 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Chart and Graph Library for Android 2 | ==================================== 3 | 4 |

What is GraphView

5 | GraphView is a library for Android to programmatically create flexible and nice-looking diagramms. It is easy to understand, to integrate and to customize it. 6 | At the moment there are two different types: 7 | 11 | 12 | Tested on Android 1.6, 2.2, 2.3 and 3.0 (honeycomb, tablet), 4.0, 4.1, 4.3 and 4.4. 13 | 14 | 15 | 16 | 17 | 18 |

Features

19 | 20 | * Two chart types 21 | Line Chart and Bar Chart. 22 | * Draw multiple series of data 23 | Let the diagram show more that one series in a graph. You can set a color and a description for every series. 24 | * Show legend 25 | A legend can be displayed inline the chart. You can set the width and the vertical align (top, middle, bottom). 26 | * Custom labels 27 | The labels for the x- and y-axis are generated automatically. But you can set your own labels, Strings are possible. 28 | * Handle incomplete data 29 | It's possible to give the data in different frequency. 30 | * Viewport 31 | You can limit the viewport so that only a part of the data will be displayed. 32 | * Scrolling 33 | You can scroll with a finger touch move gesture. 34 | * Scaling / Zooming 35 | Since Android 2.3! With two-fingers touch scale gesture (Multi-touch), the viewport can be changed. 36 | * Background (line graph) 37 | Optionally draws a light background under the diagram stroke. 38 | * Manual Y axis limits 39 | * Realtime Graph (Live) 40 | * And more 41 | 42 |

How to use

43 | View GraphView page
http://www.jjoe64.com/p/graphview-library.html
44 | 45 |

Important

46 | To show you how to integrate the library into an existing project see the GraphView-Demos project! 47 | See GraphView-Demos for examples. 48 | https://github.com/jjoe64/GraphView-Demos
49 |
View GraphView page http://www.jjoe64.com/p/graphview-library.html 50 | 51 |

Publish it to bintray

52 | 53 | ```shell 54 | $ ./gradlew assemble publishToMavenLocal bintrayUpload -PbintrayUser=FIXME -PbintrayKey=FIXME -PdryRun=false 55 | ``` 56 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /doc/com/jjoe64/graphview/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.jjoe64.graphview 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | com.jjoe64.graphview 20 | 21 | 22 | 31 | 32 |
23 | Interfaces  24 | 25 |
26 | CustomLabelFormatter 27 |
28 | GraphViewDataInterface 29 |
30 | ValueDependentColor
33 | 34 | 35 | 36 | 37 | 54 | 55 |
38 | Classes  39 | 40 |
41 | BarGraphView 42 |
43 | GraphView 44 |
45 | GraphView.GraphViewData 46 |
47 | GraphViewSeries 48 |
49 | GraphViewSeries.GraphViewSeriesStyle 50 |
51 | GraphViewStyle 52 |
53 | LineGraphView
56 | 57 | 58 | 59 | 60 | 65 | 66 |
61 | Enums  62 | 63 |
64 | GraphView.LegendAlign
67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /WordPressGraphView/src/main/java/com/jjoe64/graphview/compatible/ScaleGestureDetector.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of GraphView. 3 | * 4 | * GraphView is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * GraphView is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with GraphView. If not, see . 16 | * 17 | * Copyright Jonas Gehring 18 | */ 19 | 20 | package com.jjoe64.graphview.compatible; 21 | 22 | import java.lang.reflect.Constructor; 23 | import java.lang.reflect.Method; 24 | 25 | import android.content.Context; 26 | import android.util.Log; 27 | import android.view.MotionEvent; 28 | 29 | public class ScaleGestureDetector { 30 | public interface SimpleOnScaleGestureListener { 31 | boolean onScale(ScaleGestureDetector detector); 32 | } 33 | 34 | private Object realScaleGestureDetector; 35 | private Method method_getScaleFactor; 36 | private Method method_isInProgress; 37 | private Method method_onTouchEvent; 38 | 39 | /** 40 | * @param context 41 | * @param simpleOnScaleGestureListener 42 | */ 43 | public ScaleGestureDetector(Context context, SimpleOnScaleGestureListener simpleOnScaleGestureListener) { 44 | try { 45 | // check if class is available 46 | Class.forName("android.view.ScaleGestureDetector"); 47 | 48 | // load class and methods 49 | Class classRealScaleGestureDetector = Class.forName("com.jjoe64.graphview.compatible.RealScaleGestureDetector"); 50 | method_getScaleFactor = classRealScaleGestureDetector.getMethod("getScaleFactor"); 51 | method_isInProgress = classRealScaleGestureDetector.getMethod("isInProgress"); 52 | method_onTouchEvent = classRealScaleGestureDetector.getMethod("onTouchEvent", MotionEvent.class); 53 | 54 | // create real ScaleGestureDetector 55 | Constructor constructor = classRealScaleGestureDetector.getConstructor(Context.class, getClass(), SimpleOnScaleGestureListener.class); 56 | realScaleGestureDetector = constructor.newInstance(context, this, simpleOnScaleGestureListener); 57 | } catch (Exception e) { 58 | // not available 59 | Log.w("com.jjoe64.graphview", "*** WARNING *** No scaling available for graphs. Exception:"); 60 | e.printStackTrace(); 61 | } 62 | } 63 | 64 | public double getScaleFactor() { 65 | if (method_getScaleFactor != null) { 66 | try { 67 | return (Float) method_getScaleFactor.invoke(realScaleGestureDetector); 68 | } catch (Exception e) { 69 | e.printStackTrace(); 70 | return 1.0; 71 | } 72 | } 73 | return 1.0; 74 | } 75 | 76 | public boolean isInProgress() { 77 | if (method_getScaleFactor != null) { 78 | try { 79 | return (Boolean) method_isInProgress.invoke(realScaleGestureDetector); 80 | } catch (Exception e) { 81 | e.printStackTrace(); 82 | return false; 83 | } 84 | } 85 | return false; 86 | } 87 | 88 | public void onTouchEvent(MotionEvent event) { 89 | if (method_onTouchEvent != null) { 90 | try { 91 | method_onTouchEvent.invoke(realScaleGestureDetector, event); 92 | } catch (Exception e) { 93 | e.printStackTrace(); 94 | } 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /WordPressGraphView/src/main/java/com/jjoe64/graphview/LineGraphView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of GraphView. 3 | * 4 | * GraphView is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * GraphView is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with GraphView. If not, see . 16 | * 17 | * Copyright Jonas Gehring 18 | */ 19 | 20 | package com.jjoe64.graphview; 21 | 22 | import android.content.Context; 23 | import android.graphics.Canvas; 24 | import android.graphics.Color; 25 | import android.graphics.Paint; 26 | import android.util.AttributeSet; 27 | 28 | import com.jjoe64.graphview.GraphViewSeries.GraphViewSeriesStyle; 29 | 30 | /** 31 | * Line Graph View. This draws a line chart. 32 | */ 33 | public class LineGraphView extends GraphView { 34 | private final Paint paintBackground; 35 | private boolean drawBackground; 36 | 37 | public LineGraphView(Context context, AttributeSet attrs) { 38 | super(context, attrs); 39 | 40 | paintBackground = new Paint(); 41 | paintBackground.setColor(Color.rgb(20, 40, 60)); 42 | paintBackground.setStrokeWidth(4); 43 | } 44 | 45 | public LineGraphView(Context context, String title) { 46 | super(context, title); 47 | 48 | paintBackground = new Paint(); 49 | paintBackground.setColor(Color.rgb(20, 40, 60)); 50 | paintBackground.setStrokeWidth(4); 51 | } 52 | 53 | 54 | @Override 55 | protected void onBeforeDrawSeries() { 56 | } 57 | 58 | @Override 59 | public void drawSeries(Canvas canvas, GraphViewDataInterface[] values, float graphwidth, float graphheight, float border, double minX, double minY, double diffX, double diffY, float horstart, GraphViewSeriesStyle style) { 60 | // draw background 61 | double lastEndY = 0; 62 | double lastEndX = 0; 63 | if (drawBackground) { 64 | float startY = graphheight + border; 65 | for (int i = 0; i < values.length; i++) { 66 | double valY = values[i].getY() - minY; 67 | double ratY = valY / diffY; 68 | double y = graphheight * ratY; 69 | 70 | double valX = values[i].getX() - minX; 71 | double ratX = valX / diffX; 72 | double x = graphwidth * ratX; 73 | 74 | float endX = (float) x + (horstart + 1); 75 | float endY = (float) (border - y) + graphheight +2; 76 | 77 | if (i > 0) { 78 | // fill space between last and current point 79 | double numSpace = ((endX - lastEndX) / 3f) +1; 80 | for (int xi=0; xi bottom edge 85 | float startX = spaceX; 86 | 87 | // do not draw over the left edge 88 | if (startX-horstart > 1) { 89 | canvas.drawLine(startX, startY, spaceX, spaceY, paintBackground); 90 | } 91 | } 92 | } 93 | 94 | lastEndY = endY; 95 | lastEndX = endX; 96 | } 97 | } 98 | 99 | // draw data 100 | paint.setStrokeWidth(style.thickness); 101 | paint.setColor(style.color); 102 | 103 | lastEndY = 0; 104 | lastEndX = 0; 105 | for (int i = 0; i < values.length; i++) { 106 | double valY = values[i].getY() - minY; 107 | double ratY = valY / diffY; 108 | double y = graphheight * ratY; 109 | 110 | double valX = values[i].getX() - minX; 111 | double ratX = valX / diffX; 112 | double x = graphwidth * ratX; 113 | 114 | if (i > 0) { 115 | float startX = (float) lastEndX + (horstart + 1); 116 | float startY = (float) (border - lastEndY) + graphheight; 117 | float endX = (float) x + (horstart + 1); 118 | float endY = (float) (border - y) + graphheight; 119 | 120 | canvas.drawLine(startX, startY, endX, endY, paint); 121 | } 122 | lastEndY = y; 123 | lastEndX = x; 124 | } 125 | } 126 | 127 | public int getBackgroundColor() { 128 | return paintBackground.getColor(); 129 | } 130 | 131 | public boolean getDrawBackground() { 132 | return drawBackground; 133 | } 134 | 135 | @Override 136 | public void setBackgroundColor(int color) { 137 | paintBackground.setColor(color); 138 | } 139 | 140 | /** 141 | * @param drawBackground true for a light blue background under the graph line 142 | */ 143 | public void setDrawBackground(boolean drawBackground) { 144 | this.drawBackground = drawBackground; 145 | } 146 | } 147 | -------------------------------------------------------------------------------- /doc/deprecated-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Deprecated List 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 50 | 53 | 54 | 55 | 56 | 59 | 75 | 76 |
51 | 52 |
77 | 78 | 79 | 80 |
81 |
82 |

83 | Deprecated API

84 |
85 |
86 | Contents
    87 |
88 | 89 |
90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 111 | 114 | 115 | 116 | 117 | 120 | 136 | 137 |
112 | 113 |
138 | 139 | 140 | 141 |
142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /doc/constant-values.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Constant Field Values 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 51 | 54 | 55 | 56 | 57 | 60 | 76 | 77 |
52 | 53 |
78 | 79 | 80 | 81 |
82 |
83 |

84 | Constant Field Values

85 |
86 |
87 | Contents
    88 |
89 | 90 |
91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 113 | 116 | 117 | 118 | 119 | 122 | 138 | 139 |
114 | 115 |
140 | 141 | 142 | 143 |
144 | 145 | 146 | 147 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /WordPressGraphView/src/main/java/com/jjoe64/graphview/GraphViewSeries.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of GraphView. 3 | * 4 | * GraphView is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * GraphView is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with GraphView. If not, see . 16 | * 17 | * Copyright Jonas Gehring 18 | */ 19 | 20 | package com.jjoe64.graphview; 21 | 22 | import java.util.ArrayList; 23 | import java.util.List; 24 | 25 | /** 26 | * a graphview series. 27 | * holds the data, description and styles 28 | */ 29 | public class GraphViewSeries { 30 | /** 31 | * graph series style: color and thickness 32 | */ 33 | static public class GraphViewSeriesStyle { 34 | public int color = 0xff0077cc; 35 | public int outerColor = 0x00ffffff; 36 | public int highlightColor = 0xff0077cc; 37 | public int outerhighlightColor = 0x00ffffff; 38 | public int thickness = 3; 39 | public float padding = 0; 40 | private ValueDependentColor valueDependentColor; 41 | 42 | public GraphViewSeriesStyle() { 43 | super(); 44 | } 45 | public GraphViewSeriesStyle(int color, int thickness, float padding) { 46 | super(); 47 | this.color = color; 48 | this.thickness = thickness; 49 | this.padding = padding; 50 | } 51 | 52 | public ValueDependentColor getValueDependentColor() { 53 | return valueDependentColor; 54 | } 55 | 56 | /** 57 | * the color depends on the value of the data. 58 | * only possible in BarGraphView 59 | * @param valueDependentColor 60 | */ 61 | public void setValueDependentColor(ValueDependentColor valueDependentColor) { 62 | this.valueDependentColor = valueDependentColor; 63 | } 64 | } 65 | 66 | final String description; 67 | final GraphViewSeriesStyle style; 68 | GraphViewDataInterface[] values; 69 | private final List graphViews = new ArrayList(); 70 | 71 | public GraphViewSeries(GraphViewDataInterface[] values) { 72 | description = null; 73 | style = new GraphViewSeriesStyle(); 74 | this.values = values; 75 | } 76 | 77 | public GraphViewSeries(String description, GraphViewSeriesStyle style, GraphViewDataInterface[] values) { 78 | super(); 79 | this.description = description; 80 | if (style == null) { 81 | style = new GraphViewSeriesStyle(); 82 | } 83 | this.style = style; 84 | this.values = values; 85 | } 86 | 87 | /** 88 | * this graphview will be redrawn if data changes 89 | * @param graphView 90 | */ 91 | public void addGraphView(GraphView graphView) { 92 | this.graphViews.add(graphView); 93 | } 94 | 95 | /** 96 | * add one data to current data 97 | * @param value the new data to append 98 | * @param scrollToEnd true: graphview will scroll to the end (maxX) 99 | * @deprecated please use {@link #appendData(GraphViewDataInterface, boolean, int)} to avoid memory overflow 100 | */ 101 | @Deprecated 102 | public void appendData(GraphViewDataInterface value, boolean scrollToEnd) { 103 | GraphViewDataInterface[] newValues = new GraphViewDataInterface[values.length + 1]; 104 | int offset = values.length; 105 | System.arraycopy(values, 0, newValues, 0, offset); 106 | 107 | newValues[values.length] = value; 108 | values = newValues; 109 | for (GraphView g : graphViews) { 110 | if (scrollToEnd) { 111 | g.scrollToEnd(); 112 | } 113 | } 114 | } 115 | 116 | /** 117 | * add one data to current data 118 | * @param value the new data to append 119 | * @param scrollToEnd true: graphview will scroll to the end (maxX) 120 | * @param maxDataCount if max data count is reached, the oldest data value will be lost 121 | */ 122 | public void appendData(GraphViewDataInterface value, boolean scrollToEnd, int maxDataCount) { 123 | synchronized (values) { 124 | int curDataCount = values.length; 125 | GraphViewDataInterface[] newValues; 126 | if (curDataCount < maxDataCount) { 127 | // enough space 128 | newValues = new GraphViewDataInterface[curDataCount + 1]; 129 | System.arraycopy(values, 0, newValues, 0, curDataCount); 130 | // append new data 131 | newValues[curDataCount] = value; 132 | } else { 133 | // we have to trim one data 134 | newValues = new GraphViewDataInterface[maxDataCount]; 135 | System.arraycopy(values, 1, newValues, 0, curDataCount-1); 136 | // append new data 137 | newValues[maxDataCount-1] = value; 138 | } 139 | values = newValues; 140 | } 141 | 142 | // update linked graph views 143 | for (GraphView g : graphViews) { 144 | if (scrollToEnd) { 145 | g.scrollToEnd(); 146 | } 147 | } 148 | } 149 | 150 | /** 151 | * @return series styles. never null 152 | */ 153 | public GraphViewSeriesStyle getStyle() { 154 | return style; 155 | } 156 | 157 | /** 158 | * you should use {@link GraphView#removeSeries(GraphViewSeries)} 159 | * @param graphView 160 | */ 161 | public void removeGraphView(GraphView graphView) { 162 | graphViews.remove(graphView); 163 | } 164 | 165 | /** 166 | * clears the current data and set the new. 167 | * redraws the graphview(s) 168 | * @param values new data 169 | */ 170 | public void resetData(GraphViewDataInterface[] values) { 171 | this.values = values; 172 | for (GraphView g : graphViews) { 173 | g.redrawAll(); 174 | } 175 | } 176 | public GraphViewDataInterface[] getData() { 177 | return values; 178 | } 179 | } 180 | -------------------------------------------------------------------------------- /WordPressGraphView/src/main/java/com/jjoe64/graphview/GraphViewStyle.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of GraphView. 3 | * 4 | * GraphView is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * GraphView is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with GraphView. If not, see . 16 | * 17 | * Copyright Jonas Gehring 18 | */ 19 | 20 | package com.jjoe64.graphview; 21 | 22 | import android.graphics.Color; 23 | 24 | /** 25 | * Styles for the GraphView 26 | * Important: Use GraphViewSeries.GraphViewSeriesStyle for series-specify styling 27 | * 28 | */ 29 | public class GraphViewStyle { 30 | private int verticalLabelsColor; 31 | private int horizontalLabelsColor; 32 | private int horizontalBackgroundLabelsColor; 33 | private IndexDependentColor horizontalLabelsIndexDependentColor; 34 | private IndexDependentColor horizontalLabelsBackgroundIndexDependentColor; 35 | private int gridXColor; 36 | private int gridYColor; 37 | private float textSize = 30f; 38 | private int verticalLabelsWidth; 39 | private int numVerticalLabels; 40 | private int numHorizontalLabels; 41 | private int maxColumnWidth; // Max width in PX a column can get on the screen 42 | 43 | public GraphViewStyle() { 44 | verticalLabelsColor = Color.WHITE; 45 | horizontalLabelsColor = Color.WHITE; 46 | horizontalBackgroundLabelsColor = Color.TRANSPARENT; 47 | gridXColor = Color.DKGRAY; 48 | gridYColor = Color.DKGRAY; 49 | } 50 | 51 | public GraphViewStyle(int vLabelsColor, int hLabelsColor, int hLabelsBackgroundColor, int gridXColor, int gridYColor) { 52 | this.verticalLabelsColor = vLabelsColor; 53 | this.horizontalLabelsColor = hLabelsColor; 54 | this.gridXColor = gridXColor; 55 | this.gridYColor = gridYColor; 56 | this.horizontalBackgroundLabelsColor = hLabelsBackgroundColor; 57 | } 58 | 59 | public int getGridXColor() { 60 | return gridXColor; 61 | } 62 | 63 | public int getGridYColor() { 64 | return gridYColor; 65 | } 66 | 67 | public int getHorizontalLabelsColor(int i) { 68 | if (horizontalLabelsIndexDependentColor != null) { 69 | return horizontalLabelsIndexDependentColor.get(i); 70 | } 71 | 72 | return getHorizontalLabelsColor(); 73 | } 74 | 75 | public int getHorizontalLabelsColor() { 76 | return horizontalLabelsColor; 77 | } 78 | 79 | public int getHorizontalLabelsBackgroundColor(int i) { 80 | if (horizontalLabelsBackgroundIndexDependentColor != null) { 81 | return horizontalLabelsBackgroundIndexDependentColor.get(i); 82 | } 83 | 84 | return getHorizontalLabelsBackgroundColor(); 85 | } 86 | 87 | public int getHorizontalLabelsBackgroundColor() { 88 | return horizontalBackgroundLabelsColor; 89 | } 90 | 91 | public int getNumHorizontalLabels() { 92 | return numHorizontalLabels; 93 | } 94 | 95 | public int getNumVerticalLabels() { 96 | return numVerticalLabels; 97 | } 98 | 99 | public float getTextSize() { 100 | return textSize; 101 | } 102 | 103 | public int getVerticalLabelsColor() { 104 | return verticalLabelsColor; 105 | } 106 | 107 | public int getVerticalLabelsWidth() { 108 | return verticalLabelsWidth; 109 | } 110 | 111 | public void setGridXColor(int c) { 112 | gridXColor = c; 113 | } 114 | 115 | public void setGridYColor(int c) { 116 | gridYColor = c; 117 | } 118 | 119 | public void setHorizontalLabelsColor(int c) { 120 | horizontalLabelsColor = c; 121 | } 122 | 123 | 124 | public int getMaxColumnWidth() { 125 | return maxColumnWidth; 126 | } 127 | 128 | public void setMaxColumnWidth(int maxColumnWidth) { 129 | this.maxColumnWidth = maxColumnWidth; 130 | } 131 | 132 | /** 133 | * @param numHorizontalLabels 0 = auto 134 | */ 135 | public void setNumHorizontalLabels(int numHorizontalLabels) { 136 | this.numHorizontalLabels = numHorizontalLabels; 137 | } 138 | 139 | /** 140 | * @param numVerticalLabels 0 = auto 141 | */ 142 | public void setNumVerticalLabels(int numVerticalLabels) { 143 | this.numVerticalLabels = numVerticalLabels; 144 | } 145 | 146 | public void setTextSize(float textSize) { 147 | this.textSize = textSize; 148 | } 149 | 150 | public void setVerticalLabelsColor(int c) { 151 | verticalLabelsColor = c; 152 | } 153 | 154 | /** 155 | * @param verticalLabelsWidth 0 = auto 156 | */ 157 | public void setVerticalLabelsWidth(int verticalLabelsWidth) { 158 | this.verticalLabelsWidth = verticalLabelsWidth; 159 | } 160 | 161 | public IndexDependentColor getHorizontalLabelsIndexDependentColor() { 162 | return horizontalLabelsIndexDependentColor; 163 | } 164 | 165 | /** 166 | * the color depends on the index of the data in the series 167 | * only possible in BarGraphView 168 | * @param indexDependentColor 169 | */ 170 | public void setHorizontalLabelsIndexDependentColor(IndexDependentColor indexDependentColor) { 171 | this.horizontalLabelsIndexDependentColor = indexDependentColor; 172 | } 173 | 174 | public IndexDependentColor getHorizontalLabelsBackgroundIndexDependentColor() { 175 | return horizontalLabelsBackgroundIndexDependentColor; 176 | } 177 | 178 | public void setHorizontalLabelsBackgroundIndexDependentColor(IndexDependentColor indexDependentColor) { 179 | this.horizontalLabelsBackgroundIndexDependentColor = indexDependentColor; 180 | } 181 | } 182 | -------------------------------------------------------------------------------- /doc/index-files/index-1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | C-Index 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 50 | 53 | 54 | 55 | 56 | 59 | 75 | 76 |
51 | 52 |
77 | 78 | 79 | 80 | C F G I S
81 |

82 | C

83 |
84 |
com.jjoe64.graphview - package com.jjoe64.graphview
 
85 |
86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 107 | 110 | 111 | 112 | 113 | 116 | 132 | 133 |
108 | 109 |
134 | 135 | 136 | 137 | C F G I S
138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /doc/overview-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Class Hierarchy 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 50 | 53 | 54 | 55 | 56 | 59 | 75 | 76 |
51 | 52 |
77 | 78 | 79 | 80 |
81 |
82 |

83 | Hierarchy For All Packages

84 |
85 |
86 |
Package Hierarchies:
com.jjoe64.graphview
87 |
88 |

89 | Class Hierarchy 90 |

91 | 97 |
98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 119 | 122 | 123 | 124 | 125 | 128 | 144 | 145 |
120 | 121 |
146 | 147 | 148 | 149 |
150 | 151 | 152 | 153 | -------------------------------------------------------------------------------- /doc/com/jjoe64/graphview/class-use/GraphView.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Uses of Class com.jjoe64.graphview.GraphView 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 50 | 53 | 54 | 55 | 56 | 59 | 75 | 76 |
51 | 52 |
77 | 78 | 79 | 80 |
81 |
82 |

83 | Uses of Class
com.jjoe64.graphview.GraphView

84 |
85 | No usage of com.jjoe64.graphview.GraphView 86 |

87 |


88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 109 | 112 | 113 | 114 | 115 | 118 | 134 | 135 |
110 | 111 |
136 | 137 | 138 | 139 |
140 | 141 | 142 | 143 | -------------------------------------------------------------------------------- /doc/index-files/index-4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | I-Index 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 50 | 53 | 54 | 55 | 56 | 59 | 75 | 76 |
51 | 52 |
77 | 78 | 79 | 80 | C F G I S
81 |

82 | I

83 |
84 |
isScrollable() - 85 | Method in class com.jjoe64.graphview.GraphView 86 |
  87 |
88 |
89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 110 | 113 | 114 | 115 | 116 | 119 | 135 | 136 |
111 | 112 |
137 | 138 | 139 | 140 | C F G I S
141 | 142 | 143 | 144 | -------------------------------------------------------------------------------- /doc/index-files/index-2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | F-Index 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 50 | 53 | 54 | 55 | 56 | 59 | 75 | 76 |
51 | 52 |
77 | 78 | 79 | 80 | C F G I S
81 |

82 | F

83 |
84 |
formatLabel(double) - 85 | Method in class com.jjoe64.graphview.GraphView 86 |
formats the label 87 | can be overwritten 88 |
89 |
90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 111 | 114 | 115 | 116 | 117 | 120 | 136 | 137 |
112 | 113 |
138 | 139 | 140 | 141 | C F G I S
142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /doc/com/jjoe64/graphview/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Uses of Package com.jjoe64.graphview 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 50 | 53 | 54 | 55 | 56 | 59 | 75 | 76 |
51 | 52 |
77 | 78 | 79 | 80 |
81 |
82 |

83 | Uses of Package
com.jjoe64.graphview

84 |
85 | 86 | 87 | 88 | 90 | 91 | 92 | 96 | 97 |
89 | Classes in com.jjoe64.graphview used by com.jjoe64.graphview
GraphView.GraphViewData 93 | 94 |
95 |           one data set for the graph
98 |   99 |

100 |


101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 122 | 125 | 126 | 127 | 128 | 131 | 147 | 148 |
123 | 124 |
149 | 150 | 151 | 152 |
153 | 154 | 155 | 156 | -------------------------------------------------------------------------------- /doc/index-files/index-5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | S-Index 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 50 | 53 | 54 | 55 | 56 | 59 | 75 | 76 |
51 | 52 |
77 | 78 | 79 | 80 | C F G I S
81 |

82 | S

83 |
84 |
setDrawBackground(boolean) - 85 | Method in class com.jjoe64.graphview.GraphView 86 |
  87 |
setScalable(boolean) - 88 | Method in class com.jjoe64.graphview.GraphView 89 |
this forces scrollable = true 90 |
setScrollable(boolean) - 91 | Method in class com.jjoe64.graphview.GraphView 92 |
the user can scroll (horizontal) the graph. 93 |
setViewPort(double, double) - 94 | Method in class com.jjoe64.graphview.GraphView 95 |
set's the viewport for the graph. 96 |
97 |
98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 119 | 122 | 123 | 124 | 125 | 128 | 144 | 145 |
120 | 121 |
146 | 147 | 148 | 149 | C F G I S
150 | 151 | 152 | 153 | -------------------------------------------------------------------------------- /doc/com/jjoe64/graphview/compatible/package-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.jjoe64.graphview.compatible Class Hierarchy 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 51 | 54 | 55 | 56 | 57 | 60 | 76 | 77 |
52 | 53 |
78 | 79 | 80 | 81 |
82 |
83 |

84 | Hierarchy For Package com.jjoe64.graphview.compatible 85 |

86 |
87 |
88 |
Package Hierarchies:
All Packages
89 |
90 |

91 | Class Hierarchy 92 |

93 | 99 |

100 | Interface Hierarchy 101 |

102 | 104 |
105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 127 | 130 | 131 | 132 | 133 | 136 | 152 | 153 |
128 | 129 |
154 | 155 | 156 | 157 |
158 | 159 | 160 | 161 | -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | 3 | Version 3, 29 June 2007 4 | 5 | Copyright © 2007 Free Software Foundation, Inc. 6 | 7 | Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. 8 | 9 | This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. 10 | 11 | 0. Additional Definitions. 12 | As used herein, “this License” refers to version 3 of the GNU Lesser General Public License, and the “GNU GPL” refers to version 3 of the GNU General Public License. 13 | 14 | “The Library” refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. 15 | 16 | An “Application” is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. 17 | 18 | A “Combined Work” is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the “Linked Version”. 19 | 20 | The “Minimal Corresponding Source” for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. 21 | 22 | The “Corresponding Application Code” for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. 23 | 24 | 1. Exception to Section 3 of the GNU GPL. 25 | You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. 26 | 27 | 2. Conveying Modified Versions. 28 | If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: 29 | 30 | a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or 31 | b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. 32 | 3. Object Code Incorporating Material from Library Header Files. 33 | The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: 34 | 35 | a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. 36 | b) Accompany the object code with a copy of the GNU GPL and this license document. 37 | 4. Combined Works. 38 | You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: 39 | 40 | a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. 41 | b) Accompany the Combined Work with a copy of the GNU GPL and this license document. 42 | c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. 43 | d) Do one of the following: 44 | 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. 45 | 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. 46 | e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) 47 | 5. Combined Libraries. 48 | You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: 49 | 50 | a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. 51 | b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 52 | 6. Revised Versions of the GNU Lesser General Public License. 53 | The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. 54 | 55 | Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. 56 | 57 | If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. -------------------------------------------------------------------------------- /doc/com/jjoe64/graphview/compatible/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.jjoe64.graphview.compatible 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 51 | 54 | 55 | 56 | 57 | 60 | 76 | 77 |
52 | 53 |
78 | 79 | 80 | 81 |
82 |

83 | Package com.jjoe64.graphview.compatible 84 |

85 | 86 | 87 | 88 | 90 | 91 | 92 | 93 | 94 | 95 |
89 | Interface Summary
ScaleGestureDetector.SimpleOnScaleGestureListener 
96 |   97 | 98 |

99 | 100 | 101 | 102 | 104 | 105 | 106 | 107 |
103 | Class Summary
RealScaleGestureDetector
108 |
109 |
110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 132 | 135 | 136 | 137 | 138 | 141 | 157 | 158 |
133 | 134 |
159 | 160 | 161 | 162 |
163 | 164 | 165 | 166 | -------------------------------------------------------------------------------- /doc/index-files/index-3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | G-Index 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 50 | 53 | 54 | 55 | 56 | 59 | 75 | 76 |
51 | 52 |
77 | 78 | 79 | 80 | C F G I S
81 |

82 | G

83 |
84 |
getDrawBackground() - 85 | Method in class com.jjoe64.graphview.GraphView 86 |
  87 |
GraphView - Class in com.jjoe64.graphview
GraphView creates a scaled line graph with x and y axis labels.
GraphView(Context, GraphView.GraphViewData[], String, String[], String[]) - 88 | Constructor for class com.jjoe64.graphview.GraphView 89 |
  90 |
GraphView.GraphViewData - Class in com.jjoe64.graphview
one data set for the graph
GraphView.GraphViewData(double, double) - 91 | Constructor for class com.jjoe64.graphview.GraphView.GraphViewData 92 |
  93 |
94 |
95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 116 | 119 | 120 | 121 | 122 | 125 | 141 | 142 |
117 | 118 |
143 | 144 | 145 | 146 | C F G I S
147 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /doc/com/jjoe64/graphview/class-use/GraphView.GraphViewData.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Uses of Class com.jjoe64.graphview.GraphView.GraphViewData 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 50 | 53 | 54 | 55 | 56 | 59 | 75 | 76 |
51 | 52 |
77 | 78 | 79 | 80 |
81 |
82 |

83 | Uses of Class
com.jjoe64.graphview.GraphView.GraphViewData

84 |
85 | 86 | 87 | 88 | 90 | 91 |
89 | Uses of GraphView.GraphViewData in com.jjoe64.graphview
92 |   93 |

94 | 95 | 96 | 97 | 98 | 99 | 100 | 108 | 109 |
Constructors in com.jjoe64.graphview with parameters of type GraphView.GraphViewData
GraphView(Context context, 101 | GraphView.GraphViewData[] values, 102 | java.lang.String title, 103 | java.lang.String[] horlabels, 104 | java.lang.String[] verlabels) 105 | 106 |
107 |            
110 |   111 |

112 |


113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 134 | 137 | 138 | 139 | 140 | 143 | 159 | 160 |
135 | 136 |
161 | 162 | 163 | 164 |
165 | 166 | 167 | 168 | -------------------------------------------------------------------------------- /doc/com/jjoe64/graphview/package-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.jjoe64.graphview Class Hierarchy 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 51 | 54 | 55 | 56 | 57 | 60 | 76 | 77 |
52 | 53 |
78 | 79 | 80 | 81 |
82 |
83 |

84 | Hierarchy For Package com.jjoe64.graphview 85 |

86 |
87 |
88 |
Package Hierarchies:
All Packages
89 |
90 |

91 | Class Hierarchy 92 |

93 | 102 |

103 | Interface Hierarchy 104 |

105 | 107 |

108 | Enum Hierarchy 109 |

110 |
    111 |
  • java.lang.Object
      112 |
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable) 113 | 115 |
    116 |
117 |
118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 140 | 143 | 144 | 145 | 146 | 149 | 165 | 166 |
141 | 142 |
167 | 168 | 169 | 170 |
171 | 172 | 173 | 174 | -------------------------------------------------------------------------------- /doc/com/jjoe64/graphview/ValueDependentColor.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | ValueDependentColor 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 51 | 54 | 55 | 56 | 57 | 60 | 76 | 77 | 78 | 80 | 82 | 83 |
52 | 53 |
84 | 85 | 86 | 87 |
88 | 89 |

90 | 91 | com.jjoe64.graphview 92 |
93 | Interface ValueDependentColor

94 |
95 |
96 |
public interface ValueDependentColor
97 | 98 | 99 |

100 | you can change the color depending on the value. 101 | takes only effect in BarGraphView 102 |

103 | 104 |

105 |


106 | 107 |

108 | 109 | 110 | 111 | 112 | 113 | 114 | 116 | 117 | 118 | 120 | 124 | 125 |
115 | Method Summary
119 |  intget(GraphViewDataInterface data) 121 | 122 |
123 |            
126 |   127 |

128 | 129 | 130 | 131 | 132 | 133 | 134 | 136 | 137 |
135 | Method Detail
138 | 139 |

140 | get

141 |
142 | int get(GraphViewDataInterface data)
143 |
144 |
145 |
146 |
147 |
148 | 149 |
150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 172 | 175 | 176 | 177 | 178 | 181 | 197 | 198 | 199 | 201 | 203 | 204 |
173 | 174 |
205 | 206 | 207 | 208 |
209 | 210 | 211 | 212 | -------------------------------------------------------------------------------- /doc/com/jjoe64/graphview/GraphViewDataInterface.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | GraphViewDataInterface 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 51 | 54 | 55 | 56 | 57 | 60 | 76 | 77 | 78 | 80 | 82 | 83 |
52 | 53 |
84 | 85 | 86 | 87 |
88 | 89 |

90 | 91 | com.jjoe64.graphview 92 |
93 | Interface GraphViewDataInterface

94 |
95 |
All Known Implementing Classes:
GraphView.GraphViewData
96 |
97 |
98 |
99 |
public interface GraphViewDataInterface
100 | 101 | 102 |

103 | the base interface for the graphview data. 104 | you can use your own data models, when they implement 105 | this interface. 106 |

107 | 108 |

109 |


110 | 111 |

112 | 113 | 114 | 115 | 116 | 117 | 118 | 120 | 121 | 122 | 124 | 128 | 129 | 130 | 132 | 136 | 137 |
119 | Method Summary
123 |  doublegetX() 125 | 126 |
127 |            
131 |  doublegetY() 133 | 134 |
135 |            
138 |   139 |

140 | 141 | 142 | 143 | 144 | 145 | 146 | 148 | 149 |
147 | Method Detail
150 | 151 |

152 | getX

153 |
154 | double getX()
155 |
156 |
157 |
158 |
159 |
160 |
161 | 162 |

163 | getY

164 |
165 | double getY()
166 |
167 |
168 |
169 |
170 |
171 | 172 |
173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 195 | 198 | 199 | 200 | 201 | 204 | 220 | 221 | 222 | 224 | 226 | 227 |
196 | 197 |
228 | 229 | 230 | 231 |
232 | 233 | 234 | 235 | -------------------------------------------------------------------------------- /doc/com/jjoe64/graphview/compatible/ScaleGestureDetector.SimpleOnScaleGestureListener.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | ScaleGestureDetector.SimpleOnScaleGestureListener 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 51 | 54 | 55 | 56 | 57 | 60 | 76 | 77 | 78 | 80 | 82 | 83 |
52 | 53 |
84 | 85 | 86 | 87 |
88 | 89 |

90 | 91 | com.jjoe64.graphview.compatible 92 |
93 | Interface ScaleGestureDetector.SimpleOnScaleGestureListener

94 |
95 |
Enclosing class:
ScaleGestureDetector
96 |
97 |
98 |
99 |
public static interface ScaleGestureDetector.SimpleOnScaleGestureListener
100 | 101 | 102 |

103 |


104 | 105 |

106 | 107 | 108 | 109 | 110 | 111 | 112 | 114 | 115 | 116 | 118 | 122 | 123 |
113 | Method Summary
117 |  booleanonScale(ScaleGestureDetector detector) 119 | 120 |
121 |            
124 |   125 |

126 | 127 | 128 | 129 | 130 | 131 | 132 | 134 | 135 |
133 | Method Detail
136 | 137 |

138 | onScale

139 |
140 | boolean onScale(ScaleGestureDetector detector)
141 |
142 |
143 |
144 |
145 |
146 | 147 |
148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 170 | 173 | 174 | 175 | 176 | 179 | 195 | 196 | 197 | 199 | 201 | 202 |
171 | 172 |
203 | 204 | 205 | 206 |
207 | 208 | 209 | 210 | -------------------------------------------------------------------------------- /doc/com/jjoe64/graphview/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.jjoe64.graphview 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 51 | 54 | 55 | 56 | 57 | 60 | 76 | 77 |
52 | 53 |
78 | 79 | 80 | 81 |
82 |

83 | Package com.jjoe64.graphview 84 |

85 | 86 | 87 | 88 | 90 | 91 | 92 | 93 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 |
89 | Interface Summary
CustomLabelFormatterif you want to show different labels, 94 | you can use this label formatter.
GraphViewDataInterfacethe base interface for the graphview data.
ValueDependentColoryou can change the color depending on the value.
105 |   106 | 107 |

108 | 109 | 110 | 111 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 138 | 139 | 140 | 141 | 142 | 143 |
112 | Class Summary
BarGraphViewDraws a Bar Chart
GraphViewGraphView is a Android View for creating zoomable and scrollable graphs.
GraphView.GraphViewDataone data set for a graph series
GraphViewSeriesa graphview series.
GraphViewSeries.GraphViewSeriesStylegraph series style: color and thickness
GraphViewStyleStyles for the GraphView 137 | Important: Use GraphViewSeries.GraphViewSeriesStyle for series-specify styling
LineGraphViewLine Graph View.
144 |   145 | 146 |

147 | 148 | 149 | 150 | 152 | 153 | 154 | 155 | 156 | 157 |
151 | Enum Summary
GraphView.LegendAlign 
158 |   159 | 160 |

161 |

162 |
163 |
164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 186 | 189 | 190 | 191 | 192 | 195 | 211 | 212 |
187 | 188 |
213 | 214 | 215 | 216 |
217 | 218 | 219 | 220 | -------------------------------------------------------------------------------- /doc/help-doc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | API Help 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 50 | 53 | 54 | 55 | 56 | 59 | 75 | 76 |
51 | 52 |
77 | 78 | 79 | 80 |
81 |
82 |

83 | How This API Document Is Organized

84 |
85 | This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.

86 | Package

87 |
88 | 89 |

90 | Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:

    91 |
  • Interfaces (italic)
  • Classes
  • Enums
  • Exceptions
  • Errors
  • Annotation Types
92 |
93 |

94 | Class/Interface

95 |
96 | 97 |

98 | Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    99 |
  • Class inheritance diagram
  • Direct Subclasses
  • All Known Subinterfaces
  • All Known Implementing Classes
  • Class/interface declaration
  • Class/interface description 100 |

    101 |

  • Nested Class Summary
  • Field Summary
  • Constructor Summary
  • Method Summary 102 |

    103 |

  • Field Detail
  • Constructor Detail
  • Method Detail
104 | Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
105 | 106 |

107 | Annotation Type

108 |
109 | 110 |

111 | Each annotation type has its own separate page with the following sections:

    112 |
  • Annotation Type declaration
  • Annotation Type description
  • Required Element Summary
  • Optional Element Summary
  • Element Detail
113 |
114 | 115 |

116 | Enum

117 |
118 | 119 |

120 | Each enum has its own separate page with the following sections:

    121 |
  • Enum declaration
  • Enum description
  • Enum Constant Summary
  • Enum Constant Detail
122 |
123 |

124 | Use

125 |
126 | Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.
127 |

128 | Tree (Class Hierarchy)

129 |
130 | There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.
    131 |
  • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
  • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
132 |
133 |

134 | Deprecated API

135 |
136 | The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
137 |

138 | Index

139 |
140 | The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
141 |

142 | Prev/Next

143 | These links take you to the next or previous class, interface, package, or related page.

144 | Frames/No Frames

145 | These links show and hide the HTML frames. All pages are available with or without frames. 146 |

147 |

148 | Serialized Form

149 | Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description. 150 |

151 |

152 | Constant Field Values

153 | The Constant Field Values page lists the static final fields and their values. 154 |

155 | 156 | 157 | This help file applies to API documentation generated using the standard doclet. 158 | 159 |
160 |


161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 182 | 185 | 186 | 187 | 188 | 191 | 207 | 208 |
183 | 184 |
209 | 210 | 211 | 212 |
213 | 214 | 215 | 216 | -------------------------------------------------------------------------------- /doc/com/jjoe64/graphview/CustomLabelFormatter.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | CustomLabelFormatter 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 51 | 54 | 55 | 56 | 57 | 60 | 76 | 77 | 78 | 80 | 82 | 83 |
52 | 53 |
84 | 85 | 86 | 87 |
88 | 89 |

90 | 91 | com.jjoe64.graphview 92 |
93 | Interface CustomLabelFormatter

94 |
95 |
96 |
public interface CustomLabelFormatter
97 | 98 | 99 |

100 | if you want to show different labels, 101 | you can use this label formatter. 102 | As Input you get the raw value (x or y) and 103 | you return a String that will be displayed. 104 | graphView.setCustomLabelFormatter(new CustomLabelFormatter() { 105 | public String formatLabel(double value, boolean isValueX) { 106 | if (isValueX) { 107 | if (value < 5) { 108 | return "small"; 109 | } else if (value < 15) { 110 | return "middle"; 111 | } else { 112 | return "big"; 113 | } 114 | } 115 | return null; // let graphview generate Y-axis label for us 116 | } 117 | }); 118 | 119 |

120 | 121 |

122 |


123 | 124 |

125 | 126 | 127 | 128 | 129 | 130 | 131 | 133 | 134 | 135 | 137 | 142 | 143 |
132 | Method Summary
136 |  java.lang.StringformatLabel(double value, 138 | boolean isValueX) 139 | 140 |
141 |           will be called when the labels were generated
144 |   145 |

146 | 147 | 148 | 149 | 150 | 151 | 152 | 154 | 155 |
153 | Method Detail
156 | 157 |

158 | formatLabel

159 |
160 | java.lang.String formatLabel(double value,
161 |                              boolean isValueX)
162 |
163 |
will be called when the labels were generated 164 |

165 |

166 |
Parameters:
value - the raw input value (x or y)
isValueX - true if value is a x-value, false if otherwise 167 |
Returns:
the string that will be displayed. return null if you want graphview to generate the label for you.
168 |
169 |
170 | 171 |
172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 194 | 197 | 198 | 199 | 200 | 203 | 219 | 220 | 221 | 223 | 225 | 226 |
195 | 196 |
227 | 228 | 229 | 230 |
231 | 232 | 233 | 234 | -------------------------------------------------------------------------------- /doc/com/jjoe64/graphview/compatible/RealScaleGestureDetector.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | RealScaleGestureDetector 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 51 | 54 | 55 | 56 | 57 | 60 | 76 | 77 | 78 | 80 | 82 | 83 |
52 | 53 |
84 | 85 | 86 | 87 |
88 | 89 |

90 | 91 | com.jjoe64.graphview.compatible 92 |
93 | Class RealScaleGestureDetector

94 |
 95 | java.lang.Object
 96 |   extended by com.jjoe64.graphview.compatible.ScaleGestureDetector
 97 |       extended by com.jjoe64.graphview.compatible.RealScaleGestureDetector
 98 | 
99 |
100 |
101 |

102 | 103 |

104 | 105 | 106 | 107 | 108 | 109 | 111 | 112 |
110 | Nested Class Summary
113 |   114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 |
Nested classes/interfaces inherited from class com.jjoe64.graphview.compatible.ScaleGestureDetector
ScaleGestureDetector.SimpleOnScaleGestureListener
122 |   123 | 124 | 125 | 126 | 127 | 128 | 129 | 131 | 132 | 133 |
130 | Constructor Summary
RealScaleGestureDetector(Context context, 134 | ScaleGestureDetector fakeScaleGestureDetector, 135 | ScaleGestureDetector.SimpleOnScaleGestureListener fakeListener) 136 | 137 |
138 |            139 | 140 | 141 | 142 | 143 | 144 | 146 | 147 |
145 | Method Summary
148 |   149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 |
Methods inherited from class com.jjoe64.graphview.compatible.ScaleGestureDetector
getScaleFactor, isInProgress, onTouchEvent
157 |   158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 |
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
166 |   167 |

168 | 169 | 170 | 171 | 172 | 173 | 174 | 176 | 177 |
175 | Constructor Detail
178 | 179 |

180 | RealScaleGestureDetector

181 |
182 | public RealScaleGestureDetector(Context context,
183 |                                 ScaleGestureDetector fakeScaleGestureDetector,
184 |                                 ScaleGestureDetector.SimpleOnScaleGestureListener fakeListener)
185 |
186 |
187 | 188 |
189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 211 | 214 | 215 | 216 | 217 | 220 | 236 | 237 | 238 | 240 | 242 | 243 |
212 | 213 |
244 | 245 | 246 | 247 |
248 | 249 | 250 | 251 | --------------------------------------------------------------------------------