Showing preview only (597K chars total). Download the full file or copy to clipboard to get everything.
Repository: lecho/hellocharts-android
Branch: master
Commit: c41419c9afa0
Files: 180
Total size: 543.8 KB
Directory structure:
gitextract__p4swg7a/
├── .gitignore
├── LICENSE.txt
├── README.md
├── build.gradle
├── documentation/
│ └── MAIN.md
├── formatter/
│ └── CodeStyle-HelloCharts.jar
├── gradle/
│ └── wrapper/
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── hellocharts-library/
│ ├── AndroidManifest.xml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── libs/
│ │ └── android-support-v4.jar
│ ├── pom.xml
│ ├── proguard-project.txt
│ ├── project.properties
│ ├── res/
│ │ ├── values/
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ │ ├── values-v11/
│ │ │ └── styles.xml
│ │ └── values-v14/
│ │ └── styles.xml
│ └── src/
│ └── lecho/
│ └── lib/
│ └── hellocharts/
│ ├── animation/
│ │ ├── ChartAnimationListener.java
│ │ ├── ChartDataAnimator.java
│ │ ├── ChartDataAnimatorV14.java
│ │ ├── ChartDataAnimatorV8.java
│ │ ├── ChartViewportAnimator.java
│ │ ├── ChartViewportAnimatorV14.java
│ │ ├── ChartViewportAnimatorV8.java
│ │ ├── DummyChartAnimationListener.java
│ │ ├── PieChartRotationAnimator.java
│ │ ├── PieChartRotationAnimatorV14.java
│ │ └── PieChartRotationAnimatorV8.java
│ ├── computator/
│ │ ├── ChartComputator.java
│ │ └── PreviewChartComputator.java
│ ├── formatter/
│ │ ├── AxisValueFormatter.java
│ │ ├── BubbleChartValueFormatter.java
│ │ ├── ColumnChartValueFormatter.java
│ │ ├── LineChartValueFormatter.java
│ │ ├── PieChartValueFormatter.java
│ │ ├── SimpleAxisValueFormatter.java
│ │ ├── SimpleBubbleChartValueFormatter.java
│ │ ├── SimpleColumnChartValueFormatter.java
│ │ ├── SimpleLineChartValueFormatter.java
│ │ ├── SimplePieChartValueFormatter.java
│ │ └── ValueFormatterHelper.java
│ ├── gesture/
│ │ ├── ChartScroller.java
│ │ ├── ChartTouchHandler.java
│ │ ├── ChartZoomer.java
│ │ ├── ContainerScrollType.java
│ │ ├── PieChartTouchHandler.java
│ │ ├── PreviewChartTouchHandler.java
│ │ ├── ZoomType.java
│ │ └── ZoomerCompat.java
│ ├── listener/
│ │ ├── BubbleChartOnValueSelectListener.java
│ │ ├── ColumnChartOnValueSelectListener.java
│ │ ├── ComboLineColumnChartOnValueSelectListener.java
│ │ ├── DummyBubbleChartOnValueSelectListener.java
│ │ ├── DummyColumnChartOnValueSelectListener.java
│ │ ├── DummyCompoLineColumnChartOnValueSelectListener.java
│ │ ├── DummyLineChartOnValueSelectListener.java
│ │ ├── DummyPieChartOnValueSelectListener.java
│ │ ├── DummyVieportChangeListener.java
│ │ ├── LineChartOnValueSelectListener.java
│ │ ├── OnValueDeselectListener.java
│ │ ├── PieChartOnValueSelectListener.java
│ │ └── ViewportChangeListener.java
│ ├── model/
│ │ ├── AbstractChartData.java
│ │ ├── Axis.java
│ │ ├── AxisValue.java
│ │ ├── BubbleChartData.java
│ │ ├── BubbleValue.java
│ │ ├── ChartData.java
│ │ ├── Column.java
│ │ ├── ColumnChartData.java
│ │ ├── ComboLineColumnChartData.java
│ │ ├── Line.java
│ │ ├── LineChartData.java
│ │ ├── PieChartData.java
│ │ ├── PointValue.java
│ │ ├── SelectedValue.java
│ │ ├── SliceValue.java
│ │ ├── SubcolumnValue.java
│ │ ├── ValueShape.java
│ │ └── Viewport.java
│ ├── provider/
│ │ ├── BubbleChartDataProvider.java
│ │ ├── ColumnChartDataProvider.java
│ │ ├── ComboLineColumnChartDataProvider.java
│ │ ├── LineChartDataProvider.java
│ │ └── PieChartDataProvider.java
│ ├── renderer/
│ │ ├── AbstractChartRenderer.java
│ │ ├── AxesRenderer.java
│ │ ├── BubbleChartRenderer.java
│ │ ├── ChartRenderer.java
│ │ ├── ColumnChartRenderer.java
│ │ ├── ComboChartRenderer.java
│ │ ├── ComboLineColumnChartRenderer.java
│ │ ├── LineChartRenderer.java
│ │ ├── PieChartRenderer.java
│ │ ├── PreviewColumnChartRenderer.java
│ │ └── PreviewLineChartRenderer.java
│ ├── util/
│ │ ├── AxisAutoValues.java
│ │ ├── ChartUtils.java
│ │ └── FloatUtils.java
│ └── view/
│ ├── AbstractChartView.java
│ ├── BubbleChartView.java
│ ├── Chart.java
│ ├── ColumnChartView.java
│ ├── ComboLineColumnChartView.java
│ ├── LineChartView.java
│ ├── PieChartView.java
│ ├── PreviewColumnChartView.java
│ ├── PreviewLineChartView.java
│ └── hack/
│ ├── HackyDrawerLayout.java
│ └── HackyViewPager.java
├── hellocharts-samples/
│ ├── AndroidManifest.xml
│ ├── build.gradle
│ ├── proguard-project.txt
│ ├── project.properties
│ ├── res/
│ │ ├── color/
│ │ │ └── selector_text_link.xml
│ │ ├── layout/
│ │ │ ├── activity_about.xml
│ │ │ ├── activity_bubble_chart.xml
│ │ │ ├── activity_column_chart.xml
│ │ │ ├── activity_combo_line_column_chart.xml
│ │ │ ├── activity_good_bad.xml
│ │ │ ├── activity_line_chart.xml
│ │ │ ├── activity_line_column_dependency.xml
│ │ │ ├── activity_main.xml
│ │ │ ├── activity_pie_chart.xml
│ │ │ ├── activity_preview_column_chart.xml
│ │ │ ├── activity_preview_line_chart.xml
│ │ │ ├── activity_tempo_chart.xml
│ │ │ ├── activity_view_pager_charts.xml
│ │ │ ├── fragment_about.xml
│ │ │ ├── fragment_bubble_chart.xml
│ │ │ ├── fragment_column_chart.xml
│ │ │ ├── fragment_combo_line_column_chart.xml
│ │ │ ├── fragment_good_bad.xml
│ │ │ ├── fragment_line_chart.xml
│ │ │ ├── fragment_line_column_dependency.xml
│ │ │ ├── fragment_main.xml
│ │ │ ├── fragment_pie_chart.xml
│ │ │ ├── fragment_preview_column_chart.xml
│ │ │ ├── fragment_preview_line_chart.xml
│ │ │ ├── fragment_tempo_chart.xml
│ │ │ ├── fragment_view_pager_charts.xml
│ │ │ └── list_item_sample.xml
│ │ ├── menu/
│ │ │ ├── bubble_chart.xml
│ │ │ ├── column_chart.xml
│ │ │ ├── combo_line_column_chart.xml
│ │ │ ├── line_chart.xml
│ │ │ ├── main.xml
│ │ │ ├── pie_chart.xml
│ │ │ ├── preview_column_chart.xml
│ │ │ ├── preview_line_chart.xml
│ │ │ └── tempo_chart.xml
│ │ ├── values/
│ │ │ ├── colors.xml
│ │ │ ├── dimens.xml
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ │ ├── values-land/
│ │ │ └── dimens.xml
│ │ ├── values-sw600dp/
│ │ │ └── dimens.xml
│ │ ├── values-v11/
│ │ │ └── styles.xml
│ │ ├── values-v14/
│ │ │ └── styles.xml
│ │ └── values-w820dp/
│ │ └── dimens.xml
│ └── src/
│ └── lecho/
│ └── lib/
│ └── hellocharts/
│ └── samples/
│ ├── AboutActivity.java
│ ├── BubbleChartActivity.java
│ ├── ColumnChartActivity.java
│ ├── ComboLineColumnChartActivity.java
│ ├── GoodBadChartActivity.java
│ ├── LineChartActivity.java
│ ├── LineColumnDependencyActivity.java
│ ├── MainActivity.java
│ ├── PieChartActivity.java
│ ├── PreviewColumnChartActivity.java
│ ├── PreviewLineChartActivity.java
│ ├── SpeedChartActivity.java
│ ├── TempoChartActivity.java
│ └── ViewPagerChartsActivity.java
└── settings.gradle
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# built application files
*.apk
*.ap_
# files for the dex VM
*.dex
# Java class files
*.class
# generated files
bin/
gen/
build/
target/
# Local configuration file (sdk path, etc)
local.properties
# Eclipse project files
.classpath
.project
.settings
# Proguard folder generated by Eclipse
proguard/
# Intellij project files
*.iml
*.ipr
*.iws
.idea/
/.settings
/.gradle
================================================
FILE: LICENSE.txt
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: README.md
================================================
# HelloCharts for Android
Charting library for Android compatible with API 8+(Android 2.2).
Works best when hardware acceleration is available, so API 14+(Android 4.0) is recommended.
Apache License 2.0.
[](https://android-arsenal.com/details/1/1068)
<a href="https://scan.coverity.com/projects/4121">
<img alt="Coverity Scan Build Status"
src="https://scan.coverity.com/projects/4121/badge.svg"/>
</a>
[](https://maven-badges.herokuapp.com/maven-central/com.github.lecho/hellocharts-library)
[](https://jitpack.io/#lecho/hellocharts-android)
## Features
- Line chart(cubic lines, filled lines, scattered points)
- Column chart(grouped, stacked, negative values)
- Pie chart
- Bubble chart
- Combo chart(columns/lines)
- Preview charts(for column chart and line chart)
- Zoom(pinch to zoom, double tap zoom), scroll and fling
- Custom and auto-generated axes(top, bottom, left, right, inside)
- Animations
## Screens and Demos
- Code of a demo application is in `hellocharts-samples` directory, requires appcompat v21.
- The **demo app** is also ready for download on [**Google Play**](https://play.google.com/store/apps/details?id=lecho.lib.hellocharts.samples).
- Short **video** is available on [**YouTube**](https://www.youtube.com/watch?v=xbSBjyjH2SY).







## Download and Import
#### Android Studio/Gradle
- Maven Central/jCenter, add dependency to your `build.gradle`:
```groovy
dependencies{
compile 'com.github.lecho:hellocharts-library:1.5.8@aar'
}
```
- JitPack.io, add `jitpack.io` repositiory and dependency to your `build.gradle`:
```groovy
repositories {
maven {
url "https://jitpack.io"
}
}
dependencies {
compile 'com.github.lecho:hellocharts-android:v1.5.8'
}
```
#### Eclipse/ADT
- Download the latest [release jar file](https://github.com/lecho/hellocharts-android/releases).
- Copy `hellocharts-library-<version>.jar` into the `libs` folder of your application project.
## Usage
Every chart view can be defined in layout xml file:
```xml
<lecho.lib.hellocharts.view.LineChartView
android:id="@+id/chart"
android:layout_width="match_parent"
android:layout_height="match_parent" />
```
or created in code and added to layout later:
```java
LineChartView chart = new LineChartView(context);
layout.addView(chart);
```
Use methods from *Chart classes to define chart behaviour, example methods:
```java
Chart.setInteractive(boolean isInteractive);
Chart.setZoomType(ZoomType zoomType);
Chart.setContainerScrollEnabled(boolean isEnabled, ContainerScrollType type);
```
Use methods from data models to define how chart looks like, example methods:
```java
ChartData.setAxisXBottom(Axis axisX);
ColumnChartData.setStacked(boolean isStacked);
Line.setStrokeWidth(int strokeWidthDp);
```
Every chart has its own method to set chart data and its own data model, example for line chart:
```java
List<PointValue> values = new ArrayList<PointValue>();
values.add(new PointValue(0, 2));
values.add(new PointValue(1, 4));
values.add(new PointValue(2, 3));
values.add(new PointValue(3, 4));
//In most cased you can call data model methods in builder-pattern-like manner.
Line line = new Line(values).setColor(Color.BLUE).setCubic(true);
List<Line> lines = new ArrayList<Line>();
lines.add(line);
LineChartData data = new LineChartData();
data.setLines(lines);
LineChartView chart = new LineChartView(context);
chart.setLineChartData(data);
```
After the chart data has been set you can still modify its attributes but right after that you should call
`set*ChartData()` method again to let chart recalculate and redraw data. There is also an option to use copy constructor for deep copy of
chart data. You can safely modify copy in other threads and pass it to `set*ChartData()` method later.
## Contributing
Yes:) If you found a bug, have an idea how to improve library or have a question, please create new issue or comment existing one. If you would like to contribute code fork the repository and send a pull request.
# License
HelloCharts
Copyright 2014 Leszek Wach
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
---
HelloCharts library uses code from InteractiveChart sample available
on Android Developers page:
http://developer.android.com/training/gestures/scale.html
================================================
FILE: build.gradle
================================================
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
}
}
================================================
FILE: documentation/MAIN.md
================================================
================================================
FILE: gradle/wrapper/gradle-wrapper.properties
================================================
#Wed Apr 10 15:27:10 PDT 2013
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-2.2.1-all.zip
================================================
FILE: gradle.properties
================================================
VERSION_NAME=1.5.8
VERSION_CODE=13
GROUP=com.github.lecho
POM_DESCRIPTION=Charting library for Android compatible with API 8+(Android 2.2).
POM_URL=https://github.com/lecho/hellocharts-android
POM_SCM_URL=https://github.com/lecho/hellocharts-android
POM_SCM_CONNECTION=scm:git@github.com:lecho/hellocharts-android.git
POM_SCM_DEV_CONNECTION=scm:git@github.com:lecho/hellocharts-android.git
POM_LICENCE_NAME=The Apache Software License, Version 2.0
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=lecho
POM_DEVELOPER_NAME=Leszek Wach
ANDROID_BUILD_MIN_SDK_VERSION=8
ANDROID_BUILD_TARGET_SDK_VERSION=23
ANDROID_BUILD_TOOLS_VERSION=23.0.3
ANDROID_BUILD_SDK_VERSION=23
================================================
FILE: gradlew
================================================
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
================================================
FILE: gradlew.bat
================================================
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
================================================
FILE: hellocharts-library/AndroidManifest.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="lecho.lib.hellocharts"
android:versionCode="13"
android:versionName="1.5.8" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="22" />
</manifest>
================================================
FILE: hellocharts-library/build.gradle
================================================
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
apply from: 'https://raw.github.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle'
//To upload to maven central
//http://zserge.com/blog/gradle-maven-publish.html
//gradle uploadArchives
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
}
}
dependencies {
//compile fileTree(dir: 'libs', include: '*.jar')
compile 'com.android.support:support-v4:23.4.0'
}
android {
compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)
buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
defaultConfig {
minSdkVersion Integer.parseInt(project.ANDROID_BUILD_MIN_SDK_VERSION)
targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION)
versionCode Integer.parseInt(project.VERSION_CODE)
versionName project.VERSION_NAME
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
}
//Execute "gradle clean jarRelease" to cook jar.
android.libraryVariants.all { variant ->
def name = variant.buildType.name
if (name.equals(com.android.builder.core.BuilderConstants.DEBUG)) {
return; // Skip debug builds.
}
def task = project.tasks.create "jar${name.capitalize()}", Jar
task.dependsOn variant.javaCompile
task.from variant.javaCompile.destinationDir
artifacts.add('archives', task);
}
// To publish to maven local execute "gradle clean build publishToMavenLocal"
// To publish to nexus execute "gradle clean build publish"
android.libraryVariants
publishing {
publications {
maven(MavenPublication) {
artifact "${project.buildDir}/outputs/aar/${project.name}-release.aar"
artifactId = POM_ARTIFACT_ID
groupId = GROUP
version = VERSION_NAME
// Task androidSourcesJar is provided by gradle-mvn-push.gradle
//artifact androidSourcesJar {
// classifier "sources"
//}
}
}
repositories {
maven {
credentials {
username 'nexusUser'
password 'nexusPass'
}
url "http://your-nexus-url/"
}
}
}
================================================
FILE: hellocharts-library/gradle.properties
================================================
POM_NAME=HelloCharts Library for Android
POM_ARTIFACT_ID=hellocharts-library
POM_PACKAGING=aar
================================================
FILE: hellocharts-library/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>lecho.lib.hellocharts</groupId>
<artifactId>hellocharts-library</artifactId>
<name>HelloCharts Android</name>
<version>1.0</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<android.version>4.4</android.version>
<support.version>19</support.version>
</properties>
<dependencies>
<!--Upload android.jar(sdk\platforms\android-19 with version 4.4 in pom.xml) and android-support-v4.jar(sdk\extras\android\support\v4 with version 19 in pom.xml)-->
<!--to your local maven repository to use maven build.-->
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>${android.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.android.support</groupId>
<artifactId>support-v4</artifactId>
<version>${support.version}</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
<licenses>
<license>
<name>Apache License Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
<distribution>repo</distribution>
</license>
</licenses>
</project>
================================================
FILE: hellocharts-library/proguard-project.txt
================================================
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
================================================
FILE: hellocharts-library/project.properties
================================================
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
target=android-21
android.library=true
================================================
FILE: hellocharts-library/res/values/strings.xml
================================================
<resources>
</resources>
================================================
FILE: hellocharts-library/res/values/styles.xml
================================================
<resources>
</resources>
================================================
FILE: hellocharts-library/res/values-v11/styles.xml
================================================
<resources>
</resources>
================================================
FILE: hellocharts-library/res/values-v14/styles.xml
================================================
<resources>
</resources>
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/animation/ChartAnimationListener.java
================================================
package lecho.lib.hellocharts.animation;
import java.util.EventListener;
/**
* Listener used to listen for chart animation start and stop events. Implementations of this interface can be used for
* all types of chart animations(data, viewport, PieChart rotation).
*/
public interface ChartAnimationListener extends EventListener {
public void onAnimationStarted();
public void onAnimationFinished();
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/animation/ChartDataAnimator.java
================================================
package lecho.lib.hellocharts.animation;
public interface ChartDataAnimator {
public static final long DEFAULT_ANIMATION_DURATION = 500;
public void startAnimation(long duration);
public void cancelAnimation();
public boolean isAnimationStarted();
public void setChartAnimationListener(ChartAnimationListener animationListener);
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/animation/ChartDataAnimatorV14.java
================================================
package lecho.lib.hellocharts.animation;
import android.animation.Animator;
import android.animation.Animator.AnimatorListener;
import android.animation.ValueAnimator;
import android.animation.ValueAnimator.AnimatorUpdateListener;
import android.annotation.SuppressLint;
import lecho.lib.hellocharts.view.Chart;
@SuppressLint("NewApi")
public class ChartDataAnimatorV14 implements ChartDataAnimator, AnimatorListener, AnimatorUpdateListener {
private final Chart chart;
private ValueAnimator animator;
private ChartAnimationListener animationListener = new DummyChartAnimationListener();
public ChartDataAnimatorV14(Chart chart) {
this.chart = chart;
animator = ValueAnimator.ofFloat(0.0f, 1.0f);
animator.addListener(this);
animator.addUpdateListener(this);
}
@Override
public void startAnimation(long duration) {
if (duration >= 0) {
animator.setDuration(duration);
} else {
animator.setDuration(DEFAULT_ANIMATION_DURATION);
}
animator.start();
}
@Override
public void cancelAnimation() {
animator.cancel();
}
@Override
public void onAnimationUpdate(ValueAnimator animation) {
chart.animationDataUpdate(animation.getAnimatedFraction());
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
chart.animationDataFinished();
animationListener.onAnimationFinished();
}
@Override
public void onAnimationRepeat(Animator animation) {
}
@Override
public void onAnimationStart(Animator animation) {
animationListener.onAnimationStarted();
}
@Override
public boolean isAnimationStarted() {
return animator.isStarted();
}
@Override
public void setChartAnimationListener(ChartAnimationListener animationListener) {
if (null == animationListener) {
this.animationListener = new DummyChartAnimationListener();
} else {
this.animationListener = animationListener;
}
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/animation/ChartDataAnimatorV8.java
================================================
package lecho.lib.hellocharts.animation;
import android.os.Handler;
import android.os.SystemClock;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.Interpolator;
import lecho.lib.hellocharts.view.Chart;
public class ChartDataAnimatorV8 implements ChartDataAnimator {
final Chart chart;
final Handler handler;
final Interpolator interpolator = new AccelerateDecelerateInterpolator();
long start;
boolean isAnimationStarted = false;
long duration;
private final Runnable runnable = new Runnable() {
@Override
public void run() {
long elapsed = SystemClock.uptimeMillis() - start;
if (elapsed > duration) {
isAnimationStarted = false;
handler.removeCallbacks(runnable);
chart.animationDataFinished();
return;
}
float scale = Math.min(interpolator.getInterpolation((float) elapsed / duration), 1);
chart.animationDataUpdate(scale);
handler.postDelayed(this, 16);
}
};
private ChartAnimationListener animationListener = new DummyChartAnimationListener();
public ChartDataAnimatorV8(Chart chart) {
this.chart = chart;
this.handler = new Handler();
}
@Override
public void startAnimation(long duration) {
if (duration >= 0) {
this.duration = duration;
} else {
this.duration = DEFAULT_ANIMATION_DURATION;
}
isAnimationStarted = true;
animationListener.onAnimationStarted();
start = SystemClock.uptimeMillis();
handler.post(runnable);
}
@Override
public void cancelAnimation() {
isAnimationStarted = false;
handler.removeCallbacks(runnable);
chart.animationDataFinished();
animationListener.onAnimationFinished();
}
@Override
public boolean isAnimationStarted() {
return isAnimationStarted;
}
@Override
public void setChartAnimationListener(ChartAnimationListener animationListener) {
if (null == animationListener) {
this.animationListener = new DummyChartAnimationListener();
} else {
this.animationListener = animationListener;
}
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/animation/ChartViewportAnimator.java
================================================
package lecho.lib.hellocharts.animation;
import lecho.lib.hellocharts.model.Viewport;
public interface ChartViewportAnimator {
public static final int FAST_ANIMATION_DURATION = 300;
public void startAnimation(Viewport startViewport, Viewport targetViewport);
public void startAnimation(Viewport startViewport, Viewport targetViewport, long duration);
public void cancelAnimation();
public boolean isAnimationStarted();
public void setChartAnimationListener(ChartAnimationListener animationListener);
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/animation/ChartViewportAnimatorV14.java
================================================
package lecho.lib.hellocharts.animation;
import android.animation.Animator;
import android.animation.Animator.AnimatorListener;
import android.animation.ValueAnimator;
import android.animation.ValueAnimator.AnimatorUpdateListener;
import android.annotation.SuppressLint;
import lecho.lib.hellocharts.model.Viewport;
import lecho.lib.hellocharts.view.Chart;
@SuppressLint("NewApi")
public class ChartViewportAnimatorV14 implements ChartViewportAnimator, AnimatorListener, AnimatorUpdateListener {
private final Chart chart;
private ValueAnimator animator;
private Viewport startViewport = new Viewport();
private Viewport targetViewport = new Viewport();
private Viewport newViewport = new Viewport();
private ChartAnimationListener animationListener = new DummyChartAnimationListener();
public ChartViewportAnimatorV14(Chart chart) {
this.chart = chart;
animator = ValueAnimator.ofFloat(0.0f, 1.0f);
animator.addListener(this);
animator.addUpdateListener(this);
animator.setDuration(FAST_ANIMATION_DURATION);
}
@Override
public void startAnimation(Viewport startViewport, Viewport targetViewport) {
this.startViewport.set(startViewport);
this.targetViewport.set(targetViewport);
animator.setDuration(FAST_ANIMATION_DURATION);
animator.start();
}
@Override
public void startAnimation(Viewport startViewport, Viewport targetViewport, long duration) {
this.startViewport.set(startViewport);
this.targetViewport.set(targetViewport);
animator.setDuration(duration);
animator.start();
}
@Override
public void cancelAnimation() {
animator.cancel();
}
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float scale = animation.getAnimatedFraction();
float diffLeft = (targetViewport.left - startViewport.left) * scale;
float diffTop = (targetViewport.top - startViewport.top) * scale;
float diffRight = (targetViewport.right - startViewport.right) * scale;
float diffBottom = (targetViewport.bottom - startViewport.bottom) * scale;
newViewport.set(startViewport.left + diffLeft, startViewport.top + diffTop, startViewport.right + diffRight,
startViewport.bottom + diffBottom);
chart.setCurrentViewport(newViewport);
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
chart.setCurrentViewport(targetViewport);
animationListener.onAnimationFinished();
}
@Override
public void onAnimationRepeat(Animator animation) {
}
@Override
public void onAnimationStart(Animator animation) {
animationListener.onAnimationStarted();
}
@Override
public boolean isAnimationStarted() {
return animator.isStarted();
}
@Override
public void setChartAnimationListener(ChartAnimationListener animationListener) {
if (null == animationListener) {
this.animationListener = new DummyChartAnimationListener();
} else {
this.animationListener = animationListener;
}
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/animation/ChartViewportAnimatorV8.java
================================================
package lecho.lib.hellocharts.animation;
import android.os.Handler;
import android.os.SystemClock;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.Interpolator;
import lecho.lib.hellocharts.model.Viewport;
import lecho.lib.hellocharts.view.Chart;
public class ChartViewportAnimatorV8 implements ChartViewportAnimator {
final Chart chart;
final Handler handler;
final Interpolator interpolator = new AccelerateDecelerateInterpolator();
long start;
boolean isAnimationStarted = false;
private Viewport startViewport = new Viewport();
private Viewport targetViewport = new Viewport();
private Viewport newViewport = new Viewport();
private long duration;
private ChartAnimationListener animationListener = new DummyChartAnimationListener();
private final Runnable runnable = new Runnable() {
@Override
public void run() {
long elapsed = SystemClock.uptimeMillis() - start;
if (elapsed > duration) {
isAnimationStarted = false;
handler.removeCallbacks(runnable);
chart.setCurrentViewport(targetViewport);
animationListener.onAnimationFinished();
return;
}
float scale = Math.min(interpolator.getInterpolation((float) elapsed / duration), 1);
float diffLeft = (targetViewport.left - startViewport.left) * scale;
float diffTop = (targetViewport.top - startViewport.top) * scale;
float diffRight = (targetViewport.right - startViewport.right) * scale;
float diffBottom = (targetViewport.bottom - startViewport.bottom) * scale;
newViewport.set(startViewport.left + diffLeft, startViewport.top + diffTop,
startViewport.right + diffRight, startViewport.bottom + diffBottom);
chart.setCurrentViewport(newViewport);
handler.postDelayed(this, 16);
}
};
public ChartViewportAnimatorV8(Chart chart) {
this.chart = chart;
this.duration = FAST_ANIMATION_DURATION;
this.handler = new Handler();
}
@Override
public void startAnimation(Viewport startViewport, Viewport targetViewport) {
this.startViewport.set(startViewport);
this.targetViewport.set(targetViewport);
duration = FAST_ANIMATION_DURATION;
isAnimationStarted = true;
animationListener.onAnimationStarted();
start = SystemClock.uptimeMillis();
handler.post(runnable);
}
@Override
public void startAnimation(Viewport startViewport, Viewport targetViewport, long duration) {
this.startViewport.set(startViewport);
this.targetViewport.set(targetViewport);
this.duration = duration;
isAnimationStarted = true;
animationListener.onAnimationStarted();
start = SystemClock.uptimeMillis();
handler.post(runnable);
}
@Override
public void cancelAnimation() {
isAnimationStarted = false;
handler.removeCallbacks(runnable);
chart.setCurrentViewport(targetViewport);
animationListener.onAnimationFinished();
}
@Override
public boolean isAnimationStarted() {
return isAnimationStarted;
}
@Override
public void setChartAnimationListener(ChartAnimationListener animationListener) {
if (null == animationListener) {
this.animationListener = new DummyChartAnimationListener();
} else {
this.animationListener = animationListener;
}
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/animation/DummyChartAnimationListener.java
================================================
package lecho.lib.hellocharts.animation;
public class DummyChartAnimationListener implements ChartAnimationListener {
@Override
public void onAnimationStarted() {
// do nothing
}
@Override
public void onAnimationFinished() {
// do nothing
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/animation/PieChartRotationAnimator.java
================================================
package lecho.lib.hellocharts.animation;
public interface PieChartRotationAnimator {
public static final int FAST_ANIMATION_DURATION = 200;
public void startAnimation(float startAngle, float angleToRotate);
public void cancelAnimation();
public boolean isAnimationStarted();
public void setChartAnimationListener(ChartAnimationListener animationListener);
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/animation/PieChartRotationAnimatorV14.java
================================================
package lecho.lib.hellocharts.animation;
import android.animation.Animator;
import android.animation.Animator.AnimatorListener;
import android.animation.ValueAnimator;
import android.animation.ValueAnimator.AnimatorUpdateListener;
import android.annotation.SuppressLint;
import lecho.lib.hellocharts.view.PieChartView;
@SuppressLint("NewApi")
public class PieChartRotationAnimatorV14 implements PieChartRotationAnimator, AnimatorListener, AnimatorUpdateListener {
private final PieChartView chart;
private ValueAnimator animator;
private float startRotation = 0;
private float targetRotation = 0;
private ChartAnimationListener animationListener = new DummyChartAnimationListener();
public PieChartRotationAnimatorV14(PieChartView chart) {
this(chart, FAST_ANIMATION_DURATION);
}
public PieChartRotationAnimatorV14(PieChartView chart, long duration) {
this.chart = chart;
animator = ValueAnimator.ofFloat(0.0f, 1.0f);
animator.setDuration(duration);
animator.addListener(this);
animator.addUpdateListener(this);
}
@Override
public void startAnimation(float startRotation, float targetRotation) {
this.startRotation = (startRotation % 360 + 360) % 360;
this.targetRotation = (targetRotation % 360 + 360) % 360;
animator.start();
}
@Override
public void cancelAnimation() {
animator.cancel();
}
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float scale = animation.getAnimatedFraction();
float rotation = startRotation + (targetRotation - startRotation) * scale;
rotation = (rotation % 360 + 360) % 360;
chart.setChartRotation((int) rotation, false);
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
chart.setChartRotation((int) targetRotation, false);
animationListener.onAnimationFinished();
}
@Override
public void onAnimationRepeat(Animator animation) {
}
@Override
public void onAnimationStart(Animator animation) {
animationListener.onAnimationStarted();
}
@Override
public boolean isAnimationStarted() {
return animator.isStarted();
}
@Override
public void setChartAnimationListener(ChartAnimationListener animationListener) {
if (null == animationListener) {
this.animationListener = new DummyChartAnimationListener();
} else {
this.animationListener = animationListener;
}
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/animation/PieChartRotationAnimatorV8.java
================================================
package lecho.lib.hellocharts.animation;
import android.os.Handler;
import android.os.SystemClock;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.Interpolator;
import lecho.lib.hellocharts.view.PieChartView;
public class PieChartRotationAnimatorV8 implements PieChartRotationAnimator {
final PieChartView chart;
final long duration;
final Handler handler;
final Interpolator interpolator = new AccelerateDecelerateInterpolator();
long start;
boolean isAnimationStarted = false;
private float startRotation = 0;
private float targetRotation = 0;
private ChartAnimationListener animationListener = new DummyChartAnimationListener();
private final Runnable runnable = new Runnable() {
@Override
public void run() {
long elapsed = SystemClock.uptimeMillis() - start;
if (elapsed > duration) {
isAnimationStarted = false;
handler.removeCallbacks(runnable);
chart.setChartRotation((int) targetRotation, false);
animationListener.onAnimationFinished();
return;
}
float scale = Math.min(interpolator.getInterpolation((float) elapsed / duration), 1);
float rotation = startRotation + (targetRotation - startRotation) * scale;
rotation = (rotation % 360 + 360) % 360;
chart.setChartRotation((int) rotation, false);
handler.postDelayed(this, 16);
}
};
public PieChartRotationAnimatorV8(PieChartView chart) {
this(chart, FAST_ANIMATION_DURATION);
}
public PieChartRotationAnimatorV8(PieChartView chart, long duration) {
this.chart = chart;
this.duration = duration;
this.handler = new Handler();
}
@Override
public void startAnimation(float startRotation, float targetRotation) {
this.startRotation = (startRotation % 360 + 360) % 360;
this.targetRotation = (targetRotation % 360 + 360) % 360;
isAnimationStarted = true;
animationListener.onAnimationStarted();
start = SystemClock.uptimeMillis();
handler.post(runnable);
}
@Override
public void cancelAnimation() {
isAnimationStarted = false;
handler.removeCallbacks(runnable);
chart.setChartRotation((int) targetRotation, false);
animationListener.onAnimationFinished();
}
@Override
public boolean isAnimationStarted() {
return isAnimationStarted;
}
@Override
public void setChartAnimationListener(ChartAnimationListener animationListener) {
if (null == animationListener) {
this.animationListener = new DummyChartAnimationListener();
} else {
this.animationListener = animationListener;
}
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/computator/ChartComputator.java
================================================
package lecho.lib.hellocharts.computator;
import android.graphics.Point;
import android.graphics.PointF;
import android.graphics.Rect;
import lecho.lib.hellocharts.listener.DummyVieportChangeListener;
import lecho.lib.hellocharts.listener.ViewportChangeListener;
import lecho.lib.hellocharts.model.Viewport;
/**
* Computes raw points coordinates(in pixels), holds content area dimensions and chart viewport.
*/
public class ChartComputator {
/**
* Maximum chart zoom.
*/
protected static final float DEFAULT_MAXIMUM_ZOOM = 20f;
protected float maxZoom = DEFAULT_MAXIMUM_ZOOM;
protected int chartWidth;
protected int chartHeight;
//contentRectMinusAllMargins <= contentRectMinusAxesMargins <= maxContentRect
protected Rect contentRectMinusAllMargins = new Rect();
protected Rect contentRectMinusAxesMargins = new Rect();
protected Rect maxContentRect = new Rect();
/**
* This rectangle represents the currently visible chart values ranges. The currently visible chart X values are
* from this rectangle's left to its right. The currently visible chart Y values are from this rectangle's top to
* its bottom.
*/
protected Viewport currentViewport = new Viewport();
protected Viewport maxViewport = new Viewport();
protected float minViewportWidth;
protected float minViewportHeight;
/**
* Warning! Viewport listener is disabled for all charts beside preview charts to avoid additional method calls
* during animations.
*/
protected ViewportChangeListener viewportChangeListener = new DummyVieportChangeListener();
/**
* Calculates available width and height. Should be called when chart dimensions change. ContentRect is relative to
* chart view not the device's screen.
*/
public void setContentRect(int width, int height, int paddingLeft, int paddingTop, int paddingRight,
int paddingBottom) {
chartWidth = width;
chartHeight = height;
maxContentRect.set(paddingLeft, paddingTop, width - paddingRight, height - paddingBottom);
contentRectMinusAxesMargins.set(maxContentRect);
contentRectMinusAllMargins.set(maxContentRect);
}
public void resetContentRect() {
contentRectMinusAxesMargins.set(maxContentRect);
contentRectMinusAllMargins.set(maxContentRect);
}
public void insetContentRect(int deltaLeft, int deltaTop, int deltaRight, int deltaBottom) {
contentRectMinusAxesMargins.left = contentRectMinusAxesMargins.left + deltaLeft;
contentRectMinusAxesMargins.top = contentRectMinusAxesMargins.top + deltaTop;
contentRectMinusAxesMargins.right = contentRectMinusAxesMargins.right - deltaRight;
contentRectMinusAxesMargins.bottom = contentRectMinusAxesMargins.bottom - deltaBottom;
insetContentRectByInternalMargins(deltaLeft, deltaTop, deltaRight, deltaBottom);
}
public void insetContentRectByInternalMargins(int deltaLeft, int deltaTop, int deltaRight, int deltaBottom) {
contentRectMinusAllMargins.left = contentRectMinusAllMargins.left + deltaLeft;
contentRectMinusAllMargins.top = contentRectMinusAllMargins.top + deltaTop;
contentRectMinusAllMargins.right = contentRectMinusAllMargins.right - deltaRight;
contentRectMinusAllMargins.bottom = contentRectMinusAllMargins.bottom - deltaBottom;
}
/**
* Checks if new viewport doesn't exceed max available viewport.
*/
public void constrainViewport(float left, float top, float right, float bottom) {
if (right - left < minViewportWidth) {
// Minimum width - constrain horizontal zoom!
right = left + minViewportWidth;
if (left < maxViewport.left) {
left = maxViewport.left;
right = left + minViewportWidth;
} else if (right > maxViewport.right) {
right = maxViewport.right;
left = right - minViewportWidth;
}
}
if (top - bottom < minViewportHeight) {
// Minimum height - constrain vertical zoom!
bottom = top - minViewportHeight;
if (top > maxViewport.top) {
top = maxViewport.top;
bottom = top - minViewportHeight;
} else if (bottom < maxViewport.bottom) {
bottom = maxViewport.bottom;
top = bottom + minViewportHeight;
}
}
currentViewport.left = Math.max(maxViewport.left, left);
currentViewport.top = Math.min(maxViewport.top, top);
currentViewport.right = Math.min(maxViewport.right, right);
currentViewport.bottom = Math.max(maxViewport.bottom, bottom);
viewportChangeListener.onViewportChanged(currentViewport);
}
/**
* Sets the current viewport (defined by {@link #currentViewport}) to the given X and Y positions.
*/
public void setViewportTopLeft(float left, float top) {
/**
* Constrains within the scroll range. The scroll range is simply the viewport extremes (AXIS_X_MAX,
* etc.) minus
* the viewport size. For example, if the extrema were 0 and 10, and the viewport size was 2, the scroll range
* would be 0 to 8.
*/
final float curWidth = currentViewport.width();
final float curHeight = currentViewport.height();
left = Math.max(maxViewport.left, Math.min(left, maxViewport.right - curWidth));
top = Math.max(maxViewport.bottom + curHeight, Math.min(top, maxViewport.top));
constrainViewport(left, top, left + curWidth, top - curHeight);
}
/**
* Translates chart value into raw pixel value. Returned value is absolute pixel X coordinate. If this method
* return
* 0 that means left most pixel of the screen.
*/
public float computeRawX(float valueX) {
// TODO: (contentRectMinusAllMargins.width() / currentViewport.width()) can be recalculated only when viewport
// change.
final float pixelOffset = (valueX - currentViewport.left) * (contentRectMinusAllMargins.width() /
currentViewport.width());
return contentRectMinusAllMargins.left + pixelOffset;
}
/**
* Translates chart value into raw pixel value. Returned value is absolute pixel Y coordinate. If this method
* return
* 0 that means top most pixel of the screen.
*/
public float computeRawY(float valueY) {
final float pixelOffset = (valueY - currentViewport.bottom) * (contentRectMinusAllMargins.height() /
currentViewport.height());
return contentRectMinusAllMargins.bottom - pixelOffset;
}
/**
* Translates viewport distance int pixel distance for X coordinates.
*/
public float computeRawDistanceX(float distance) {
return distance * (contentRectMinusAllMargins.width() / currentViewport.width());
}
/**
* Translates viewport distance int pixel distance for X coordinates.
*/
public float computeRawDistanceY(float distance) {
return distance * (contentRectMinusAllMargins.height() / currentViewport.height());
}
/**
* Finds the chart point (i.e. within the chart's domain and range) represented by the given pixel coordinates, if
* that pixel is within the chart region described by {@link #contentRectMinusAllMargins}. If the point is found,
* the "dest"
* argument is set to the point and this function returns true. Otherwise, this function returns false and
* "dest" is
* unchanged.
*/
public boolean rawPixelsToDataPoint(float x, float y, PointF dest) {
if (!contentRectMinusAllMargins.contains((int) x, (int) y)) {
return false;
}
dest.set(currentViewport.left + (x - contentRectMinusAllMargins.left) * currentViewport.width() /
contentRectMinusAllMargins.width(),
currentViewport.bottom + (y - contentRectMinusAllMargins.bottom) * currentViewport.height() /
-contentRectMinusAllMargins.height());
return true;
}
/**
* Computes the current scrollable surface size, in pixels. For example, if the entire chart area is visible, this
* is simply the current size of {@link #contentRectMinusAllMargins}. If the chart is zoomed in 200% in both
* directions, the
* returned size will be twice as large horizontally and vertically.
*/
public void computeScrollSurfaceSize(Point out) {
out.set((int) (maxViewport.width() * contentRectMinusAllMargins.width() / currentViewport.width()),
(int) (maxViewport.height() * contentRectMinusAllMargins.height() / currentViewport.height()));
}
/**
* Check if given coordinates lies inside contentRectMinusAllMargins.
*/
public boolean isWithinContentRect(float x, float y, float precision) {
if (x >= contentRectMinusAllMargins.left - precision && x <= contentRectMinusAllMargins.right + precision) {
if (y <= contentRectMinusAllMargins.bottom + precision && y >= contentRectMinusAllMargins.top -
precision) {
return true;
}
}
return false;
}
/**
* Returns content rectangle in pixels.
*
* @see #setContentRect(int, int, int, int, int, int)
*/
public Rect getContentRectMinusAllMargins() {
return contentRectMinusAllMargins;
}
/**
* Returns content rectangle with chart internal margins, for example for LineChart contentRectMinusAxesMargins is
* bigger
* than contentRectMinusAllMargins by point radius, thanks to that points are not cut on edges.
*
* @see #setContentRect(int, int, int, int, int, int)
*/
public Rect getContentRectMinusAxesMargins() {
return contentRectMinusAxesMargins;
}
/**
* Returns current chart viewport, returned object is mutable but should not be modified.
*
* @return
*/
public Viewport getCurrentViewport() {
return currentViewport;
}
/**
* Set current viewport to the same values as viewport passed in parameter. This method use deep copy so parameter
* can be safely modified later. Current viewport must be equal or smaller than maximum viewport.
*
* @param viewport
*/
public void setCurrentViewport(Viewport viewport) {
constrainViewport(viewport.left, viewport.top, viewport.right, viewport.bottom);
}
/**
* Set new values for curent viewport, that will change what part of chart is visible. Current viewport must be
* equal or smaller than maximum viewport.
*/
public void setCurrentViewport(float left, float top, float right, float bottom) {
constrainViewport(left, top, right, bottom);
}
/**
* Returns maximum viewport - values ranges extremes.
*/
public Viewport getMaximumViewport() {
return maxViewport;
}
/**
* Set maximum viewport to the same values as viewport passed in parameter. This method use deep copy so parameter
* can be safely modified later.
*
* @param maxViewport
*/
public void setMaxViewport(Viewport maxViewport) {
setMaxViewport(maxViewport.left, maxViewport.top, maxViewport.right, maxViewport.bottom);
}
/**
* Set new values for maximum viewport, that will change what part of chart is visible.
*/
public void setMaxViewport(float left, float top, float right, float bottom) {
this.maxViewport.set(left, top, right, bottom);
computeMinimumWidthAndHeight();
}
/**
* Returns viewport for visible part of chart, for most charts it is equal to current viewport.
*
* @return
*/
public Viewport getVisibleViewport() {
return currentViewport;
}
public void setVisibleViewport(Viewport visibleViewport) {
setCurrentViewport(visibleViewport);
}
public float getMinimumViewportWidth() {
return minViewportWidth;
}
public float getMinimumViewportHeight() {
return minViewportHeight;
}
public void setViewportChangeListener(ViewportChangeListener viewportChangeListener) {
if (null == viewportChangeListener) {
this.viewportChangeListener = new DummyVieportChangeListener();
} else {
this.viewportChangeListener = viewportChangeListener;
}
}
public int getChartWidth() {
return chartWidth;
}
public int getChartHeight() {
return chartHeight;
}
public float getMaxZoom() {
return maxZoom;
}
/**
* Set maximum zoom level, default is 20.
*
* @param maxZoom
*/
public void setMaxZoom(float maxZoom) {
if (maxZoom < 1) {
maxZoom = 1;
}
this.maxZoom = maxZoom;
computeMinimumWidthAndHeight();
setCurrentViewport(currentViewport);
}
private void computeMinimumWidthAndHeight() {
minViewportWidth = this.maxViewport.width() / maxZoom;
minViewportHeight = this.maxViewport.height() / maxZoom;
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/computator/PreviewChartComputator.java
================================================
package lecho.lib.hellocharts.computator;
import lecho.lib.hellocharts.model.Viewport;
/**
* Version of ChartComputator for preview charts. It always uses maxViewport as visible viewport and currentViewport as
* preview area.
*/
public class PreviewChartComputator extends ChartComputator {
public float computeRawX(float valueX) {
final float pixelOffset = (valueX - maxViewport.left) * (contentRectMinusAllMargins.width() / maxViewport
.width());
return contentRectMinusAllMargins.left + pixelOffset;
}
public float computeRawY(float valueY) {
final float pixelOffset = (valueY - maxViewport.bottom) * (contentRectMinusAllMargins.height() / maxViewport
.height());
return contentRectMinusAllMargins.bottom - pixelOffset;
}
public Viewport getVisibleViewport() {
return maxViewport;
}
public void setVisibleViewport(Viewport visibleViewport) {
setMaxViewport(visibleViewport);
}
public void constrainViewport(float left, float top, float right, float bottom) {
super.constrainViewport(left, top, right, bottom);
viewportChangeListener.onViewportChanged(currentViewport);
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/formatter/AxisValueFormatter.java
================================================
package lecho.lib.hellocharts.formatter;
import lecho.lib.hellocharts.model.AxisValue;
public interface AxisValueFormatter {
/**
* Formats AxisValue for manual(custom) axis. Result is stored in (output) formattedValue array. Method
* returns number of chars of formatted value. The formatted value starts at index [formattedValue.length -
* charsNumber] and ends at index [formattedValue.length-1].
*/
public int formatValueForManualAxis(char[] formattedValue, AxisValue axisValue);
/**
* Used only for auto-generated axes. If you are not going to use your implementation for aut-generated axes you can
* skip implementation of this method and just return 0. SFormats values with given number of digits after
* decimal separator. Result is stored in given array. Method returns number of chars for formatted value. The
* formatted value starts at index [formattedValue.length - charsNumber] and ends at index [formattedValue
* .length-1].
*/
public int formatValueForAutoGeneratedAxis(char[] formattedValue, float value, int autoDecimalDigits);
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/formatter/BubbleChartValueFormatter.java
================================================
package lecho.lib.hellocharts.formatter;
import lecho.lib.hellocharts.model.BubbleValue;
public interface BubbleChartValueFormatter {
public int formatChartValue(char[] formattedValue, BubbleValue value);
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/formatter/ColumnChartValueFormatter.java
================================================
package lecho.lib.hellocharts.formatter;
import lecho.lib.hellocharts.model.SubcolumnValue;
public interface ColumnChartValueFormatter {
public int formatChartValue(char[] formattedValue, SubcolumnValue value);
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/formatter/LineChartValueFormatter.java
================================================
package lecho.lib.hellocharts.formatter;
import lecho.lib.hellocharts.model.PointValue;
public interface LineChartValueFormatter {
public int formatChartValue(char[] formattedValue, PointValue value);
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/formatter/PieChartValueFormatter.java
================================================
package lecho.lib.hellocharts.formatter;
import lecho.lib.hellocharts.model.SliceValue;
public interface PieChartValueFormatter {
public int formatChartValue(char[] formattedValue, SliceValue value);
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/formatter/SimpleAxisValueFormatter.java
================================================
package lecho.lib.hellocharts.formatter;
import lecho.lib.hellocharts.model.AxisValue;
public class SimpleAxisValueFormatter implements AxisValueFormatter {
private ValueFormatterHelper valueFormatterHelper = new ValueFormatterHelper();
public SimpleAxisValueFormatter() {
valueFormatterHelper.determineDecimalSeparator();
}
public SimpleAxisValueFormatter(int decimalDigitsNumber) {
this();
valueFormatterHelper.setDecimalDigitsNumber(decimalDigitsNumber);
}
@Override
public int formatValueForManualAxis(char[] formattedValue, AxisValue axisValue) {
final int charsNumber = valueFormatterHelper.formatFloatValueWithPrependedAndAppendedText(formattedValue,
axisValue.getValue(), axisValue.getLabelAsChars());
return charsNumber;
}
@Override
public int formatValueForAutoGeneratedAxis(char[] formattedValue, float value, int autoDecimalDigits) {
final int charsNumber = valueFormatterHelper.formatFloatValueWithPrependedAndAppendedText(formattedValue,
value, autoDecimalDigits);
return charsNumber;
}
public int getDecimalDigitsNumber() {
return valueFormatterHelper.getDecimalDigitsNumber();
}
public SimpleAxisValueFormatter setDecimalDigitsNumber(int decimalDigitsNumber) {
valueFormatterHelper.setDecimalDigitsNumber(decimalDigitsNumber);
return this;
}
public char[] getAppendedText() {
return valueFormatterHelper.getAppendedText();
}
public SimpleAxisValueFormatter setAppendedText(char[] appendedText) {
valueFormatterHelper.setAppendedText(appendedText);
return this;
}
public char[] getPrependedText() {
return valueFormatterHelper.getPrependedText();
}
public SimpleAxisValueFormatter setPrependedText(char[] prependedText) {
valueFormatterHelper.setPrependedText(prependedText);
return this;
}
public char getDecimalSeparator() {
return valueFormatterHelper.getDecimalSeparator();
}
public SimpleAxisValueFormatter setDecimalSeparator(char decimalSeparator) {
valueFormatterHelper.setDecimalSeparator(decimalSeparator);
return this;
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/formatter/SimpleBubbleChartValueFormatter.java
================================================
package lecho.lib.hellocharts.formatter;
import lecho.lib.hellocharts.model.BubbleValue;
public class SimpleBubbleChartValueFormatter implements BubbleChartValueFormatter {
private ValueFormatterHelper valueFormatterHelper = new ValueFormatterHelper();
public SimpleBubbleChartValueFormatter() {
valueFormatterHelper.determineDecimalSeparator();
}
public SimpleBubbleChartValueFormatter(int decimalDigitsNumber) {
this();
valueFormatterHelper.setDecimalDigitsNumber(decimalDigitsNumber);
}
@Override
public int formatChartValue(char[] formattedValue, BubbleValue value) {
return valueFormatterHelper.formatFloatValueWithPrependedAndAppendedText(formattedValue, value.getZ(), value
.getLabelAsChars());
}
public int getDecimalDigitsNumber() {
return valueFormatterHelper.getDecimalDigitsNumber();
}
public SimpleBubbleChartValueFormatter setDecimalDigitsNumber(int decimalDigitsNumber) {
valueFormatterHelper.setDecimalDigitsNumber(decimalDigitsNumber);
return this;
}
public char[] getAppendedText() {
return valueFormatterHelper.getAppendedText();
}
public SimpleBubbleChartValueFormatter setAppendedText(char[] appendedText) {
valueFormatterHelper.setAppendedText(appendedText);
return this;
}
public char[] getPrependedText() {
return valueFormatterHelper.getPrependedText();
}
public SimpleBubbleChartValueFormatter setPrependedText(char[] prependedText) {
valueFormatterHelper.setPrependedText(prependedText);
return this;
}
public char getDecimalSeparator() {
return valueFormatterHelper.getDecimalSeparator();
}
public SimpleBubbleChartValueFormatter setDecimalSeparator(char decimalSeparator) {
valueFormatterHelper.setDecimalSeparator(decimalSeparator);
return this;
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/formatter/SimpleColumnChartValueFormatter.java
================================================
package lecho.lib.hellocharts.formatter;
import lecho.lib.hellocharts.model.SubcolumnValue;
public class SimpleColumnChartValueFormatter implements ColumnChartValueFormatter {
private ValueFormatterHelper valueFormatterHelper = new ValueFormatterHelper();
public SimpleColumnChartValueFormatter() {
valueFormatterHelper.determineDecimalSeparator();
}
public SimpleColumnChartValueFormatter(int decimalDigitsNumber) {
this();
valueFormatterHelper.setDecimalDigitsNumber(decimalDigitsNumber);
}
@Override
public int formatChartValue(char[] formattedValue, SubcolumnValue value) {
return valueFormatterHelper.formatFloatValueWithPrependedAndAppendedText(formattedValue, value.getValue(),
value.getLabelAsChars());
}
public int getDecimalDigitsNumber() {
return valueFormatterHelper.getDecimalDigitsNumber();
}
public SimpleColumnChartValueFormatter setDecimalDigitsNumber(int decimalDigitsNumber) {
valueFormatterHelper.setDecimalDigitsNumber(decimalDigitsNumber);
return this;
}
public char[] getAppendedText() {
return valueFormatterHelper.getAppendedText();
}
public SimpleColumnChartValueFormatter setAppendedText(char[] appendedText) {
valueFormatterHelper.setAppendedText(appendedText);
return this;
}
public char[] getPrependedText() {
return valueFormatterHelper.getPrependedText();
}
public SimpleColumnChartValueFormatter setPrependedText(char[] prependedText) {
valueFormatterHelper.setPrependedText(prependedText);
return this;
}
public char getDecimalSeparator() {
return valueFormatterHelper.getDecimalSeparator();
}
public SimpleColumnChartValueFormatter setDecimalSeparator(char decimalSeparator) {
valueFormatterHelper.setDecimalSeparator(decimalSeparator);
return this;
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/formatter/SimpleLineChartValueFormatter.java
================================================
package lecho.lib.hellocharts.formatter;
import lecho.lib.hellocharts.model.PointValue;
public class SimpleLineChartValueFormatter implements LineChartValueFormatter {
private ValueFormatterHelper valueFormatterHelper = new ValueFormatterHelper();
public SimpleLineChartValueFormatter() {
valueFormatterHelper.determineDecimalSeparator();
}
public SimpleLineChartValueFormatter(int decimalDigitsNumber) {
this();
valueFormatterHelper.setDecimalDigitsNumber(decimalDigitsNumber);
}
@Override
public int formatChartValue(char[] formattedValue, PointValue value) {
return valueFormatterHelper.formatFloatValueWithPrependedAndAppendedText(formattedValue, value.getY(), value
.getLabelAsChars());
}
public int getDecimalDigitsNumber() {
return valueFormatterHelper.getDecimalDigitsNumber();
}
public SimpleLineChartValueFormatter setDecimalDigitsNumber(int decimalDigitsNumber) {
valueFormatterHelper.setDecimalDigitsNumber(decimalDigitsNumber);
return this;
}
public char[] getAppendedText() {
return valueFormatterHelper.getAppendedText();
}
public SimpleLineChartValueFormatter setAppendedText(char[] appendedText) {
valueFormatterHelper.setAppendedText(appendedText);
return this;
}
public char[] getPrependedText() {
return valueFormatterHelper.getPrependedText();
}
public SimpleLineChartValueFormatter setPrependedText(char[] prependedText) {
valueFormatterHelper.setPrependedText(prependedText);
return this;
}
public char getDecimalSeparator() {
return valueFormatterHelper.getDecimalSeparator();
}
public SimpleLineChartValueFormatter setDecimalSeparator(char decimalSeparator) {
valueFormatterHelper.setDecimalSeparator(decimalSeparator);
return this;
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/formatter/SimplePieChartValueFormatter.java
================================================
package lecho.lib.hellocharts.formatter;
import lecho.lib.hellocharts.model.SliceValue;
public class SimplePieChartValueFormatter implements PieChartValueFormatter {
private ValueFormatterHelper valueFormatterHelper = new ValueFormatterHelper();
public SimplePieChartValueFormatter() {
valueFormatterHelper.determineDecimalSeparator();
}
public SimplePieChartValueFormatter(int decimalDigitsNumber) {
this();
valueFormatterHelper.setDecimalDigitsNumber(decimalDigitsNumber);
}
@Override
public int formatChartValue(char[] formattedValue, SliceValue value) {
return valueFormatterHelper.formatFloatValueWithPrependedAndAppendedText(formattedValue, value.getValue(),
value.getLabelAsChars());
}
public int getDecimalDigitsNumber() {
return valueFormatterHelper.getDecimalDigitsNumber();
}
public SimplePieChartValueFormatter setDecimalDigitsNumber(int decimalDigitsNumber) {
valueFormatterHelper.setDecimalDigitsNumber(decimalDigitsNumber);
return this;
}
public char[] getAppendedText() {
return valueFormatterHelper.getAppendedText();
}
public SimplePieChartValueFormatter setAppendedText(char[] appendedText) {
valueFormatterHelper.setAppendedText(appendedText);
return this;
}
public char[] getPrependedText() {
return valueFormatterHelper.getPrependedText();
}
public SimplePieChartValueFormatter setPrependedText(char[] prependedText) {
valueFormatterHelper.setPrependedText(prependedText);
return this;
}
public char getDecimalSeparator() {
return valueFormatterHelper.getDecimalSeparator();
}
public SimplePieChartValueFormatter setDecimalSeparator(char decimalSeparator) {
valueFormatterHelper.setDecimalSeparator(decimalSeparator);
return this;
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/formatter/ValueFormatterHelper.java
================================================
package lecho.lib.hellocharts.formatter;
import android.util.Log;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import lecho.lib.hellocharts.util.FloatUtils;
public class ValueFormatterHelper {
public static final int DEFAULT_DIGITS_NUMBER = 0;
private static final String TAG = "ValueFormatterHelper";
private int decimalDigitsNumber = Integer.MIN_VALUE;
private char[] appendedText = new char[0];
private char[] prependedText = new char[0];
private char decimalSeparator = '.';
public void determineDecimalSeparator() {
NumberFormat numberFormat = NumberFormat.getInstance();
if (numberFormat instanceof DecimalFormat) {
decimalSeparator = ((DecimalFormat) numberFormat).getDecimalFormatSymbols().getDecimalSeparator();
}
}
public int getDecimalDigitsNumber() {
return decimalDigitsNumber;
}
public ValueFormatterHelper setDecimalDigitsNumber(int decimalDigitsNumber) {
this.decimalDigitsNumber = decimalDigitsNumber;
return this;
}
public char[] getAppendedText() {
return appendedText;
}
public ValueFormatterHelper setAppendedText(char[] appendedText) {
if (null != appendedText) {
this.appendedText = appendedText;
}
return this;
}
public char[] getPrependedText() {
return prependedText;
}
public ValueFormatterHelper setPrependedText(char[] prependedText) {
if (null != prependedText) {
this.prependedText = prependedText;
}
return this;
}
public char getDecimalSeparator() {
return decimalSeparator;
}
public ValueFormatterHelper setDecimalSeparator(char decimalSeparator) {
char nullChar = '\0';
if (nullChar != decimalSeparator) {
this.decimalSeparator = decimalSeparator;
}
return this;
}
/**
* Formats float value. Result is stored in (output) formattedValue array. Method
* returns number of chars of formatted value. The formatted value starts at index [formattedValue.length -
* charsNumber] and ends at index [formattedValue.length-1].
* Note: If label is not null it will be used as formattedValue instead of float value.
* Note: Parameter defaultDigitsNumber is used only if you didn't change decimalDigintsNumber value using
* method {@link #setDecimalDigitsNumber(int)}.
*/
public int formatFloatValueWithPrependedAndAppendedText(char[] formattedValue, float value, int
defaultDigitsNumber, char[] label) {
if (null != label) {
// If custom label is not null use only name characters as formatted value.
// Copy label into formatted value array.
int labelLength = label.length;
if (labelLength > formattedValue.length) {
Log.w(TAG, "Label length is larger than buffer size(64chars), some chars will be skipped!");
labelLength = formattedValue.length;
}
System.arraycopy(label, 0, formattedValue, formattedValue.length - labelLength, labelLength);
return labelLength;
}
final int appliedDigitsNumber = getAppliedDecimalDigitsNumber(defaultDigitsNumber);
final int charsNumber = formatFloatValue(formattedValue, value, appliedDigitsNumber);
appendText(formattedValue);
prependText(formattedValue, charsNumber);
return charsNumber + getPrependedText().length + getAppendedText().length;
}
/**
* @see #formatFloatValueWithPrependedAndAppendedText(char[], float, int, char[])
*/
public int formatFloatValueWithPrependedAndAppendedText(char[] formattedValue, float value, char[] label) {
return formatFloatValueWithPrependedAndAppendedText(formattedValue, value, DEFAULT_DIGITS_NUMBER, label);
}
/**
* @see #formatFloatValueWithPrependedAndAppendedText(char[], float, int, char[])
*/
public int formatFloatValueWithPrependedAndAppendedText(char[] formattedValue, float value, int
defaultDigitsNumber) {
return formatFloatValueWithPrependedAndAppendedText(formattedValue, value, defaultDigitsNumber, null);
}
public int formatFloatValue(char[] formattedValue, float value, int decimalDigitsNumber) {
return FloatUtils.formatFloat(formattedValue, value, formattedValue.length - appendedText.length,
decimalDigitsNumber,
decimalSeparator);
}
public void appendText(char[] formattedValue) {
if (appendedText.length > 0) {
System.arraycopy(appendedText, 0, formattedValue, formattedValue.length - appendedText.length,
appendedText.length);
}
}
public void prependText(char[] formattedValue, int charsNumber) {
if (prependedText.length > 0) {
System.arraycopy(prependedText, 0, formattedValue, formattedValue.length - charsNumber - appendedText.length
- prependedText.length, prependedText.length);
}
}
public int getAppliedDecimalDigitsNumber(int defaultDigitsNumber) {
final int appliedDecimalDigitsNumber;
if (decimalDigitsNumber < 0) {
//When decimalDigitsNumber < 0 that means that user didn't set that value and defaultDigitsNumber should
// be used.
appliedDecimalDigitsNumber = defaultDigitsNumber;
} else {
appliedDecimalDigitsNumber = decimalDigitsNumber;
}
return appliedDecimalDigitsNumber;
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/gesture/ChartScroller.java
================================================
package lecho.lib.hellocharts.gesture;
import android.content.Context;
import android.graphics.Point;
import android.graphics.Rect;
import android.support.v4.widget.ScrollerCompat;
import lecho.lib.hellocharts.computator.ChartComputator;
import lecho.lib.hellocharts.model.Viewport;
/**
* Encapsulates scrolling functionality.
*/
public class ChartScroller {
private Viewport scrollerStartViewport = new Viewport(); // Used only for zooms and flings
private Point surfaceSizeBuffer = new Point();// Used for scroll and flings
private ScrollerCompat scroller;
public ChartScroller(Context context) {
scroller = ScrollerCompat.create(context);
}
public boolean startScroll(ChartComputator computator) {
scroller.abortAnimation();
scrollerStartViewport.set(computator.getCurrentViewport());
return true;
}
public boolean scroll(ChartComputator computator, float distanceX, float distanceY, ScrollResult scrollResult) {
// Scrolling uses math based on the viewport (as opposed to math using pixels). Pixel offset is the offset in
// screen pixels, while viewport offset is the offset within the current viewport. For additional
// information on
// surface sizes and pixel offsets, see the docs for {@link computeScrollSurfaceSize()}. For additional
// information about the viewport, see the comments for {@link mCurrentViewport}.
final Viewport maxViewport = computator.getMaximumViewport();
final Viewport visibleViewport = computator.getVisibleViewport();
final Viewport currentViewport = computator.getCurrentViewport();
final Rect contentRect = computator.getContentRectMinusAllMargins();
final boolean canScrollLeft = currentViewport.left > maxViewport.left;
final boolean canScrollRight = currentViewport.right < maxViewport.right;
final boolean canScrollTop = currentViewport.top < maxViewport.top;
final boolean canScrollBottom = currentViewport.bottom > maxViewport.bottom;
boolean canScrollX = false;
boolean canScrollY = false;
if (canScrollLeft && distanceX <= 0) {
canScrollX = true;
} else if (canScrollRight && distanceX >= 0) {
canScrollX = true;
}
if (canScrollTop && distanceY <= 0) {
canScrollY = true;
} else if (canScrollBottom && distanceY >= 0) {
canScrollY = true;
}
if (canScrollX || canScrollY) {
computator.computeScrollSurfaceSize(surfaceSizeBuffer);
float viewportOffsetX = distanceX * visibleViewport.width() / contentRect.width();
float viewportOffsetY = -distanceY * visibleViewport.height() / contentRect.height();
computator
.setViewportTopLeft(currentViewport.left + viewportOffsetX, currentViewport.top + viewportOffsetY);
}
scrollResult.canScrollX = canScrollX;
scrollResult.canScrollY = canScrollY;
return canScrollX || canScrollY;
}
public boolean computeScrollOffset(ChartComputator computator) {
if (scroller.computeScrollOffset()) {
// The scroller isn't finished, meaning a fling or programmatic pan operation is
// currently active.
final Viewport maxViewport = computator.getMaximumViewport();
computator.computeScrollSurfaceSize(surfaceSizeBuffer);
final float currXRange = maxViewport.left + maxViewport.width() * scroller.getCurrX() /
surfaceSizeBuffer.x;
final float currYRange = maxViewport.top - maxViewport.height() * scroller.getCurrY() /
surfaceSizeBuffer.y;
computator.setViewportTopLeft(currXRange, currYRange);
return true;
}
return false;
}
public boolean fling(int velocityX, int velocityY, ChartComputator computator) {
// Flings use math in pixels (as opposed to math based on the viewport).
computator.computeScrollSurfaceSize(surfaceSizeBuffer);
scrollerStartViewport.set(computator.getCurrentViewport());
int startX = (int) (surfaceSizeBuffer.x * (scrollerStartViewport.left - computator.getMaximumViewport().left)
/ computator.getMaximumViewport().width());
int startY = (int) (surfaceSizeBuffer.y * (computator.getMaximumViewport().top - scrollerStartViewport.top) /
computator.getMaximumViewport().height());
// TODO probably should be mScroller.forceFinish but ScrollerCompat doesn't have that method.
scroller.abortAnimation();
final int width = computator.getContentRectMinusAllMargins().width();
final int height = computator.getContentRectMinusAllMargins().height();
scroller.fling(startX, startY, velocityX, velocityY, 0, surfaceSizeBuffer.x - width + 1, 0,
surfaceSizeBuffer.y - height + 1);
return true;
}
public static class ScrollResult {
public boolean canScrollX;
public boolean canScrollY;
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/gesture/ChartTouchHandler.java
================================================
package lecho.lib.hellocharts.gesture;
import android.content.Context;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
import android.view.ViewParent;
import lecho.lib.hellocharts.computator.ChartComputator;
import lecho.lib.hellocharts.gesture.ChartScroller.ScrollResult;
import lecho.lib.hellocharts.model.SelectedValue;
import lecho.lib.hellocharts.renderer.ChartRenderer;
import lecho.lib.hellocharts.view.Chart;
/**
* Default touch handler for most charts. Handles value touch, scroll, fling and zoom.
*/
public class ChartTouchHandler {
protected GestureDetector gestureDetector;
protected ScaleGestureDetector scaleGestureDetector;
protected ChartScroller chartScroller;
protected ChartZoomer chartZoomer;
protected Chart chart;
protected ChartComputator computator;
protected ChartRenderer renderer;
protected boolean isZoomEnabled = true;
protected boolean isScrollEnabled = true;
protected boolean isValueTouchEnabled = true;
protected boolean isValueSelectionEnabled = false;
/**
* Used only for selection mode to avoid calling listener multiple times for the same selection. Small thing but it
* is more intuitive this way.
*/
protected SelectedValue selectionModeOldValue = new SelectedValue();
protected SelectedValue selectedValue = new SelectedValue();
protected SelectedValue oldSelectedValue = new SelectedValue();
/**
* ViewParent to disallow touch events interception if chart is within scroll container.
*/
protected ViewParent viewParent;
/**
* Type of scroll of container, horizontal or vertical.
*/
protected ContainerScrollType containerScrollType;
public ChartTouchHandler(Context context, Chart chart) {
this.chart = chart;
this.computator = chart.getChartComputator();
this.renderer = chart.getChartRenderer();
gestureDetector = new GestureDetector(context, new ChartGestureListener());
scaleGestureDetector = new ScaleGestureDetector(context, new ChartScaleGestureListener());
chartScroller = new ChartScroller(context);
chartZoomer = new ChartZoomer(context, ZoomType.HORIZONTAL_AND_VERTICAL);
}
public void resetTouchHandler() {
this.computator = chart.getChartComputator();
this.renderer = chart.getChartRenderer();
}
/**
* Computes scroll and zoom using {@link ChartScroller} and {@link ChartZoomer}. This method returns true if
* scroll/zoom was computed and chart needs to be invalidated.
*/
public boolean computeScroll() {
boolean needInvalidate = false;
if (isScrollEnabled && chartScroller.computeScrollOffset(computator)) {
needInvalidate = true;
}
if (isZoomEnabled && chartZoomer.computeZoom(computator)) {
needInvalidate = true;
}
return needInvalidate;
}
/**
* Handle chart touch event(gestures, clicks). Return true if gesture was handled and chart needs to be
* invalidated.
*/
public boolean handleTouchEvent(MotionEvent event) {
boolean needInvalidate = false;
// TODO: detectors always return true, use class member needInvalidate instead local variable as workaround.
// This flag should be computed inside gesture listeners methods to avoid invalidation.
needInvalidate = gestureDetector.onTouchEvent(event);
needInvalidate = scaleGestureDetector.onTouchEvent(event) || needInvalidate;
if (isZoomEnabled && scaleGestureDetector.isInProgress()) {
// Special case: if view is inside scroll container and user is scaling disable touch interception by
// parent.
disallowParentInterceptTouchEvent();
}
if (isValueTouchEnabled) {
needInvalidate = computeTouch(event) || needInvalidate;
}
return needInvalidate;
}
/**
* Handle chart touch event(gestures, clicks). Return true if gesture was handled and chart needs to be
* invalidated.
* If viewParent and containerScrollType are not null chart can be scrolled and scaled within horizontal or
* vertical
* scroll container like ViewPager.
*/
public boolean handleTouchEvent(MotionEvent event, ViewParent viewParent,
ContainerScrollType containerScrollType) {
this.viewParent = viewParent;
this.containerScrollType = containerScrollType;
return handleTouchEvent(event);
}
/**
* Disallow parent view from intercepting touch events. Use it for chart that is within some scroll container i.e.
* ViewPager.
*/
private void disallowParentInterceptTouchEvent() {
if (null != viewParent) {
viewParent.requestDisallowInterceptTouchEvent(true);
}
}
/**
* Allow parent view to intercept touch events if chart cannot be scroll horizontally or vertically according to
* the
* current value of {@link #containerScrollType}.
*/
private void allowParentInterceptTouchEvent(ScrollResult scrollResult) {
if (null != viewParent) {
if (ContainerScrollType.HORIZONTAL == containerScrollType && !scrollResult.canScrollX
&& !scaleGestureDetector.isInProgress()) {
viewParent.requestDisallowInterceptTouchEvent(false);
} else if (ContainerScrollType.VERTICAL == containerScrollType && !scrollResult.canScrollY
&& !scaleGestureDetector.isInProgress()) {
viewParent.requestDisallowInterceptTouchEvent(false);
}
}
}
private boolean computeTouch(MotionEvent event) {
boolean needInvalidate = false;
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
boolean wasTouched = renderer.isTouched();
boolean isTouched = checkTouch(event.getX(), event.getY());
if (wasTouched != isTouched) {
needInvalidate = true;
if (isValueSelectionEnabled) {
selectionModeOldValue.clear();
if (wasTouched && !renderer.isTouched()) {
chart.callTouchListener();
}
}
}
break;
case MotionEvent.ACTION_UP:
if (renderer.isTouched()) {
if (checkTouch(event.getX(), event.getY())) {
if (isValueSelectionEnabled) {
// For selection mode call listener only if selected value changed,
// that means that should be
// first(selection) click on given value.
if (!selectionModeOldValue.equals(selectedValue)) {
selectionModeOldValue.set(selectedValue);
chart.callTouchListener();
}
} else {
chart.callTouchListener();
renderer.clearTouch();
}
} else {
renderer.clearTouch();
}
needInvalidate = true;
}
break;
case MotionEvent.ACTION_MOVE:
// If value was touched and now touch point is outside of value area - clear touch and invalidate, user
// probably moved finger away from given chart value.
if (renderer.isTouched()) {
if (!checkTouch(event.getX(), event.getY())) {
renderer.clearTouch();
needInvalidate = true;
}
}
break;
case MotionEvent.ACTION_CANCEL:
if (renderer.isTouched()) {
renderer.clearTouch();
needInvalidate = true;
}
break;
}
return needInvalidate;
}
private boolean checkTouch(float touchX, float touchY) {
oldSelectedValue.set(selectedValue);
selectedValue.clear();
if (renderer.checkTouch(touchX, touchY)) {
selectedValue.set(renderer.getSelectedValue());
}
// Check if selection is still on the same value, if not return false.
if (oldSelectedValue.isSet() && selectedValue.isSet() && !oldSelectedValue.equals(selectedValue)) {
return false;
} else {
return renderer.isTouched();
}
}
public boolean isZoomEnabled() {
return isZoomEnabled;
}
public void setZoomEnabled(boolean isZoomEnabled) {
this.isZoomEnabled = isZoomEnabled;
}
public boolean isScrollEnabled() {
return isScrollEnabled;
}
public void setScrollEnabled(boolean isScrollEnabled) {
this.isScrollEnabled = isScrollEnabled;
}
public ZoomType getZoomType() {
return chartZoomer.getZoomType();
}
public void setZoomType(ZoomType zoomType) {
chartZoomer.setZoomType(zoomType);
}
public boolean isValueTouchEnabled() {
return isValueTouchEnabled;
}
public void setValueTouchEnabled(boolean isValueTouchEnabled) {
this.isValueTouchEnabled = isValueTouchEnabled;
}
public boolean isValueSelectionEnabled() {
return isValueSelectionEnabled;
}
public void setValueSelectionEnabled(boolean isValueSelectionEnabled) {
this.isValueSelectionEnabled = isValueSelectionEnabled;
}
protected class ChartScaleGestureListener extends ScaleGestureDetector.SimpleOnScaleGestureListener {
@Override
public boolean onScale(ScaleGestureDetector detector) {
if (isZoomEnabled) {
float scale = 2.0f - detector.getScaleFactor();
if (Float.isInfinite(scale)) {
scale = 1;
}
return chartZoomer.scale(computator, detector.getFocusX(), detector.getFocusY(), scale);
}
return false;
}
}
protected class ChartGestureListener extends GestureDetector.SimpleOnGestureListener {
protected ScrollResult scrollResult = new ScrollResult();
@Override
public boolean onDown(MotionEvent e) {
if (isScrollEnabled) {
disallowParentInterceptTouchEvent();
return chartScroller.startScroll(computator);
}
return false;
}
@Override
public boolean onDoubleTap(MotionEvent e) {
if (isZoomEnabled) {
return chartZoomer.startZoom(e, computator);
}
return false;
}
@Override
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
if (isScrollEnabled) {
boolean canScroll = chartScroller
.scroll(computator, distanceX, distanceY, scrollResult);
allowParentInterceptTouchEvent(scrollResult);
return canScroll;
}
return false;
}
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
if (isScrollEnabled) {
return chartScroller.fling((int) -velocityX, (int) -velocityY, computator);
}
return false;
}
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/gesture/ChartZoomer.java
================================================
package lecho.lib.hellocharts.gesture;
import android.content.Context;
import android.graphics.PointF;
import android.view.MotionEvent;
import lecho.lib.hellocharts.computator.ChartComputator;
import lecho.lib.hellocharts.model.Viewport;
/**
* Encapsulates zooming functionality.
*/
public class ChartZoomer {
public static final float ZOOM_AMOUNT = 0.25f;
private ZoomerCompat zoomer;
private ZoomType zoomType;
private PointF zoomFocalPoint = new PointF();// Used for double tap zoom
private PointF viewportFocus = new PointF();
private Viewport scrollerStartViewport = new Viewport(); // Used only for zooms and flings
public ChartZoomer(Context context, ZoomType zoomType) {
zoomer = new ZoomerCompat(context);
this.zoomType = zoomType;
}
public boolean startZoom(MotionEvent e, ChartComputator computator) {
zoomer.forceFinished(true);
scrollerStartViewport.set(computator.getCurrentViewport());
if (!computator.rawPixelsToDataPoint(e.getX(), e.getY(), zoomFocalPoint)) {
// Focus point is not within content area.
return false;
}
zoomer.startZoom(ZOOM_AMOUNT);
return true;
}
public boolean computeZoom(ChartComputator computator) {
if (zoomer.computeZoom()) {
// Performs the zoom since a zoom is in progress.
final float newWidth = (1.0f - zoomer.getCurrZoom()) * scrollerStartViewport.width();
final float newHeight = (1.0f - zoomer.getCurrZoom()) * scrollerStartViewport.height();
final float pointWithinViewportX = (zoomFocalPoint.x - scrollerStartViewport.left)
/ scrollerStartViewport.width();
final float pointWithinViewportY = (zoomFocalPoint.y - scrollerStartViewport.bottom)
/ scrollerStartViewport.height();
float left = zoomFocalPoint.x - newWidth * pointWithinViewportX;
float top = zoomFocalPoint.y + newHeight * (1 - pointWithinViewportY);
float right = zoomFocalPoint.x + newWidth * (1 - pointWithinViewportX);
float bottom = zoomFocalPoint.y - newHeight * pointWithinViewportY;
setCurrentViewport(computator, left, top, right, bottom);
return true;
}
return false;
}
public boolean scale(ChartComputator computator, float focusX, float focusY, float scale) {
/**
* Smaller viewport means bigger zoom so for zoomIn scale should have value <1, for zoomOout >1
*/
final float newWidth = scale * computator.getCurrentViewport().width();
final float newHeight = scale * computator.getCurrentViewport().height();
if (!computator.rawPixelsToDataPoint(focusX, focusY, viewportFocus)) {
// Focus point is not within content area.
return false;
}
float left = viewportFocus.x - (focusX - computator.getContentRectMinusAllMargins().left)
* (newWidth / computator.getContentRectMinusAllMargins().width());
float top = viewportFocus.y + (focusY - computator.getContentRectMinusAllMargins().top)
* (newHeight / computator.getContentRectMinusAllMargins().height());
float right = left + newWidth;
float bottom = top - newHeight;
setCurrentViewport(computator, left, top, right, bottom);
return true;
}
private void setCurrentViewport(ChartComputator computator, float left, float top, float right, float bottom) {
Viewport currentViewport = computator.getCurrentViewport();
if (ZoomType.HORIZONTAL_AND_VERTICAL == zoomType) {
computator.setCurrentViewport(left, top, right, bottom);
} else if (ZoomType.HORIZONTAL == zoomType) {
computator.setCurrentViewport(left, currentViewport.top, right, currentViewport.bottom);
} else if (ZoomType.VERTICAL == zoomType) {
computator.setCurrentViewport(currentViewport.left, top, currentViewport.right, bottom);
}
}
public ZoomType getZoomType() {
return zoomType;
}
public void setZoomType(ZoomType zoomType) {
this.zoomType = zoomType;
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/gesture/ContainerScrollType.java
================================================
package lecho.lib.hellocharts.gesture;
/**
* Enum used to inform chart in which type of container it exists.
*/
public enum ContainerScrollType {
HORIZONTAL, VERTICAL
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/gesture/PieChartTouchHandler.java
================================================
package lecho.lib.hellocharts.gesture;
import android.content.Context;
import android.graphics.RectF;
import android.support.v4.widget.ScrollerCompat;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
import lecho.lib.hellocharts.view.PieChartView;
/**
* Touch handler for PieChart. It doesn't handle zoom and scroll like default ChartTouchHandler. Instead it uses
* Scroller(ScrollerCompat) directly to compute PieChart rotation when user scroll. ChartScroller and ChartZoomer are
* not really used here.
*/
public class PieChartTouchHandler extends ChartTouchHandler {
/**
* The initial fling velocity is divided by this amount.
*/
public static final int FLING_VELOCITY_DOWNSCALE = 4;
/**
* PieChartTouchHandler uses its own instance of Scroller.
*/
protected ScrollerCompat scroller;
/**
* Reference to PieChartView to use some methods specific for that kind of chart.
*/
protected PieChartView pieChart;
private boolean isRotationEnabled = true;
public PieChartTouchHandler(Context context, PieChartView chart) {
super(context, chart);
pieChart = (PieChartView) chart;
scroller = ScrollerCompat.create(context);
gestureDetector = new GestureDetector(context, new ChartGestureListener());
scaleGestureDetector = new ScaleGestureDetector(context, new ChartScaleGestureListener());
isZoomEnabled = false;// Zoom is not supported by PieChart.
}
@Override
public boolean computeScroll() {
if (!isRotationEnabled) {
return false;
}
if (scroller.computeScrollOffset()) {
pieChart.setChartRotation(scroller.getCurrY(), false);
// pieChart.setChartRotation() will invalidate view so no need to return true;
}
return false;
}
@Override
public boolean handleTouchEvent(MotionEvent event) {
boolean needInvalidate = super.handleTouchEvent(event);
if (isRotationEnabled) {
needInvalidate = gestureDetector.onTouchEvent(event) || needInvalidate;
}
return needInvalidate;
}
public boolean isRotationEnabled() {
return isRotationEnabled;
}
public void setRotationEnabled(boolean isRotationEnabled) {
this.isRotationEnabled = isRotationEnabled;
}
private class ChartScaleGestureListener extends ScaleGestureDetector.SimpleOnScaleGestureListener {
@Override
public boolean onScale(ScaleGestureDetector detector) {
// No scale for PieChart.
return false;
}
}
private class ChartGestureListener extends GestureDetector.SimpleOnGestureListener {
@Override
public boolean onDown(MotionEvent e) {
if (isRotationEnabled) {
scroller.abortAnimation();
return true;
}
return false;
}
@Override
public boolean onDoubleTap(MotionEvent e) {
return false;
}
@Override
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
if (isRotationEnabled) {
// Set the pie rotation directly.
final RectF circleOval = pieChart.getCircleOval();
final float centerX = circleOval.centerX();
final float centerY = circleOval.centerY();
float scrollTheta = vectorToScalarScroll(distanceX, distanceY, e2.getX() - centerX, e2.getY() -
centerY);
pieChart.setChartRotation(pieChart.getChartRotation() - (int) scrollTheta / FLING_VELOCITY_DOWNSCALE,
false);
return true;
}
return false;
}
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
if (isRotationEnabled) {
// Set up the Scroller for a fling
final RectF circleOval = pieChart.getCircleOval();
final float centerX = circleOval.centerX();
final float centerY = circleOval.centerY();
float scrollTheta = vectorToScalarScroll(velocityX, velocityY, e2.getX() - centerX, e2.getY() -
centerY);
scroller.abortAnimation();
scroller.fling(0, (int) pieChart.getChartRotation(), 0, (int) scrollTheta / FLING_VELOCITY_DOWNSCALE,
0, 0, Integer.MIN_VALUE, Integer.MAX_VALUE);
return true;
}
return false;
}
/**
* Helper method for translating (x,y) scroll vectors into scalar rotation of the pie.
*
* @param dx The x component of the current scroll vector.
* @param dy The y component of the current scroll vector.
* @param x The x position of the current touch, relative to the pie center.
* @param y The y position of the current touch, relative to the pie center.
* @return The scalar representing the change in angular position for this scroll.
*/
private float vectorToScalarScroll(float dx, float dy, float x, float y) {
// get the length of the vector
float l = (float) Math.sqrt(dx * dx + dy * dy);
// decide if the scalar should be negative or positive by finding
// the dot product of the vector perpendicular to (x,y).
float crossX = -y;
float crossY = x;
float dot = (crossX * dx + crossY * dy);
float sign = Math.signum(dot);
return l * sign;
}
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/gesture/PreviewChartTouchHandler.java
================================================
package lecho.lib.hellocharts.gesture;
import android.content.Context;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
import lecho.lib.hellocharts.view.Chart;
/**
* Touch Handler for preview charts. It scroll and zoom only preview area, not all preview chart data.
*/
public class PreviewChartTouchHandler extends ChartTouchHandler {
public PreviewChartTouchHandler(Context context, Chart chart) {
super(context, chart);
gestureDetector = new GestureDetector(context, new PreviewChartGestureListener());
scaleGestureDetector = new ScaleGestureDetector(context, new ChartScaleGestureListener());
// Disable value touch and selection mode, by default not needed for preview chart.
isValueTouchEnabled = false;
isValueSelectionEnabled = false;
}
protected class ChartScaleGestureListener extends ScaleGestureDetector.SimpleOnScaleGestureListener {
@Override
public boolean onScale(ScaleGestureDetector detector) {
if (isZoomEnabled) {
float scale = detector.getCurrentSpan() / detector.getPreviousSpan();
if (Float.isInfinite(scale)) {
scale = 1;
}
return chartZoomer.scale(computator, detector.getFocusX(), detector.getFocusY(), scale);
}
return false;
}
}
protected class PreviewChartGestureListener extends ChartGestureListener {
@Override
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
return super.onScroll(e1, e2, -distanceX, -distanceY);
}
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
return super.onFling(e1, e2, -velocityX, -velocityY);
}
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/gesture/ZoomType.java
================================================
package lecho.lib.hellocharts.gesture;
public enum ZoomType {
HORIZONTAL, VERTICAL, HORIZONTAL_AND_VERTICAL;
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/gesture/ZoomerCompat.java
================================================
/*
* Copyright 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package lecho.lib.hellocharts.gesture;
import android.content.Context;
import android.os.SystemClock;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.Interpolator;
/**
* A simple class that animates double-touch zoom gestures. Functionally similar to a {@link android.widget.Scroller}.
*/
public class ZoomerCompat {
private static final int DEFAULT_SHORT_ANIMATION_DURATION = 200;
/**
* The interpolator, used for making zooms animate 'naturally.'
*/
private Interpolator mInterpolator;
/**
* The total animation duration for a zoom.
*/
private long mAnimationDurationMillis;
/**
* Whether or not the current zoom has finished.
*/
private boolean mFinished = true;
/**
* The current zoom value; computed by {@link #computeZoom()}.
*/
private float mCurrentZoom;
/**
* The time the zoom started, computed using {@link android.os.SystemClock#elapsedRealtime()}.
*/
private long mStartRTC;
/**
* The destination zoom factor.
*/
private float mEndZoom;
public ZoomerCompat(Context context) {
mInterpolator = new DecelerateInterpolator();
// TODO: use constant
mAnimationDurationMillis = DEFAULT_SHORT_ANIMATION_DURATION;
}
/**
* Forces the zoom finished state to the given value. Unlike {@link #abortAnimation()}, the current zoom value isn't
* set to the ending value.
*
* @see android.widget.Scroller#forceFinished(boolean)
*/
public void forceFinished(boolean finished) {
mFinished = finished;
}
/**
* Aborts the animation, setting the current zoom value to the ending value.
*
* @see android.widget.Scroller#abortAnimation()
*/
public void abortAnimation() {
mFinished = true;
mCurrentZoom = mEndZoom;
}
/**
* Starts a zoom from 1.0 to (1.0 + endZoom). That is, to zoom from 100% to 125%, endZoom should by 0.25f.
*
* @see android.widget.Scroller#startScroll(int, int, int, int)
*/
public void startZoom(float endZoom) {
mStartRTC = SystemClock.elapsedRealtime();
mEndZoom = endZoom;
mFinished = false;
mCurrentZoom = 1f;
}
/**
* Computes the current zoom level, returning true if the zoom is still active and false if the zoom has finished.
*
* @see android.widget.Scroller#computeScrollOffset()
*/
public boolean computeZoom() {
if (mFinished) {
return false;
}
long tRTC = SystemClock.elapsedRealtime() - mStartRTC;
if (tRTC >= mAnimationDurationMillis) {
mFinished = true;
mCurrentZoom = mEndZoom;
return false;
}
float t = tRTC * 1f / mAnimationDurationMillis;
mCurrentZoom = mEndZoom * mInterpolator.getInterpolation(t);
return true;
}
/**
* Returns the current zoom level.
*
* @see android.widget.Scroller#getCurrX()
*/
public float getCurrZoom() {
return mCurrentZoom;
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/listener/BubbleChartOnValueSelectListener.java
================================================
package lecho.lib.hellocharts.listener;
import lecho.lib.hellocharts.model.BubbleValue;
public interface BubbleChartOnValueSelectListener extends OnValueDeselectListener {
public void onValueSelected(int bubbleIndex, BubbleValue value);
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/listener/ColumnChartOnValueSelectListener.java
================================================
package lecho.lib.hellocharts.listener;
import lecho.lib.hellocharts.model.SubcolumnValue;
public interface ColumnChartOnValueSelectListener extends OnValueDeselectListener {
public void onValueSelected(int columnIndex, int subcolumnIndex, SubcolumnValue value);
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/listener/ComboLineColumnChartOnValueSelectListener.java
================================================
package lecho.lib.hellocharts.listener;
import lecho.lib.hellocharts.model.PointValue;
import lecho.lib.hellocharts.model.SubcolumnValue;
public interface ComboLineColumnChartOnValueSelectListener extends OnValueDeselectListener {
public void onColumnValueSelected(int columnIndex, int subcolumnIndex, SubcolumnValue value);
public void onPointValueSelected(int lineIndex, int pointIndex, PointValue value);
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/listener/DummyBubbleChartOnValueSelectListener.java
================================================
package lecho.lib.hellocharts.listener;
import lecho.lib.hellocharts.model.BubbleValue;
public class DummyBubbleChartOnValueSelectListener implements BubbleChartOnValueSelectListener {
@Override
public void onValueSelected(int bubbleIndex, BubbleValue value) {
}
@Override
public void onValueDeselected() {
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/listener/DummyColumnChartOnValueSelectListener.java
================================================
package lecho.lib.hellocharts.listener;
import lecho.lib.hellocharts.model.SubcolumnValue;
public class DummyColumnChartOnValueSelectListener implements ColumnChartOnValueSelectListener {
@Override
public void onValueSelected(int columnIndex, int subcolumnIndex, SubcolumnValue value) {
}
@Override
public void onValueDeselected() {
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/listener/DummyCompoLineColumnChartOnValueSelectListener.java
================================================
package lecho.lib.hellocharts.listener;
import lecho.lib.hellocharts.model.PointValue;
import lecho.lib.hellocharts.model.SubcolumnValue;
public class DummyCompoLineColumnChartOnValueSelectListener implements ComboLineColumnChartOnValueSelectListener {
@Override
public void onColumnValueSelected(int columnIndex, int subcolumnIndex, SubcolumnValue value) {
}
@Override
public void onPointValueSelected(int lineIndex, int pointIndex, PointValue value) {
}
@Override
public void onValueDeselected() {
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/listener/DummyLineChartOnValueSelectListener.java
================================================
package lecho.lib.hellocharts.listener;
import lecho.lib.hellocharts.model.PointValue;
public class DummyLineChartOnValueSelectListener implements LineChartOnValueSelectListener {
@Override
public void onValueSelected(int lineIndex, int pointIndex, PointValue value) {
}
@Override
public void onValueDeselected() {
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/listener/DummyPieChartOnValueSelectListener.java
================================================
package lecho.lib.hellocharts.listener;
import lecho.lib.hellocharts.model.SliceValue;
public class DummyPieChartOnValueSelectListener implements PieChartOnValueSelectListener {
@Override
public void onValueSelected(int arcIndex, SliceValue value) {
}
@Override
public void onValueDeselected() {
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/listener/DummyVieportChangeListener.java
================================================
package lecho.lib.hellocharts.listener;
import lecho.lib.hellocharts.model.Viewport;
public class DummyVieportChangeListener implements ViewportChangeListener {
@Override
public void onViewportChanged(Viewport viewport) {
// Do nothing
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/listener/LineChartOnValueSelectListener.java
================================================
package lecho.lib.hellocharts.listener;
import lecho.lib.hellocharts.model.PointValue;
public interface LineChartOnValueSelectListener extends OnValueDeselectListener {
public void onValueSelected(int lineIndex, int pointIndex, PointValue value);
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/listener/OnValueDeselectListener.java
================================================
package lecho.lib.hellocharts.listener;
public interface OnValueDeselectListener {
/**
* Called only in chart selection mode when user touch empty space causing value deselection.
* Note: this method is not called when selection mode is disabled.
*/
public void onValueDeselected();
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/listener/PieChartOnValueSelectListener.java
================================================
package lecho.lib.hellocharts.listener;
import lecho.lib.hellocharts.model.SliceValue;
public interface PieChartOnValueSelectListener extends OnValueDeselectListener {
public void onValueSelected(int arcIndex, SliceValue value);
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/listener/ViewportChangeListener.java
================================================
package lecho.lib.hellocharts.listener;
import lecho.lib.hellocharts.model.Viewport;
/**
* Use implementations of this listener to be notified when chart viewport changed. For now it works only for preview
* charts. To make it works for other chart types you just need to uncomment last line in
* {@link lecho.lib.hellocharts.computator.ChartComputator#constrainViewport(float, float, float, float)} method.
*/
public interface ViewportChangeListener {
/**
* Called when current viewport of chart changed. You should not modify that viewport.
*/
public void onViewportChanged(Viewport viewport);
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/model/AbstractChartData.java
================================================
package lecho.lib.hellocharts.model;
import android.graphics.Color;
import android.graphics.Typeface;
import lecho.lib.hellocharts.util.ChartUtils;
/**
* Base class for most chart data models.
*/
public abstract class AbstractChartData implements ChartData {
public static final int DEFAULT_TEXT_SIZE_SP = 12;
protected Axis axisXBottom;
protected Axis axisYLeft;
protected Axis axisXTop;
protected Axis axisYRight;
protected int valueLabelTextColor = Color.WHITE;
protected int valueLabelTextSize = DEFAULT_TEXT_SIZE_SP;
protected Typeface valueLabelTypeface;
/**
* If true each value label will have background rectangle
*/
protected boolean isValueLabelBackgroundEnabled = true;
/**
* If true and {@link #isValueLabelBackgroundEnabled} is true each label will have background rectangle and that
* rectangle will be filled with color specified for given value.
*/
protected boolean isValueLabelBackgrountAuto = true;
/**
* If {@link #isValueLabelBackgroundEnabled} is true and {@link #isValueLabelBackgrountAuto} is false each label
* will have background rectangle and that rectangle will be filled with this color. Helpful if you want all labels
* to have the same background color.
*/
protected int valueLabelBackgroundColor = ChartUtils.darkenColor(ChartUtils.DEFAULT_DARKEN_COLOR);
public AbstractChartData() {
}
/**
* Copy constructor for deep copy.
*
* @param data
*/
public AbstractChartData(AbstractChartData data) {
if (null != data.axisXBottom) {
this.axisXBottom = new Axis(data.axisXBottom);
}
if (null != data.axisXTop) {
this.axisXTop = new Axis(data.axisXTop);
}
if (null != data.axisYLeft) {
this.axisYLeft = new Axis(data.axisYLeft);
}
if (null != data.axisYRight) {
this.axisYRight = new Axis(data.axisYRight);
}
this.valueLabelTextColor = data.valueLabelTextColor;
this.valueLabelTextSize = data.valueLabelTextSize;
this.valueLabelTypeface = data.valueLabelTypeface;
}
@Override
public Axis getAxisXBottom() {
return axisXBottom;
}
@Override
public void setAxisXBottom(Axis axisX) {
this.axisXBottom = axisX;
}
@Override
public Axis getAxisYLeft() {
return axisYLeft;
}
@Override
public void setAxisYLeft(Axis axisY) {
this.axisYLeft = axisY;
}
@Override
public Axis getAxisXTop() {
return axisXTop;
}
@Override
public void setAxisXTop(Axis axisX) {
this.axisXTop = axisX;
}
@Override
public Axis getAxisYRight() {
return axisYRight;
}
@Override
public void setAxisYRight(Axis axisY) {
this.axisYRight = axisY;
}
@Override
public int getValueLabelTextColor() {
return valueLabelTextColor;
}
@Override
public void setValueLabelsTextColor(int valueLabelTextColor) {
this.valueLabelTextColor = valueLabelTextColor;
}
@Override
public int getValueLabelTextSize() {
return valueLabelTextSize;
}
@Override
public void setValueLabelTextSize(int valueLabelTextSize) {
this.valueLabelTextSize = valueLabelTextSize;
}
@Override
public Typeface getValueLabelTypeface() {
return valueLabelTypeface;
}
@Override
public void setValueLabelTypeface(Typeface typeface) {
this.valueLabelTypeface = typeface;
}
@Override
public boolean isValueLabelBackgroundEnabled() {
return isValueLabelBackgroundEnabled;
}
@Override
public void setValueLabelBackgroundEnabled(boolean isValueLabelBackgroundEnabled) {
this.isValueLabelBackgroundEnabled = isValueLabelBackgroundEnabled;
}
@Override
public boolean isValueLabelBackgroundAuto() {
return isValueLabelBackgrountAuto;
}
@Override
public void setValueLabelBackgroundAuto(boolean isValueLabelBackgrountAuto) {
this.isValueLabelBackgrountAuto = isValueLabelBackgrountAuto;
}
@Override
public int getValueLabelBackgroundColor() {
return valueLabelBackgroundColor;
}
@Override
public void setValueLabelBackgroundColor(int valueLabelBackgroundColor) {
this.valueLabelBackgroundColor = valueLabelBackgroundColor;
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/model/Axis.java
================================================
package lecho.lib.hellocharts.model;
import android.graphics.Color;
import android.graphics.Typeface;
import java.util.ArrayList;
import java.util.List;
import lecho.lib.hellocharts.formatter.AxisValueFormatter;
import lecho.lib.hellocharts.formatter.SimpleAxisValueFormatter;
import lecho.lib.hellocharts.util.ChartUtils;
/**
* Single axis model. By default axis is auto-generated. Use {@link #setAutoGenerated(boolean)} to disable axis values
* generation and set values manually using {@link #setValues(List)}. If Axis is auto-generated {@link #setValues(List)}
* will be ignored but if you set some values Axis will switch to manual mode. Change how axis labels are displayed by
* changing formatter {@link #setFormatter(lecho.lib.hellocharts.formatter.AxisValueFormatter)}. Axis can have a name
* that should be displayed next to
* labels(that depends on renderer implementation), you can change name using {@link #setName(String)}, by default axis
* name is empty and therefore not displayed.
*/
public class Axis {
public static final int DEFAULT_TEXT_SIZE_SP = 12;
public static final int DEFAULT_MAX_AXIS_LABEL_CHARS = 3;
/**
* Text size for axis labels and name.
*/
private int textSize = DEFAULT_TEXT_SIZE_SP;
/**
* Maximum number of characters used for this axis. Used to determine axis dimensions.
*/
private int maxLabelChars = DEFAULT_MAX_AXIS_LABEL_CHARS;
/**
* Axis values, each value will be used to calculate its label position.
*/
private List<AxisValue> values = new ArrayList<AxisValue>();
/**
* Name for this axis.
*/
private String name;
/**
* If true axis will be generated to automatically fit chart ranges. *
*/
private boolean isAutoGenerated = true;
/**
* If true renderer will draw lines(grid) for this axis.
*/
private boolean hasLines = false;
/**
* If true axis labels will be drown inside chart area.
*/
private boolean isInside = false;
/**
* Axis labels and name text color.
*/
private int textColor = Color.LTGRAY;
/**
* Axis grid lines color.
*/
private int lineColor = ChartUtils.DEFAULT_DARKEN_COLOR;
/**
* Typeface for labels and name text.
*/
private Typeface typeface;
/**
* Formatter used to format labels.
*/
private AxisValueFormatter formatter = new SimpleAxisValueFormatter();
/**
* If true draws a line between the labels and the graph *
*/
private boolean hasSeparationLine = true;
private boolean hasTiltedLabels = false;
/**
* Creates auto-generated axis without name and with default formatter.
*/
public Axis() {
}
/**
* Creates axis with given values(not auto-generated) without name and with default formatter.
*/
public Axis(List<AxisValue> values) {
setValues(values);
}
public Axis(Axis axis) {
this.name = axis.name;
this.isAutoGenerated = axis.isAutoGenerated;
this.hasLines = axis.hasLines;
this.isInside = axis.isInside;
this.textColor = axis.textColor;
this.lineColor = axis.lineColor;
this.textSize = axis.textSize;
this.maxLabelChars = axis.maxLabelChars;
this.typeface = axis.typeface;
this.formatter = axis.formatter;
this.hasSeparationLine = axis.hasSeparationLine;
for (AxisValue axisValue : axis.values) {
this.values.add(new AxisValue(axisValue));
}
}
/**
* Generates Axis with values from start to stop inclusive.
*/
public static Axis generateAxisFromRange(float start, float stop, float step) {
List<AxisValue> values = new ArrayList<AxisValue>();
for (float value = start; value <= stop; value += step) {
AxisValue axisValue = new AxisValue(value);
values.add(axisValue);
}
Axis axis = new Axis(values);
return axis;
}
/**
* Generates Axis with values from given list.
*/
public static Axis generateAxisFromCollection(List<Float> axisValues) {
List<AxisValue> values = new ArrayList<AxisValue>();
int index = 0;
for (float value : axisValues) {
AxisValue axisValue = new AxisValue(value);
values.add(axisValue);
++index;
}
Axis axis = new Axis(values);
return axis;
}
/**
* Generates Axis with values and labels from given lists, both lists must have the same size.
*/
public static Axis generateAxisFromCollection(List<Float> axisValues, List<String> axisValuesLabels) {
if (axisValues.size() != axisValuesLabels.size()) {
throw new IllegalArgumentException("Values and labels lists must have the same size!");
}
List<AxisValue> values = new ArrayList<AxisValue>();
int index = 0;
for (float value : axisValues) {
AxisValue axisValue = new AxisValue(value).setLabel(axisValuesLabels.get(index));
values.add(axisValue);
++index;
}
Axis axis = new Axis(values);
return axis;
}
public List<AxisValue> getValues() {
return values;
}
public Axis setValues(List<AxisValue> values) {
if (null == values) {
this.values = new ArrayList<AxisValue>();
} else {
this.values = values;
}
this.isAutoGenerated = false;
return this;
}
public String getName() {
return name;
}
public Axis setName(String name) {
this.name = name;
return this;
}
public boolean isAutoGenerated() {
return isAutoGenerated;
}
public Axis setAutoGenerated(boolean isAutoGenerated) {
this.isAutoGenerated = isAutoGenerated;
return this;
}
public boolean hasLines() {
return hasLines;
}
public Axis setHasLines(boolean hasLines) {
this.hasLines = hasLines;
return this;
}
public int getTextColor() {
return textColor;
}
public Axis setTextColor(int color) {
this.textColor = color;
return this;
}
/**
* @see #setInside(boolean)
*/
public boolean isInside() {
return isInside;
}
/**
* Set to true if you want axis values to be drawn inside chart area(axis name still will be drawn outside), by
* default this is set to false and axis is drawn outside chart area.
*/
public Axis setInside(boolean isInside) {
this.isInside = isInside;
return this;
}
public int getLineColor() {
return lineColor;
}
public Axis setLineColor(int lineColor) {
this.lineColor = lineColor;
return this;
}
public int getTextSize() {
return textSize;
}
public Axis setTextSize(int textSize) {
this.textSize = textSize;
return this;
}
public int getMaxLabelChars() {
return maxLabelChars;
}
/**
* Set maximum number of characters for axis labels, min 0, max 32.
*/
public Axis setMaxLabelChars(int maxLabelChars) {
if (maxLabelChars < 0) {
maxLabelChars = 0;
} else if (maxLabelChars > 32) {
maxLabelChars = 32;
}
this.maxLabelChars = maxLabelChars;
return this;
}
public Typeface getTypeface() {
return typeface;
}
public Axis setTypeface(Typeface typeface) {
this.typeface = typeface;
return this;
}
public AxisValueFormatter getFormatter() {
return formatter;
}
public Axis setFormatter(AxisValueFormatter formatter) {
if (null == formatter) {
this.formatter = new SimpleAxisValueFormatter();
} else {
this.formatter = formatter;
}
return this;
}
/**
* Set true if you want to draw separation line for this axis, set false to hide separation line, by default true.
*/
public Axis setHasSeparationLine(boolean hasSeparationLine) {
this.hasSeparationLine = hasSeparationLine;
return this;
}
public boolean hasSeparationLine() {
return hasSeparationLine;
}
public boolean hasTiltedLabels() {
return hasTiltedLabels;
}
public Axis setHasTiltedLabels(boolean hasTiltedLabels) {
this.hasTiltedLabels = hasTiltedLabels;
return this;
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/model/AxisValue.java
================================================
package lecho.lib.hellocharts.model;
import java.util.Arrays;
/**
* Single axis value, use it to manually set axis labels position. You can use label attribute to display text instead
* of number but value formatter implementation have to handle it.
*/
public class AxisValue {
private float value;
private char[] label;
public AxisValue(float value) {
setValue(value);
}
@Deprecated
public AxisValue(float value, char[] label) {
this.value = value;
this.label = label;
}
public AxisValue(AxisValue axisValue) {
this.value = axisValue.value;
this.label = axisValue.label;
}
public float getValue() {
return value;
}
public AxisValue setValue(float value) {
this.value = value;
return this;
}
@Deprecated
public char[] getLabel() {
return label;
}
/**
* Set custom label for this axis value.
*
* @param label
*/
public AxisValue setLabel(String label) {
this.label = label.toCharArray();
return this;
}
public char[] getLabelAsChars() {
return label;
}
/**
* Set custom label for this axis value.
*
* @param label
*/
@Deprecated
public AxisValue setLabel(char[] label) {
this.label = label;
return this;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
AxisValue axisValue = (AxisValue) o;
if (Float.compare(axisValue.value, value) != 0) return false;
if (!Arrays.equals(label, axisValue.label)) return false;
return true;
}
@Override
public int hashCode() {
int result = (value != +0.0f ? Float.floatToIntBits(value) : 0);
result = 31 * result + (label != null ? Arrays.hashCode(label) : 0);
return result;
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/model/BubbleChartData.java
================================================
package lecho.lib.hellocharts.model;
import java.util.ArrayList;
import java.util.List;
import lecho.lib.hellocharts.formatter.BubbleChartValueFormatter;
import lecho.lib.hellocharts.formatter.SimpleBubbleChartValueFormatter;
import lecho.lib.hellocharts.view.Chart;
/**
* Data for BubbleChart.
*/
public class BubbleChartData extends AbstractChartData {
public static final int DEFAULT_MIN_BUBBLE_RADIUS_DP = 6;
public static final float DEFAULT_BUBBLE_SCALE = 1f;
private BubbleChartValueFormatter formatter = new SimpleBubbleChartValueFormatter();
private boolean hasLabels = false;
private boolean hasLabelsOnlyForSelected = false;
private int minBubbleRadius = DEFAULT_MIN_BUBBLE_RADIUS_DP;
private float bubbleScale = DEFAULT_BUBBLE_SCALE;
// TODO: consider Collections.emptyList()
private List<BubbleValue> values = new ArrayList<BubbleValue>();
public BubbleChartData() {
}
public BubbleChartData(List<BubbleValue> values) {
setValues(values);
}
/**
* Copy constructor for deep copy.
*/
public BubbleChartData(BubbleChartData data) {
super(data);
this.formatter = data.formatter;
this.hasLabels = data.hasLabels;
this.hasLabelsOnlyForSelected = data.hasLabelsOnlyForSelected;
this.minBubbleRadius = data.minBubbleRadius;
this.bubbleScale = data.bubbleScale;
for (BubbleValue bubbleValue : data.getValues()) {
this.values.add(new BubbleValue(bubbleValue));
}
}
public static BubbleChartData generateDummyData() {
final int numValues = 4;
BubbleChartData data = new BubbleChartData();
List<BubbleValue> values = new ArrayList<BubbleValue>(numValues);
values.add(new BubbleValue(0, 20, 15000));
values.add(new BubbleValue(3, 22, 20000));
values.add(new BubbleValue(5, 25, 5000));
values.add(new BubbleValue(7, 30, 30000));
values.add(new BubbleValue(11, 22, 10));
data.setValues(values);
return data;
}
@Override
public void update(float scale) {
for (BubbleValue value : values) {
value.update(scale);
}
}
@Override
public void finish() {
for (BubbleValue value : values) {
value.finish();
}
}
public List<BubbleValue> getValues() {
return values;
}
public BubbleChartData setValues(List<BubbleValue> values) {
if (null == values) {
this.values = new ArrayList<BubbleValue>();
} else {
this.values = values;
}
return this;
}
public boolean hasLabels() {
return hasLabels;
}
public BubbleChartData setHasLabels(boolean hasLabels) {
this.hasLabels = hasLabels;
if (hasLabels) {
hasLabelsOnlyForSelected = false;
}
return this;
}
/**
* @see #setHasLabelsOnlyForSelected(boolean)
*/
public boolean hasLabelsOnlyForSelected() {
return hasLabelsOnlyForSelected;
}
/**
* Set true if you want to show value labels only for selected value, works best when chart has
* isValueSelectionEnabled set to true {@link Chart#setValueSelectionEnabled(boolean)}.
*/
public BubbleChartData setHasLabelsOnlyForSelected(boolean hasLabelsOnlyForSelected) {
this.hasLabelsOnlyForSelected = hasLabelsOnlyForSelected;
if (hasLabelsOnlyForSelected) {
this.hasLabels = false;
}
return this;
}
/**
* Returns minimal bubble radius in dp.
*
* @see #setMinBubbleRadius(int)
*/
public int getMinBubbleRadius() {
return minBubbleRadius;
}
/**
* Set minimal bubble radius in dp, helpful when you want small bubbles(bubbles with very small z values compared to
* other bubbles) to be visible on chart, default 6dp
*/
public void setMinBubbleRadius(int minBubbleRadius) {
this.minBubbleRadius = minBubbleRadius;
}
/**
* Returns bubble scale which is used to adjust bubble size.
*
* @see #setBubbleScale(float)
*/
public float getBubbleScale() {
return bubbleScale;
}
/**
* Set bubble scale which is used to adjust bubble size. If you want smaller bubbles set scale {@code <0, 1>},
* if you want bigger bubbles set scale greater than 1, default is 1.0f.
*/
public void setBubbleScale(float bubbleScale) {
this.bubbleScale = bubbleScale;
}
public BubbleChartValueFormatter getFormatter() {
return formatter;
}
public BubbleChartData setFormatter(BubbleChartValueFormatter formatter) {
if (null != formatter) {
this.formatter = formatter;
}
return this;
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/model/BubbleValue.java
================================================
package lecho.lib.hellocharts.model;
import java.util.Arrays;
import lecho.lib.hellocharts.util.ChartUtils;
import lecho.lib.hellocharts.view.Chart;
/**
* Single value drawn as bubble on BubbleChart.
*/
public class BubbleValue {
/**
* Current X value.
*/
private float x;
/**
* Current Y value.
*/
private float y;
/**
* Current Z value , third bubble value interpreted as bubble area.
*/
private float z;
/**
* Origin X value, used during value animation.
*/
private float originX;
/**
* Origin Y value, used during value animation.
*/
private float originY;
/**
* Origin Z value, used during value animation.
*/
private float originZ;
/**
* Difference between originX value and target X value.
*/
private float diffX;
/**
* Difference between originX value and target X value.
*/
private float diffY;
/**
* Difference between originX value and target X value.
*/
private float diffZ;
private int color = ChartUtils.DEFAULT_COLOR;
private int darkenColor = ChartUtils.DEFAULT_DARKEN_COLOR;
private ValueShape shape = ValueShape.CIRCLE;
private char[] label;
public BubbleValue() {
set(0, 0, 0);
}
public BubbleValue(float x, float y, float z) {
set(x, y, z);
}
public BubbleValue(float x, float y, float z, int color) {
set(x, y, z);
setColor(color);
}
public BubbleValue(BubbleValue bubbleValue) {
set(bubbleValue.x, bubbleValue.y, bubbleValue.z);
setColor(bubbleValue.color);
this.label = bubbleValue.label;
}
public void update(float scale) {
x = originX + diffX * scale;
y = originY + diffY * scale;
z = originZ + diffZ * scale;
}
public void finish() {
set(originX + diffX, originY + diffY, originZ + diffZ);
}
public BubbleValue set(float x, float y, float z) {
this.x = x;
this.y = y;
this.z = z;
this.originX = x;
this.originY = y;
this.originZ = z;
this.diffX = 0;
this.diffY = 0;
this.diffZ = 0;
return this;
}
/**
* Set target values that should be reached when data animation finish then call {@link Chart#startDataAnimation()}
*/
public BubbleValue setTarget(float targetX, float targetY, float targetZ) {
set(x, y, z);
this.diffX = targetX - originX;
this.diffY = targetY - originY;
this.diffZ = targetZ - originZ;
return this;
}
public float getX() {
return this.x;
}
public float getY() {
return this.y;
}
public float getZ() {
return this.z;
}
public int getColor() {
return color;
}
public BubbleValue setColor(int color) {
this.color = color;
this.darkenColor = ChartUtils.darkenColor(color);
return this;
}
public int getDarkenColor() {
return darkenColor;
}
public ValueShape getShape() {
return shape;
}
public BubbleValue setShape(ValueShape shape) {
this.shape = shape;
return this;
}
@Deprecated
public char[] getLabel() {
return label;
}
public BubbleValue setLabel(String label) {
this.label = label.toCharArray();
return this;
}
public char[] getLabelAsChars() {
return label;
}
@Deprecated
public BubbleValue setLabel(char[] label) {
this.label = label;
return this;
}
@Override
public String toString() {
return "BubbleValue [x=" + x + ", y=" + y + ", z=" + z + "]";
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
BubbleValue that = (BubbleValue) o;
if (color != that.color) return false;
if (darkenColor != that.darkenColor) return false;
if (Float.compare(that.diffX, diffX) != 0) return false;
if (Float.compare(that.diffY, diffY) != 0) return false;
if (Float.compare(that.diffZ, diffZ) != 0) return false;
if (Float.compare(that.originX, originX) != 0) return false;
if (Float.compare(that.originY, originY) != 0) return false;
if (Float.compare(that.originZ, originZ) != 0) return false;
if (Float.compare(that.x, x) != 0) return false;
if (Float.compare(that.y, y) != 0) return false;
if (Float.compare(that.z, z) != 0) return false;
if (!Arrays.equals(label, that.label)) return false;
if (shape != that.shape) return false;
return true;
}
@Override
public int hashCode() {
int result = (x != +0.0f ? Float.floatToIntBits(x) : 0);
result = 31 * result + (y != +0.0f ? Float.floatToIntBits(y) : 0);
result = 31 * result + (z != +0.0f ? Float.floatToIntBits(z) : 0);
result = 31 * result + (originX != +0.0f ? Float.floatToIntBits(originX) : 0);
result = 31 * result + (originY != +0.0f ? Float.floatToIntBits(originY) : 0);
result = 31 * result + (originZ != +0.0f ? Float.floatToIntBits(originZ) : 0);
result = 31 * result + (diffX != +0.0f ? Float.floatToIntBits(diffX) : 0);
result = 31 * result + (diffY != +0.0f ? Float.floatToIntBits(diffY) : 0);
result = 31 * result + (diffZ != +0.0f ? Float.floatToIntBits(diffZ) : 0);
result = 31 * result + color;
result = 31 * result + darkenColor;
result = 31 * result + (shape != null ? shape.hashCode() : 0);
result = 31 * result + (label != null ? Arrays.hashCode(label) : 0);
return result;
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/model/ChartData.java
================================================
package lecho.lib.hellocharts.model;
import android.graphics.Typeface;
/**
* Base interface for all chart data models.
*/
public interface ChartData {
/**
* Updates data by scale during animation.
*
* @param scale value from 0 to 1.0
*/
public void update(float scale);
/**
* Inform data that animation finished(data should be update with scale 1.0f).
*/
public void finish();
/**
* @see #setAxisXBottom(Axis)
*/
public Axis getAxisXBottom();
/**
* Set horizontal axis at the bottom of the chart. Pass null to remove that axis.
*
* @param axisX
*/
public void setAxisXBottom(Axis axisX);
/**
* @see #setAxisYLeft(Axis)
*/
public Axis getAxisYLeft();
/**
* Set vertical axis on the left of the chart. Pass null to remove that axis.
*
* @param axisY
*/
public void setAxisYLeft(Axis axisY);
/**
* @see #setAxisXTop(Axis)
*/
public Axis getAxisXTop();
/**
* Set horizontal axis at the top of the chart. Pass null to remove that axis.
*
* @param axisX
*/
public void setAxisXTop(Axis axisX);
/**
* @see #setAxisYRight(Axis)
*/
public Axis getAxisYRight();
/**
* Set vertical axis on the right of the chart. Pass null to remove that axis.
*
* @param axisY
*/
public void setAxisYRight(Axis axisY);
/**
* Returns color used to draw value label text.
*/
public int getValueLabelTextColor();
/**
* Set value label text color, by default Color.WHITE.
*/
public void setValueLabelsTextColor(int labelsTextColor);
/**
* Returns text size for value label in SP units.
*/
public int getValueLabelTextSize();
/**
* Set text size for value label in SP units.
*/
public void setValueLabelTextSize(int labelsTextSize);
/**
* Returns Typeface for value labels.
*
* @return Typeface or null if Typeface is not set.
*/
public Typeface getValueLabelTypeface();
/**
* Set Typeface for all values labels.
*
* @param typeface
*/
public void setValueLabelTypeface(Typeface typeface);
/**
* @see #setValueLabelBackgroundEnabled(boolean)
*/
public boolean isValueLabelBackgroundEnabled();
/**
* Set whether labels should have rectangle background. Default is true.
*/
public void setValueLabelBackgroundEnabled(boolean isValueLabelBackgroundEnabled);
/**
* @see #setValueLabelBackgroundAuto(boolean)
*/
public boolean isValueLabelBackgroundAuto();
/**
* Set false if you want to set custom color for all value labels. Default is true.
*/
public void setValueLabelBackgroundAuto(boolean isValueLabelBackgrountAuto);
/**
* @see #setValueLabelBackgroundColor(int)
*/
public int getValueLabelBackgroundColor();
/**
* Set value labels background. This value is used only if isValueLabelBackgroundAuto returns false. Default is
* green.
*/
public void setValueLabelBackgroundColor(int valueLabelBackgroundColor);
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/model/Column.java
================================================
package lecho.lib.hellocharts.model;
import java.util.ArrayList;
import java.util.List;
import lecho.lib.hellocharts.formatter.ColumnChartValueFormatter;
import lecho.lib.hellocharts.formatter.SimpleColumnChartValueFormatter;
import lecho.lib.hellocharts.view.Chart;
/**
* Single column for ColumnChart. One column can be divided into multiple sub-columns(ColumnValues) especially for
* stacked ColumnChart.
* Note: you can set X value for columns or sub-columns, columns are by default indexed from 0 to numOfColumns-1 and
* column index is used as column X value, so first column has X value 0, second clumn has X value 1 etc.
* If you want to display AxisValue for given column you should initialize AxisValue with X value of that column.
*/
public class Column {
private boolean hasLabels = false;
private boolean hasLabelsOnlyForSelected = false;
private ColumnChartValueFormatter formatter = new SimpleColumnChartValueFormatter();
// TODO: consider Collections.emptyList()
private List<SubcolumnValue> values = new ArrayList<SubcolumnValue>();
public Column() {
}
public Column(List<SubcolumnValue> values) {
setValues(values);
}
public Column(Column column) {
this.hasLabels = column.hasLabels;
this.hasLabelsOnlyForSelected = column.hasLabelsOnlyForSelected;
this.formatter = column.formatter;
for (SubcolumnValue columnValue : column.values) {
this.values.add(new SubcolumnValue(columnValue));
}
}
public void update(float scale) {
for (SubcolumnValue value : values) {
value.update(scale);
}
}
public void finish() {
for (SubcolumnValue value : values) {
value.finish();
}
}
public List<SubcolumnValue> getValues() {
return values;
}
public Column setValues(List<SubcolumnValue> values) {
if (null == values) {
this.values = new ArrayList<SubcolumnValue>();
} else {
this.values = values;
}
return this;
}
public boolean hasLabels() {
return hasLabels;
}
public Column setHasLabels(boolean hasLabels) {
this.hasLabels = hasLabels;
if (hasLabels) {
this.hasLabelsOnlyForSelected = false;
}
return this;
}
/**
* @see #setHasLabelsOnlyForSelected(boolean)
*/
public boolean hasLabelsOnlyForSelected() {
return hasLabelsOnlyForSelected;
}
/**
* Set true if you want to show value labels only for selected value, works best when chart has
* isValueSelectionEnabled set to true {@link Chart#setValueSelectionEnabled(boolean)}.
*/
public Column setHasLabelsOnlyForSelected(boolean hasLabelsOnlyForSelected) {
this.hasLabelsOnlyForSelected = hasLabelsOnlyForSelected;
if (hasLabelsOnlyForSelected) {
this.hasLabels = false;
}
return this;
}
public ColumnChartValueFormatter getFormatter() {
return formatter;
}
public Column setFormatter(ColumnChartValueFormatter formatter) {
if (null != formatter) {
this.formatter = formatter;
}
return this;
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/model/ColumnChartData.java
================================================
package lecho.lib.hellocharts.model;
import java.util.ArrayList;
import java.util.List;
/**
* Data model for column chart. Note: you can set X value for columns or sub-columns, columns are by default indexed
* from 0 to numOfColumns-1 and
* column index is used as column X value, so first column has X value 0, second clumn has X value 1 etc.
* If you want to display AxisValue for given column you should initialize AxisValue with X value of that column.
*/
public class ColumnChartData extends AbstractChartData {
public static final float DEFAULT_FILL_RATIO = 0.75f;
public static final float DEFAULT_BASE_VALUE = 0.0f;
private float fillRatio = DEFAULT_FILL_RATIO;
private float baseValue = DEFAULT_BASE_VALUE;
private List<Column> columns = new ArrayList<Column>();
private boolean isStacked = false;
public ColumnChartData() {
}
public ColumnChartData(List<Column> columns) {
setColumns(columns);
}
/**
* Copy constructor for deep copy.
*/
public ColumnChartData(ColumnChartData data) {
super(data);
this.isStacked = data.isStacked;
this.fillRatio = data.fillRatio;
for (Column column : data.columns) {
this.columns.add(new Column(column));
}
}
public static ColumnChartData generateDummyData() {
final int numColumns = 4;
ColumnChartData data = new ColumnChartData();
List<Column> columns = new ArrayList<Column>(numColumns);
List<SubcolumnValue> values;
Column column;
for (int i = 1; i <= numColumns; ++i) {
values = new ArrayList<SubcolumnValue>(numColumns);
values.add(new SubcolumnValue(i));
column = new Column(values);
columns.add(column);
}
data.setColumns(columns);
return data;
}
@Override
public void update(float scale) {
for (Column column : columns) {
column.update(scale);
}
}
@Override
public void finish() {
for (Column column : columns) {
column.finish();
}
}
public List<Column> getColumns() {
return columns;
}
public ColumnChartData setColumns(List<Column> columns) {
if (null == columns) {
this.columns = new ArrayList<Column>();
} else {
this.columns = columns;
}
return this;
}
public boolean isStacked() {
return isStacked;
}
/**
* Set true if you want stacked column chart.
*
* @param isStacked
* @return
*/
public ColumnChartData setStacked(boolean isStacked) {
this.isStacked = isStacked;
return this;
}
public float getFillRatio() {
return fillRatio;
}
/**
* Set fill ration for columns, value from 0 to 1, 1 means that there will be almost no free space between columns,
* 0 means that columns will have minimum width(2px).
*
* @param fillRatio
* @return
*/
public ColumnChartData setFillRatio(float fillRatio) {
if (fillRatio < 0) {
fillRatio = 0;
}
if (fillRatio > 1) {
fillRatio = 1;
}
this.fillRatio = fillRatio;
return this;
}
/**
* @see #setBaseValue(float)
*/
public float getBaseValue() {
return baseValue;
}
/**
* Set value below which values will be drawn as negative, by default 0.
*/
public ColumnChartData setBaseValue(float baseValue) {
this.baseValue = baseValue;
return this;
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/model/ComboLineColumnChartData.java
================================================
package lecho.lib.hellocharts.model;
/**
* Data model for combo line-column chart. It uses ColumnChartData and LineChartData internally.
*/
public class ComboLineColumnChartData extends AbstractChartData {
private ColumnChartData columnChartData;
private LineChartData lineChartData;
public ComboLineColumnChartData() {
this.columnChartData = new ColumnChartData();
this.lineChartData = new LineChartData();
}
public ComboLineColumnChartData(ColumnChartData columnChartData, LineChartData lineChartData) {
setColumnChartData(columnChartData);
setLineChartData(lineChartData);
}
public ComboLineColumnChartData(ComboLineColumnChartData data) {
super(data);
setColumnChartData(new ColumnChartData(data.getColumnChartData()));
setLineChartData(new LineChartData(data.getLineChartData()));
}
public static ComboLineColumnChartData generateDummyData() {
ComboLineColumnChartData data = new ComboLineColumnChartData();
data.setColumnChartData(ColumnChartData.generateDummyData());
data.setLineChartData(LineChartData.generateDummyData());
return data;
}
@Override
public void update(float scale) {
columnChartData.update(scale);
lineChartData.update(scale);
}
@Override
public void finish() {
columnChartData.finish();
lineChartData.finish();
}
public ColumnChartData getColumnChartData() {
return columnChartData;
}
public void setColumnChartData(ColumnChartData columnChartData) {
if (null == columnChartData) {
this.columnChartData = new ColumnChartData();
} else {
this.columnChartData = columnChartData;
}
}
public LineChartData getLineChartData() {
return lineChartData;
}
public void setLineChartData(LineChartData lineChartData) {
if (null == lineChartData) {
this.lineChartData = new LineChartData();
} else {
this.lineChartData = lineChartData;
}
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/model/Line.java
================================================
package lecho.lib.hellocharts.model;
import android.graphics.PathEffect;
import java.util.ArrayList;
import java.util.List;
import lecho.lib.hellocharts.formatter.LineChartValueFormatter;
import lecho.lib.hellocharts.formatter.SimpleLineChartValueFormatter;
import lecho.lib.hellocharts.util.ChartUtils;
import lecho.lib.hellocharts.view.Chart;
/**
* Single line for line chart.
*/
public class Line {
private static final int DEFAULT_LINE_STROKE_WIDTH_DP = 3;
private static final int DEFAULT_POINT_RADIUS_DP = 6;
private static final int DEFAULT_AREA_TRANSPARENCY = 64;
public static final int UNINITIALIZED = 0;
private int color = ChartUtils.DEFAULT_COLOR;
private int pointColor = UNINITIALIZED;
private int darkenColor = ChartUtils.DEFAULT_DARKEN_COLOR;
/**
* Transparency of area when line is filled. *
*/
private int areaTransparency = DEFAULT_AREA_TRANSPARENCY;
private int strokeWidth = DEFAULT_LINE_STROKE_WIDTH_DP;
private int pointRadius = DEFAULT_POINT_RADIUS_DP;
private boolean hasGradientToTransparent = false;
private boolean hasPoints = true;
private boolean hasLines = true;
private boolean hasLabels = false;
private boolean hasLabelsOnlyForSelected = false;
private boolean isCubic = false;
private boolean isSquare = false;
private boolean isFilled = false;
private ValueShape shape = ValueShape.CIRCLE;
private PathEffect pathEffect;
private LineChartValueFormatter formatter = new SimpleLineChartValueFormatter();
private List<PointValue> values = new ArrayList<PointValue>();
public Line() {
}
public Line(List<PointValue> values) {
setValues(values);
}
public Line(Line line) {
this.color = line.color;
this.pointColor = line.pointColor;
this.darkenColor = line.darkenColor;
this.areaTransparency = line.areaTransparency;
this.strokeWidth = line.strokeWidth;
this.pointRadius = line.pointRadius;
this.hasGradientToTransparent = line.hasGradientToTransparent;
this.hasPoints = line.hasPoints;
this.hasLines = line.hasLines;
this.hasLabels = line.hasLabels;
this.hasLabelsOnlyForSelected = line.hasLabelsOnlyForSelected;
this.isSquare = line.isSquare;
this.isCubic = line.isCubic;
this.isFilled = line.isFilled;
this.shape = line.shape;
this.pathEffect = line.pathEffect;
this.formatter = line.formatter;
for (PointValue pointValue : line.values) {
this.values.add(new PointValue(pointValue));
}
}
public void update(float scale) {
for (PointValue value : values) {
value.update(scale);
}
}
public void finish() {
for (PointValue value : values) {
value.finish();
}
}
public List<PointValue> getValues() {
return this.values;
}
public void setValues(List<PointValue> values) {
if (null == values) {
this.values = new ArrayList<PointValue>();
} else {
this.values = values;
}
}
public int getColor() {
return color;
}
public Line setColor(int color) {
this.color = color;
if (pointColor == UNINITIALIZED) {
this.darkenColor = ChartUtils.darkenColor(color);
}
return this;
}
public int getPointColor() {
if (pointColor == UNINITIALIZED) {
return color;
} else {
return pointColor;
}
}
public Line setPointColor(int pointColor) {
this.pointColor = pointColor;
if (pointColor == UNINITIALIZED) {
this.darkenColor = ChartUtils.darkenColor(color);
} else {
this.darkenColor = ChartUtils.darkenColor(pointColor);
}
return this;
}
public int getDarkenColor() {
return darkenColor;
}
/**
* @see #setAreaTransparency(int)
*/
public int getAreaTransparency() {
return areaTransparency;
}
/**
* Set area transparency(255 is full opacity) for filled lines
*
* @param areaTransparency
* @return
*/
public Line setAreaTransparency(int areaTransparency) {
this.areaTransparency = areaTransparency;
return this;
}
public int getStrokeWidth() {
return strokeWidth;
}
public Line setStrokeWidth(int strokeWidth) {
this.strokeWidth = strokeWidth;
return this;
}
public boolean hasPoints() {
return hasPoints;
}
public Line setHasPoints(boolean hasPoints) {
this.hasPoints = hasPoints;
return this;
}
public boolean hasLines() {
return hasLines;
}
public Line setHasLines(boolean hasLines) {
this.hasLines = hasLines;
return this;
}
public boolean hasLabels() {
return hasLabels;
}
public Line setHasLabels(boolean hasLabels) {
this.hasLabels = hasLabels;
if (hasLabels) {
this.hasLabelsOnlyForSelected = false;
}
return this;
}
/**
* @see #setHasLabelsOnlyForSelected(boolean)
*/
public boolean hasLabelsOnlyForSelected() {
return hasLabelsOnlyForSelected;
}
/**
* Set true if you want to show value labels only for selected value, works best when chart has
* isValueSelectionEnabled set to true {@link Chart#setValueSelectionEnabled(boolean)}.
*/
public Line setHasLabelsOnlyForSelected(boolean hasLabelsOnlyForSelected) {
this.hasLabelsOnlyForSelected = hasLabelsOnlyForSelected;
if (hasLabelsOnlyForSelected) {
this.hasLabels = false;
}
return this;
}
public int getPointRadius() {
return pointRadius;
}
/**
* Set radius for points for this line.
*
* @param pointRadius
* @return
*/
public Line setPointRadius(int pointRadius) {
this.pointRadius = pointRadius;
return this;
}
public boolean getGradientToTransparent() {
return hasGradientToTransparent;
}
public Line setHasGradientToTransparent(boolean hasGradientToTransparent) {
this.hasGradientToTransparent = hasGradientToTransparent;
return this;
}
public boolean isCubic() {
return isCubic;
}
public Line setCubic(boolean isCubic) {
this.isCubic = isCubic;
if (isSquare)
setSquare(false);
return this;
}
public boolean isSquare() {
return isSquare;
}
public Line setSquare(boolean isSquare) {
this.isSquare = isSquare;
if (isCubic)
setCubic(false);
return this;
}
public boolean isFilled() {
return isFilled;
}
public Line setFilled(boolean isFilled) {
this.isFilled = isFilled;
return this;
}
/**
* @see #setShape(ValueShape)
*/
public ValueShape getShape() {
return shape;
}
/**
* Set shape for points, possible values: SQUARE, CIRCLE
*
* @param shape
* @return
*/
public Line setShape(ValueShape shape) {
this.shape = shape;
return this;
}
public PathEffect getPathEffect() {
return pathEffect;
}
/**
* Set path effect for this line, note: it will slow down drawing, try to not use complicated effects,
* DashPathEffect should be safe choice.
*
* @param pathEffect
*/
public void setPathEffect(PathEffect pathEffect) {
this.pathEffect = pathEffect;
}
public LineChartValueFormatter getFormatter() {
return formatter;
}
public Line setFormatter(LineChartValueFormatter formatter) {
if (null != formatter) {
this.formatter = formatter;
}
return this;
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/model/LineChartData.java
================================================
package lecho.lib.hellocharts.model;
import java.util.ArrayList;
import java.util.List;
/**
* Data model for LineChartView.
*/
public class LineChartData extends AbstractChartData {
public static final float DEFAULT_BASE_VALUE = 0.0f;
private List<Line> lines = new ArrayList<Line>();
private float baseValue = DEFAULT_BASE_VALUE;
public LineChartData() {
}
public LineChartData(List<Line> lines) {
setLines(lines);
}
/**
* Copy constructor to perform deep copy of chart data.
*/
public LineChartData(LineChartData data) {
super(data);
this.baseValue = data.baseValue;
for (Line line : data.lines) {
this.lines.add(new Line(line));
}
}
public static LineChartData generateDummyData() {
final int numValues = 4;
LineChartData data = new LineChartData();
List<PointValue> values = new ArrayList<PointValue>(numValues);
values.add(new PointValue(0, 2));
values.add(new PointValue(1, 4));
values.add(new PointValue(2, 3));
values.add(new PointValue(3, 4));
Line line = new Line(values);
List<Line> lines = new ArrayList<Line>(1);
lines.add(line);
data.setLines(lines);
return data;
}
@Override
public void update(float scale) {
for (Line line : lines) {
line.update(scale);
}
}
@Override
public void finish() {
for (Line line : lines) {
line.finish();
}
}
public List<Line> getLines() {
return lines;
}
public LineChartData setLines(List<Line> lines) {
if (null == lines) {
this.lines = new ArrayList<Line>();
} else {
this.lines = lines;
}
return this;
}
/**
* @see #setBaseValue(float)
*/
public float getBaseValue() {
return baseValue;
}
/**
* Set value below which values will be drawn as negative, important attribute for drawing filled area charts, by
* default 0.
*/
public LineChartData setBaseValue(float baseValue) {
this.baseValue = baseValue;
return this;
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/model/PieChartData.java
================================================
package lecho.lib.hellocharts.model;
import android.graphics.Color;
import android.graphics.Typeface;
import java.util.ArrayList;
import java.util.List;
import lecho.lib.hellocharts.formatter.PieChartValueFormatter;
import lecho.lib.hellocharts.formatter.SimplePieChartValueFormatter;
import lecho.lib.hellocharts.view.Chart;
import lecho.lib.hellocharts.view.PieChartView;
/**
* Data for PieChart, by default it doesn't have axes.
*/
public class PieChartData extends AbstractChartData {
public static final int DEFAULT_CENTER_TEXT1_SIZE_SP = 42;
public static final int DEFAULT_CENTER_TEXT2_SIZE_SP = 16;
public static final float DEFAULT_CENTER_CIRCLE_SCALE = 0.6f;
private static final int DEFAULT_SLICE_SPACING_DP = 2;
private int centerText1FontSize = DEFAULT_CENTER_TEXT1_SIZE_SP;
private int centerText2FontSize = DEFAULT_CENTER_TEXT2_SIZE_SP;
private float centerCircleScale = DEFAULT_CENTER_CIRCLE_SCALE;
private int slicesSpacing = DEFAULT_SLICE_SPACING_DP;
private PieChartValueFormatter formatter = new SimplePieChartValueFormatter();
private boolean hasLabels = false;
private boolean hasLabelsOnlyForSelected = false;
private boolean hasLabelsOutside = false;
private boolean hasCenterCircle = false;
private int centerCircleColor = Color.TRANSPARENT;
private int centerText1Color = Color.BLACK;
private Typeface centerText1Typeface;
private String centerText1;
private int centerText2Color = Color.BLACK;
private Typeface centerText2Typeface;
private String centerText2;
private List<SliceValue> values = new ArrayList<SliceValue>();
public PieChartData() {
setAxisXBottom(null);
setAxisYLeft(null);
}
public PieChartData(List<SliceValue> values) {
setValues(values);
// Empty axes. Pie chart don't need axes.
setAxisXBottom(null);
setAxisYLeft(null);
}
public PieChartData(PieChartData data) {
super(data);
this.formatter = data.formatter;
this.hasLabels = data.hasLabels;
this.hasLabelsOnlyForSelected = data.hasLabelsOnlyForSelected;
this.hasLabelsOutside = data.hasLabelsOutside;
this.hasCenterCircle = data.hasCenterCircle;
this.centerCircleColor = data.centerCircleColor;
this.centerCircleScale = data.centerCircleScale;
this.centerText1Color = data.centerText1Color;
this.centerText1FontSize = data.centerText1FontSize;
this.centerText1Typeface = data.centerText1Typeface;
this.centerText1 = data.centerText1;
this.centerText2Color = data.centerText2Color;
this.centerText2FontSize = data.centerText2FontSize;
this.centerText2Typeface = data.centerText2Typeface;
this.centerText2 = data.centerText2;
for (SliceValue sliceValue : data.values) {
this.values.add(new SliceValue(sliceValue));
}
}
public static PieChartData generateDummyData() {
final int numValues = 4;
PieChartData data = new PieChartData();
List<SliceValue> values = new ArrayList<SliceValue>(numValues);
values.add(new SliceValue(40f));
values.add(new SliceValue(20f));
values.add(new SliceValue(30f));
values.add(new SliceValue(50f));
data.setValues(values);
return data;
}
@Override
public void update(float scale) {
for (SliceValue value : values) {
value.update(scale);
}
}
@Override
public void finish() {
for (SliceValue value : values) {
value.finish();
}
}
/**
* PieChart does not support axes so method call will be ignored
*/
@Override
public void setAxisXBottom(Axis axisX) {
super.setAxisXBottom(null);
}
/**
* PieChart does not support axes so method call will be ignored
*/
@Override
public void setAxisYLeft(Axis axisY) {
super.setAxisYLeft(null);
}
public List<SliceValue> getValues() {
return values;
}
public PieChartData setValues(List<SliceValue> values) {
if (null == values) {
this.values = new ArrayList<SliceValue>();
} else {
this.values = values;
}
return this;
}
public boolean hasLabels() {
return hasLabels;
}
public PieChartData setHasLabels(boolean hasLabels) {
this.hasLabels = hasLabels;
if (hasLabels) {
hasLabelsOnlyForSelected = false;
}
return this;
}
/**
* @see #setHasLabelsOnlyForSelected(boolean)
*/
public boolean hasLabelsOnlyForSelected() {
return hasLabelsOnlyForSelected;
}
/**
* Set true if you want to show value labels only for selected value, works best when chart has
* isValueSelectionEnabled set to true {@link Chart#setValueSelectionEnabled(boolean)}.
*/
public PieChartData setHasLabelsOnlyForSelected(boolean hasLabelsOnlyForSelected) {
this.hasLabelsOnlyForSelected = hasLabelsOnlyForSelected;
if (hasLabelsOnlyForSelected) {
this.hasLabels = false;
}
return this;
}
public boolean hasLabelsOutside() {
return hasLabelsOutside;
}
/**
* Set if labels should be drawn inside circle(false) or outside(true). By default false. If you set it to true you
* should also change chart fill ration using {@link PieChartView#setCircleFillRatio(float)}. This flag is used only
* if you also set hasLabels or hasLabelsOnlyForSelected flags.
*/
public PieChartData setHasLabelsOutside(boolean hasLabelsOutside) {
this.hasLabelsOutside = hasLabelsOutside;
return this;
}
public boolean hasCenterCircle() {
return hasCenterCircle;
}
public PieChartData setHasCenterCircle(boolean hasCenterCircle) {
this.hasCenterCircle = hasCenterCircle;
return this;
}
public int getCenterCircleColor() {
return centerCircleColor;
}
public PieChartData setCenterCircleColor(int centerCircleColor) {
this.centerCircleColor = centerCircleColor;
return this;
}
public float getCenterCircleScale() {
return centerCircleScale;
}
public PieChartData setCenterCircleScale(float centerCircleScale) {
this.centerCircleScale = centerCircleScale;
return this;
}
public int getCenterText1Color() {
return centerText1Color;
}
public PieChartData setCenterText1Color(int centerText1Color) {
this.centerText1Color = centerText1Color;
return this;
}
public int getCenterText1FontSize() {
return centerText1FontSize;
}
public PieChartData setCenterText1FontSize(int centerText1FontSize) {
this.centerText1FontSize = centerText1FontSize;
return this;
}
public Typeface getCenterText1Typeface() {
return centerText1Typeface;
}
public PieChartData setCenterText1Typeface(Typeface text1Typeface) {
this.centerText1Typeface = text1Typeface;
return this;
}
public String getCenterText1() {
return centerText1;
}
public PieChartData setCenterText1(String centerText1) {
this.centerText1 = centerText1;
return this;
}
public String getCenterText2() {
return centerText2;
}
/**
* Note that centerText2 will be drawn only if centerText1 is not empty/null.
*/
public PieChartData setCenterText2(String centerText2) {
this.centerText2 = centerText2;
return this;
}
public int getCenterText2Color() {
return centerText2Color;
}
public PieChartData setCenterText2Color(int centerText2Color) {
this.centerText2Color = centerText2Color;
return this;
}
public int getCenterText2FontSize() {
return centerText2FontSize;
}
public PieChartData setCenterText2FontSize(int centerText2FontSize) {
this.centerText2FontSize = centerText2FontSize;
return this;
}
public Typeface getCenterText2Typeface() {
return centerText2Typeface;
}
public PieChartData setCenterText2Typeface(Typeface text2Typeface) {
this.centerText2Typeface = text2Typeface;
return this;
}
public int getSlicesSpacing() {
return slicesSpacing;
}
public PieChartData setSlicesSpacing(int sliceSpacing) {
this.slicesSpacing = sliceSpacing;
return this;
}
public PieChartValueFormatter getFormatter() {
return formatter;
}
public PieChartData setFormatter(PieChartValueFormatter formatter) {
if (null != formatter) {
this.formatter = formatter;
}
return this;
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/model/PointValue.java
================================================
package lecho.lib.hellocharts.model;
import java.util.Arrays;
import lecho.lib.hellocharts.view.Chart;
/**
* Single point coordinates, used for LineChartData.
*/
public class PointValue {
private float x;
private float y;
private float originX;
private float originY;
private float diffX;
private float diffY;
private char[] label;
public PointValue() {
set(0, 0);
}
public PointValue(float x, float y) {
set(x, y);
}
public PointValue(PointValue pointValue) {
set(pointValue.x, pointValue.y);
this.label = pointValue.label;
}
public void update(float scale) {
x = originX + diffX * scale;
y = originY + diffY * scale;
}
public void finish() {
set(originX + diffX, originY + diffY);
}
public PointValue set(float x, float y) {
this.x = x;
this.y = y;
this.originX = x;
this.originY = y;
this.diffX = 0;
this.diffY = 0;
return this;
}
/**
* Set target values that should be reached when data animation finish then call {@link Chart#startDataAnimation()}
*/
public PointValue setTarget(float targetX, float targetY) {
set(x, y);
this.diffX = targetX - originX;
this.diffY = targetY - originY;
return this;
}
public float getX() {
return this.x;
}
public float getY() {
return this.y;
}
@Deprecated
public char[] getLabel() {
return label;
}
public PointValue setLabel(String label) {
this.label = label.toCharArray();
return this;
}
public char[] getLabelAsChars() {
return label;
}
@Deprecated
public PointValue setLabel(char[] label) {
this.label = label;
return this;
}
@Override
public String toString() {
return "PointValue [x=" + x + ", y=" + y + "]";
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
PointValue that = (PointValue) o;
if (Float.compare(that.diffX, diffX) != 0) return false;
if (Float.compare(that.diffY, diffY) != 0) return false;
if (Float.compare(that.originX, originX) != 0) return false;
if (Float.compare(that.originY, originY) != 0) return false;
if (Float.compare(that.x, x) != 0) return false;
if (Float.compare(that.y, y) != 0) return false;
if (!Arrays.equals(label, that.label)) return false;
return true;
}
@Override
public int hashCode() {
int result = (x != +0.0f ? Float.floatToIntBits(x) : 0);
result = 31 * result + (y != +0.0f ? Float.floatToIntBits(y) : 0);
result = 31 * result + (originX != +0.0f ? Float.floatToIntBits(originX) : 0);
result = 31 * result + (originY != +0.0f ? Float.floatToIntBits(originY) : 0);
result = 31 * result + (diffX != +0.0f ? Float.floatToIntBits(diffX) : 0);
result = 31 * result + (diffY != +0.0f ? Float.floatToIntBits(diffY) : 0);
result = 31 * result + (label != null ? Arrays.hashCode(label) : 0);
return result;
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/model/SelectedValue.java
================================================
package lecho.lib.hellocharts.model;
/**
* Holds selected values indexes, i.e. for LineChartModel it will be firstIndex=lineIndex; secondIndex=valueIndex.
*/
public class SelectedValue {
/**
* First index i.e for LineChart that will be line index.
*/
private int firstIndex;
/**
* Second index i.e for LineChart that will be PointValue index.
*/
private int secondIndex;
/**
* Used only for combo charts, in other cases should have value NONE.
*/
private SelectedValueType type = SelectedValueType.NONE;
public SelectedValue() {
clear();
}
public SelectedValue(int firstIndex, int secondIndex, SelectedValueType type) {
set(firstIndex, secondIndex, type);
}
public void set(int firstIndex, int secondIndex, SelectedValueType type) {
this.firstIndex = firstIndex;
this.secondIndex = secondIndex;
if (null != type) {
this.type = type;
} else {
this.type = SelectedValueType.NONE;
}
}
public void set(SelectedValue selectedValue) {
this.firstIndex = selectedValue.firstIndex;
this.secondIndex = selectedValue.secondIndex;
this.type = selectedValue.type;
}
public void clear() {
set(Integer.MIN_VALUE, Integer.MIN_VALUE, SelectedValueType.NONE);
}
/**
* Return true if selected value have meaningful value.
*/
public boolean isSet() {
if (firstIndex >= 0 && secondIndex >= 0) {
return true;
} else {
return false;
}
}
/**
* First index i.e for LineChart that will be line index.
*/
public int getFirstIndex() {
return firstIndex;
}
public void setFirstIndex(int firstIndex) {
this.firstIndex = firstIndex;
}
/**
* Second index i.e for LineChart that will be PointValue index.
*/
public int getSecondIndex() {
return secondIndex;
}
public void setSecondIndex(int secondIndex) {
this.secondIndex = secondIndex;
}
public SelectedValueType getType() {
return type;
}
public void setType(SelectedValueType type) {
this.type = type;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + firstIndex;
result = prime * result + secondIndex;
result = prime * result + ((type == null) ? 0 : type.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
SelectedValue other = (SelectedValue) obj;
if (firstIndex != other.firstIndex)
return false;
if (secondIndex != other.secondIndex)
return false;
if (type != other.type)
return false;
return true;
}
@Override
public String toString() {
return "SelectedValue [firstIndex=" + firstIndex + ", secondIndex=" + secondIndex + ", type=" + type + "]";
}
/**
* Used in combo chart to determine if selected value is used for line or column selection.
*/
public enum SelectedValueType {
NONE, LINE, COLUMN
}
}
================================================
FILE: hellocharts-library/src/lecho/lib/hellocharts/model/SliceValue.java
================================================
package lecho.lib.hellocharts.model;
import java.util.Arrays;
import lecho.lib.hellocharts.util.ChartUtils;
import lecho.lib.hellocharts.view.Chart;
/**
* Model representing single slice on PieChart.
*/
public class SliceValue {
private static final int DEFAULT_SLICE_SPACING_DP = 2;
@Deprecated
/** Spacing between this slice and its neighbors. */
private int sliceSpacing = DEFAULT_SLICE_SPACING_DP;
/**
* Current value of this slice.
*/
private float value;
/**
* Origin value of this slice, used during value animation.
*/
private float originValue;
/**
* Difference between originValue and targetValue.
*/
private float diff;
/**
* Color of this slice.
*/
private int color = ChartUtils.DEFAULT_COLOR;
/**
* Darken color used to draw label background and give touch feedback.
*/
private int darkenColor = ChartUtils.DEFAULT_DARKEN_COLOR;
/**
* Custom label for this slice, if not set number formatting will be used.
*/
private char[] label;
public SliceValue() {
setValue(0);
}
public SliceValue(float value) {
setValue(value);
}
public SliceValue(float value, int color) {
setValue(value);
setColor(color);
}
public SliceValue(float value, int color, int sliceSpacing) {
setValue(value);
setColor(color);
this.sliceSpacing = sliceSpacing;
}
public SliceValue(SliceValue sliceValue) {
setValue(sliceValue.value);
setColor(sliceValue.color);
this.sliceSpacing = sliceValue.sliceSpacing;
this.label = sliceValue.label;
}
public void update(float scale) {
value = originValue + diff * scale;
}
publ
gitextract__p4swg7a/ ├── .gitignore ├── LICENSE.txt ├── README.md ├── build.gradle ├── documentation/ │ └── MAIN.md ├── formatter/ │ └── CodeStyle-HelloCharts.jar ├── gradle/ │ └── wrapper/ │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradle.properties ├── gradlew ├── gradlew.bat ├── hellocharts-library/ │ ├── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── libs/ │ │ └── android-support-v4.jar │ ├── pom.xml │ ├── proguard-project.txt │ ├── project.properties │ ├── res/ │ │ ├── values/ │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ ├── values-v11/ │ │ │ └── styles.xml │ │ └── values-v14/ │ │ └── styles.xml │ └── src/ │ └── lecho/ │ └── lib/ │ └── hellocharts/ │ ├── animation/ │ │ ├── ChartAnimationListener.java │ │ ├── ChartDataAnimator.java │ │ ├── ChartDataAnimatorV14.java │ │ ├── ChartDataAnimatorV8.java │ │ ├── ChartViewportAnimator.java │ │ ├── ChartViewportAnimatorV14.java │ │ ├── ChartViewportAnimatorV8.java │ │ ├── DummyChartAnimationListener.java │ │ ├── PieChartRotationAnimator.java │ │ ├── PieChartRotationAnimatorV14.java │ │ └── PieChartRotationAnimatorV8.java │ ├── computator/ │ │ ├── ChartComputator.java │ │ └── PreviewChartComputator.java │ ├── formatter/ │ │ ├── AxisValueFormatter.java │ │ ├── BubbleChartValueFormatter.java │ │ ├── ColumnChartValueFormatter.java │ │ ├── LineChartValueFormatter.java │ │ ├── PieChartValueFormatter.java │ │ ├── SimpleAxisValueFormatter.java │ │ ├── SimpleBubbleChartValueFormatter.java │ │ ├── SimpleColumnChartValueFormatter.java │ │ ├── SimpleLineChartValueFormatter.java │ │ ├── SimplePieChartValueFormatter.java │ │ └── ValueFormatterHelper.java │ ├── gesture/ │ │ ├── ChartScroller.java │ │ ├── ChartTouchHandler.java │ │ ├── ChartZoomer.java │ │ ├── ContainerScrollType.java │ │ ├── PieChartTouchHandler.java │ │ ├── PreviewChartTouchHandler.java │ │ ├── ZoomType.java │ │ └── ZoomerCompat.java │ ├── listener/ │ │ ├── BubbleChartOnValueSelectListener.java │ │ ├── ColumnChartOnValueSelectListener.java │ │ ├── ComboLineColumnChartOnValueSelectListener.java │ │ ├── DummyBubbleChartOnValueSelectListener.java │ │ ├── DummyColumnChartOnValueSelectListener.java │ │ ├── DummyCompoLineColumnChartOnValueSelectListener.java │ │ ├── DummyLineChartOnValueSelectListener.java │ │ ├── DummyPieChartOnValueSelectListener.java │ │ ├── DummyVieportChangeListener.java │ │ ├── LineChartOnValueSelectListener.java │ │ ├── OnValueDeselectListener.java │ │ ├── PieChartOnValueSelectListener.java │ │ └── ViewportChangeListener.java │ ├── model/ │ │ ├── AbstractChartData.java │ │ ├── Axis.java │ │ ├── AxisValue.java │ │ ├── BubbleChartData.java │ │ ├── BubbleValue.java │ │ ├── ChartData.java │ │ ├── Column.java │ │ ├── ColumnChartData.java │ │ ├── ComboLineColumnChartData.java │ │ ├── Line.java │ │ ├── LineChartData.java │ │ ├── PieChartData.java │ │ ├── PointValue.java │ │ ├── SelectedValue.java │ │ ├── SliceValue.java │ │ ├── SubcolumnValue.java │ │ ├── ValueShape.java │ │ └── Viewport.java │ ├── provider/ │ │ ├── BubbleChartDataProvider.java │ │ ├── ColumnChartDataProvider.java │ │ ├── ComboLineColumnChartDataProvider.java │ │ ├── LineChartDataProvider.java │ │ └── PieChartDataProvider.java │ ├── renderer/ │ │ ├── AbstractChartRenderer.java │ │ ├── AxesRenderer.java │ │ ├── BubbleChartRenderer.java │ │ ├── ChartRenderer.java │ │ ├── ColumnChartRenderer.java │ │ ├── ComboChartRenderer.java │ │ ├── ComboLineColumnChartRenderer.java │ │ ├── LineChartRenderer.java │ │ ├── PieChartRenderer.java │ │ ├── PreviewColumnChartRenderer.java │ │ └── PreviewLineChartRenderer.java │ ├── util/ │ │ ├── AxisAutoValues.java │ │ ├── ChartUtils.java │ │ └── FloatUtils.java │ └── view/ │ ├── AbstractChartView.java │ ├── BubbleChartView.java │ ├── Chart.java │ ├── ColumnChartView.java │ ├── ComboLineColumnChartView.java │ ├── LineChartView.java │ ├── PieChartView.java │ ├── PreviewColumnChartView.java │ ├── PreviewLineChartView.java │ └── hack/ │ ├── HackyDrawerLayout.java │ └── HackyViewPager.java ├── hellocharts-samples/ │ ├── AndroidManifest.xml │ ├── build.gradle │ ├── proguard-project.txt │ ├── project.properties │ ├── res/ │ │ ├── color/ │ │ │ └── selector_text_link.xml │ │ ├── layout/ │ │ │ ├── activity_about.xml │ │ │ ├── activity_bubble_chart.xml │ │ │ ├── activity_column_chart.xml │ │ │ ├── activity_combo_line_column_chart.xml │ │ │ ├── activity_good_bad.xml │ │ │ ├── activity_line_chart.xml │ │ │ ├── activity_line_column_dependency.xml │ │ │ ├── activity_main.xml │ │ │ ├── activity_pie_chart.xml │ │ │ ├── activity_preview_column_chart.xml │ │ │ ├── activity_preview_line_chart.xml │ │ │ ├── activity_tempo_chart.xml │ │ │ ├── activity_view_pager_charts.xml │ │ │ ├── fragment_about.xml │ │ │ ├── fragment_bubble_chart.xml │ │ │ ├── fragment_column_chart.xml │ │ │ ├── fragment_combo_line_column_chart.xml │ │ │ ├── fragment_good_bad.xml │ │ │ ├── fragment_line_chart.xml │ │ │ ├── fragment_line_column_dependency.xml │ │ │ ├── fragment_main.xml │ │ │ ├── fragment_pie_chart.xml │ │ │ ├── fragment_preview_column_chart.xml │ │ │ ├── fragment_preview_line_chart.xml │ │ │ ├── fragment_tempo_chart.xml │ │ │ ├── fragment_view_pager_charts.xml │ │ │ └── list_item_sample.xml │ │ ├── menu/ │ │ │ ├── bubble_chart.xml │ │ │ ├── column_chart.xml │ │ │ ├── combo_line_column_chart.xml │ │ │ ├── line_chart.xml │ │ │ ├── main.xml │ │ │ ├── pie_chart.xml │ │ │ ├── preview_column_chart.xml │ │ │ ├── preview_line_chart.xml │ │ │ └── tempo_chart.xml │ │ ├── values/ │ │ │ ├── colors.xml │ │ │ ├── dimens.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ ├── values-land/ │ │ │ └── dimens.xml │ │ ├── values-sw600dp/ │ │ │ └── dimens.xml │ │ ├── values-v11/ │ │ │ └── styles.xml │ │ ├── values-v14/ │ │ │ └── styles.xml │ │ └── values-w820dp/ │ │ └── dimens.xml │ └── src/ │ └── lecho/ │ └── lib/ │ └── hellocharts/ │ └── samples/ │ ├── AboutActivity.java │ ├── BubbleChartActivity.java │ ├── ColumnChartActivity.java │ ├── ComboLineColumnChartActivity.java │ ├── GoodBadChartActivity.java │ ├── LineChartActivity.java │ ├── LineColumnDependencyActivity.java │ ├── MainActivity.java │ ├── PieChartActivity.java │ ├── PreviewColumnChartActivity.java │ ├── PreviewLineChartActivity.java │ ├── SpeedChartActivity.java │ ├── TempoChartActivity.java │ └── ViewPagerChartsActivity.java └── settings.gradle
SYMBOL INDEX (1310 symbols across 107 files)
FILE: hellocharts-library/src/lecho/lib/hellocharts/animation/ChartAnimationListener.java
type ChartAnimationListener (line 9) | public interface ChartAnimationListener extends EventListener {
method onAnimationStarted (line 11) | public void onAnimationStarted();
method onAnimationFinished (line 13) | public void onAnimationFinished();
FILE: hellocharts-library/src/lecho/lib/hellocharts/animation/ChartDataAnimator.java
type ChartDataAnimator (line 3) | public interface ChartDataAnimator {
method startAnimation (line 7) | public void startAnimation(long duration);
method cancelAnimation (line 9) | public void cancelAnimation();
method isAnimationStarted (line 11) | public boolean isAnimationStarted();
method setChartAnimationListener (line 13) | public void setChartAnimationListener(ChartAnimationListener animation...
FILE: hellocharts-library/src/lecho/lib/hellocharts/animation/ChartDataAnimatorV14.java
class ChartDataAnimatorV14 (line 11) | @SuppressLint("NewApi")
method ChartDataAnimatorV14 (line 17) | public ChartDataAnimatorV14(Chart chart) {
method startAnimation (line 24) | @Override
method cancelAnimation (line 34) | @Override
method onAnimationUpdate (line 39) | @Override
method onAnimationCancel (line 44) | @Override
method onAnimationEnd (line 48) | @Override
method onAnimationRepeat (line 54) | @Override
method onAnimationStart (line 58) | @Override
method isAnimationStarted (line 63) | @Override
method setChartAnimationListener (line 68) | @Override
FILE: hellocharts-library/src/lecho/lib/hellocharts/animation/ChartDataAnimatorV8.java
class ChartDataAnimatorV8 (line 10) | public class ChartDataAnimatorV8 implements ChartDataAnimator {
method run (line 20) | @Override
method ChartDataAnimatorV8 (line 37) | public ChartDataAnimatorV8(Chart chart) {
method startAnimation (line 42) | @Override
method cancelAnimation (line 56) | @Override
method isAnimationStarted (line 64) | @Override
method setChartAnimationListener (line 69) | @Override
FILE: hellocharts-library/src/lecho/lib/hellocharts/animation/ChartViewportAnimator.java
type ChartViewportAnimator (line 5) | public interface ChartViewportAnimator {
method startAnimation (line 9) | public void startAnimation(Viewport startViewport, Viewport targetView...
method startAnimation (line 11) | public void startAnimation(Viewport startViewport, Viewport targetView...
method cancelAnimation (line 13) | public void cancelAnimation();
method isAnimationStarted (line 15) | public boolean isAnimationStarted();
method setChartAnimationListener (line 17) | public void setChartAnimationListener(ChartAnimationListener animation...
FILE: hellocharts-library/src/lecho/lib/hellocharts/animation/ChartViewportAnimatorV14.java
class ChartViewportAnimatorV14 (line 12) | @SuppressLint("NewApi")
method ChartViewportAnimatorV14 (line 21) | public ChartViewportAnimatorV14(Chart chart) {
method startAnimation (line 29) | @Override
method startAnimation (line 37) | @Override
method cancelAnimation (line 45) | @Override
method onAnimationUpdate (line 50) | @Override
method onAnimationCancel (line 62) | @Override
method onAnimationEnd (line 66) | @Override
method onAnimationRepeat (line 72) | @Override
method onAnimationStart (line 76) | @Override
method isAnimationStarted (line 81) | @Override
method setChartAnimationListener (line 86) | @Override
FILE: hellocharts-library/src/lecho/lib/hellocharts/animation/ChartViewportAnimatorV8.java
class ChartViewportAnimatorV8 (line 11) | public class ChartViewportAnimatorV8 implements ChartViewportAnimator {
method run (line 25) | @Override
method ChartViewportAnimatorV8 (line 48) | public ChartViewportAnimatorV8(Chart chart) {
method startAnimation (line 54) | @Override
method startAnimation (line 65) | @Override
method cancelAnimation (line 76) | @Override
method isAnimationStarted (line 84) | @Override
method setChartAnimationListener (line 89) | @Override
FILE: hellocharts-library/src/lecho/lib/hellocharts/animation/DummyChartAnimationListener.java
class DummyChartAnimationListener (line 3) | public class DummyChartAnimationListener implements ChartAnimationListen...
method onAnimationStarted (line 5) | @Override
method onAnimationFinished (line 11) | @Override
FILE: hellocharts-library/src/lecho/lib/hellocharts/animation/PieChartRotationAnimator.java
type PieChartRotationAnimator (line 3) | public interface PieChartRotationAnimator {
method startAnimation (line 7) | public void startAnimation(float startAngle, float angleToRotate);
method cancelAnimation (line 9) | public void cancelAnimation();
method isAnimationStarted (line 11) | public boolean isAnimationStarted();
method setChartAnimationListener (line 13) | public void setChartAnimationListener(ChartAnimationListener animation...
FILE: hellocharts-library/src/lecho/lib/hellocharts/animation/PieChartRotationAnimatorV14.java
class PieChartRotationAnimatorV14 (line 11) | @SuppressLint("NewApi")
method PieChartRotationAnimatorV14 (line 19) | public PieChartRotationAnimatorV14(PieChartView chart) {
method PieChartRotationAnimatorV14 (line 23) | public PieChartRotationAnimatorV14(PieChartView chart, long duration) {
method startAnimation (line 31) | @Override
method cancelAnimation (line 38) | @Override
method onAnimationUpdate (line 43) | @Override
method onAnimationCancel (line 51) | @Override
method onAnimationEnd (line 55) | @Override
method onAnimationRepeat (line 61) | @Override
method onAnimationStart (line 65) | @Override
method isAnimationStarted (line 70) | @Override
method setChartAnimationListener (line 75) | @Override
FILE: hellocharts-library/src/lecho/lib/hellocharts/animation/PieChartRotationAnimatorV8.java
class PieChartRotationAnimatorV8 (line 10) | public class PieChartRotationAnimatorV8 implements PieChartRotationAnima...
method run (line 23) | @Override
method PieChartRotationAnimatorV8 (line 41) | public PieChartRotationAnimatorV8(PieChartView chart) {
method PieChartRotationAnimatorV8 (line 45) | public PieChartRotationAnimatorV8(PieChartView chart, long duration) {
method startAnimation (line 51) | @Override
method cancelAnimation (line 61) | @Override
method isAnimationStarted (line 69) | @Override
method setChartAnimationListener (line 74) | @Override
FILE: hellocharts-library/src/lecho/lib/hellocharts/computator/ChartComputator.java
class ChartComputator (line 14) | public class ChartComputator {
method setContentRect (line 46) | public void setContentRect(int width, int height, int paddingLeft, int...
method resetContentRect (line 55) | public void resetContentRect() {
method insetContentRect (line 60) | public void insetContentRect(int deltaLeft, int deltaTop, int deltaRig...
method insetContentRectByInternalMargins (line 69) | public void insetContentRectByInternalMargins(int deltaLeft, int delta...
method constrainViewport (line 79) | public void constrainViewport(float left, float top, float right, floa...
method setViewportTopLeft (line 116) | public void setViewportTopLeft(float left, float top) {
method computeRawX (line 137) | public float computeRawX(float valueX) {
method computeRawY (line 150) | public float computeRawY(float valueY) {
method computeRawDistanceX (line 159) | public float computeRawDistanceX(float distance) {
method computeRawDistanceY (line 166) | public float computeRawDistanceY(float distance) {
method rawPixelsToDataPoint (line 178) | public boolean rawPixelsToDataPoint(float x, float y, PointF dest) {
method computeScrollSurfaceSize (line 195) | public void computeScrollSurfaceSize(Point out) {
method isWithinContentRect (line 203) | public boolean isWithinContentRect(float x, float y, float precision) {
method getContentRectMinusAllMargins (line 218) | public Rect getContentRectMinusAllMargins() {
method getContentRectMinusAxesMargins (line 229) | public Rect getContentRectMinusAxesMargins() {
method getCurrentViewport (line 238) | public Viewport getCurrentViewport() {
method setCurrentViewport (line 248) | public void setCurrentViewport(Viewport viewport) {
method setCurrentViewport (line 256) | public void setCurrentViewport(float left, float top, float right, flo...
method getMaximumViewport (line 263) | public Viewport getMaximumViewport() {
method setMaxViewport (line 273) | public void setMaxViewport(Viewport maxViewport) {
method setMaxViewport (line 280) | public void setMaxViewport(float left, float top, float right, float b...
method getVisibleViewport (line 290) | public Viewport getVisibleViewport() {
method setVisibleViewport (line 294) | public void setVisibleViewport(Viewport visibleViewport) {
method getMinimumViewportWidth (line 298) | public float getMinimumViewportWidth() {
method getMinimumViewportHeight (line 302) | public float getMinimumViewportHeight() {
method setViewportChangeListener (line 306) | public void setViewportChangeListener(ViewportChangeListener viewportC...
method getChartWidth (line 314) | public int getChartWidth() {
method getChartHeight (line 318) | public int getChartHeight() {
method getMaxZoom (line 322) | public float getMaxZoom() {
method setMaxZoom (line 331) | public void setMaxZoom(float maxZoom) {
method computeMinimumWidthAndHeight (line 344) | private void computeMinimumWidthAndHeight() {
FILE: hellocharts-library/src/lecho/lib/hellocharts/computator/PreviewChartComputator.java
class PreviewChartComputator (line 9) | public class PreviewChartComputator extends ChartComputator {
method computeRawX (line 11) | public float computeRawX(float valueX) {
method computeRawY (line 17) | public float computeRawY(float valueY) {
method getVisibleViewport (line 23) | public Viewport getVisibleViewport() {
method setVisibleViewport (line 27) | public void setVisibleViewport(Viewport visibleViewport) {
method constrainViewport (line 31) | public void constrainViewport(float left, float top, float right, floa...
FILE: hellocharts-library/src/lecho/lib/hellocharts/formatter/AxisValueFormatter.java
type AxisValueFormatter (line 6) | public interface AxisValueFormatter {
method formatValueForManualAxis (line 13) | public int formatValueForManualAxis(char[] formattedValue, AxisValue a...
method formatValueForAutoGeneratedAxis (line 22) | public int formatValueForAutoGeneratedAxis(char[] formattedValue, floa...
FILE: hellocharts-library/src/lecho/lib/hellocharts/formatter/BubbleChartValueFormatter.java
type BubbleChartValueFormatter (line 5) | public interface BubbleChartValueFormatter {
method formatChartValue (line 7) | public int formatChartValue(char[] formattedValue, BubbleValue value);
FILE: hellocharts-library/src/lecho/lib/hellocharts/formatter/ColumnChartValueFormatter.java
type ColumnChartValueFormatter (line 5) | public interface ColumnChartValueFormatter {
method formatChartValue (line 7) | public int formatChartValue(char[] formattedValue, SubcolumnValue value);
FILE: hellocharts-library/src/lecho/lib/hellocharts/formatter/LineChartValueFormatter.java
type LineChartValueFormatter (line 6) | public interface LineChartValueFormatter {
method formatChartValue (line 8) | public int formatChartValue(char[] formattedValue, PointValue value);
FILE: hellocharts-library/src/lecho/lib/hellocharts/formatter/PieChartValueFormatter.java
type PieChartValueFormatter (line 5) | public interface PieChartValueFormatter {
method formatChartValue (line 7) | public int formatChartValue(char[] formattedValue, SliceValue value);
FILE: hellocharts-library/src/lecho/lib/hellocharts/formatter/SimpleAxisValueFormatter.java
class SimpleAxisValueFormatter (line 5) | public class SimpleAxisValueFormatter implements AxisValueFormatter {
method SimpleAxisValueFormatter (line 9) | public SimpleAxisValueFormatter() {
method SimpleAxisValueFormatter (line 13) | public SimpleAxisValueFormatter(int decimalDigitsNumber) {
method formatValueForManualAxis (line 18) | @Override
method formatValueForAutoGeneratedAxis (line 25) | @Override
method getDecimalDigitsNumber (line 32) | public int getDecimalDigitsNumber() {
method setDecimalDigitsNumber (line 36) | public SimpleAxisValueFormatter setDecimalDigitsNumber(int decimalDigi...
method getAppendedText (line 41) | public char[] getAppendedText() {
method setAppendedText (line 45) | public SimpleAxisValueFormatter setAppendedText(char[] appendedText) {
method getPrependedText (line 50) | public char[] getPrependedText() {
method setPrependedText (line 54) | public SimpleAxisValueFormatter setPrependedText(char[] prependedText) {
method getDecimalSeparator (line 59) | public char getDecimalSeparator() {
method setDecimalSeparator (line 63) | public SimpleAxisValueFormatter setDecimalSeparator(char decimalSepara...
FILE: hellocharts-library/src/lecho/lib/hellocharts/formatter/SimpleBubbleChartValueFormatter.java
class SimpleBubbleChartValueFormatter (line 6) | public class SimpleBubbleChartValueFormatter implements BubbleChartValue...
method SimpleBubbleChartValueFormatter (line 10) | public SimpleBubbleChartValueFormatter() {
method SimpleBubbleChartValueFormatter (line 14) | public SimpleBubbleChartValueFormatter(int decimalDigitsNumber) {
method formatChartValue (line 19) | @Override
method getDecimalDigitsNumber (line 25) | public int getDecimalDigitsNumber() {
method setDecimalDigitsNumber (line 29) | public SimpleBubbleChartValueFormatter setDecimalDigitsNumber(int deci...
method getAppendedText (line 34) | public char[] getAppendedText() {
method setAppendedText (line 38) | public SimpleBubbleChartValueFormatter setAppendedText(char[] appended...
method getPrependedText (line 43) | public char[] getPrependedText() {
method setPrependedText (line 47) | public SimpleBubbleChartValueFormatter setPrependedText(char[] prepend...
method getDecimalSeparator (line 52) | public char getDecimalSeparator() {
method setDecimalSeparator (line 56) | public SimpleBubbleChartValueFormatter setDecimalSeparator(char decima...
FILE: hellocharts-library/src/lecho/lib/hellocharts/formatter/SimpleColumnChartValueFormatter.java
class SimpleColumnChartValueFormatter (line 5) | public class SimpleColumnChartValueFormatter implements ColumnChartValue...
method SimpleColumnChartValueFormatter (line 9) | public SimpleColumnChartValueFormatter() {
method SimpleColumnChartValueFormatter (line 13) | public SimpleColumnChartValueFormatter(int decimalDigitsNumber) {
method formatChartValue (line 18) | @Override
method getDecimalDigitsNumber (line 24) | public int getDecimalDigitsNumber() {
method setDecimalDigitsNumber (line 28) | public SimpleColumnChartValueFormatter setDecimalDigitsNumber(int deci...
method getAppendedText (line 33) | public char[] getAppendedText() {
method setAppendedText (line 37) | public SimpleColumnChartValueFormatter setAppendedText(char[] appended...
method getPrependedText (line 42) | public char[] getPrependedText() {
method setPrependedText (line 46) | public SimpleColumnChartValueFormatter setPrependedText(char[] prepend...
method getDecimalSeparator (line 51) | public char getDecimalSeparator() {
method setDecimalSeparator (line 55) | public SimpleColumnChartValueFormatter setDecimalSeparator(char decima...
FILE: hellocharts-library/src/lecho/lib/hellocharts/formatter/SimpleLineChartValueFormatter.java
class SimpleLineChartValueFormatter (line 5) | public class SimpleLineChartValueFormatter implements LineChartValueForm...
method SimpleLineChartValueFormatter (line 9) | public SimpleLineChartValueFormatter() {
method SimpleLineChartValueFormatter (line 13) | public SimpleLineChartValueFormatter(int decimalDigitsNumber) {
method formatChartValue (line 18) | @Override
method getDecimalDigitsNumber (line 24) | public int getDecimalDigitsNumber() {
method setDecimalDigitsNumber (line 28) | public SimpleLineChartValueFormatter setDecimalDigitsNumber(int decima...
method getAppendedText (line 33) | public char[] getAppendedText() {
method setAppendedText (line 37) | public SimpleLineChartValueFormatter setAppendedText(char[] appendedTe...
method getPrependedText (line 42) | public char[] getPrependedText() {
method setPrependedText (line 46) | public SimpleLineChartValueFormatter setPrependedText(char[] prepended...
method getDecimalSeparator (line 51) | public char getDecimalSeparator() {
method setDecimalSeparator (line 55) | public SimpleLineChartValueFormatter setDecimalSeparator(char decimalS...
FILE: hellocharts-library/src/lecho/lib/hellocharts/formatter/SimplePieChartValueFormatter.java
class SimplePieChartValueFormatter (line 6) | public class SimplePieChartValueFormatter implements PieChartValueFormat...
method SimplePieChartValueFormatter (line 10) | public SimplePieChartValueFormatter() {
method SimplePieChartValueFormatter (line 14) | public SimplePieChartValueFormatter(int decimalDigitsNumber) {
method formatChartValue (line 19) | @Override
method getDecimalDigitsNumber (line 25) | public int getDecimalDigitsNumber() {
method setDecimalDigitsNumber (line 29) | public SimplePieChartValueFormatter setDecimalDigitsNumber(int decimal...
method getAppendedText (line 34) | public char[] getAppendedText() {
method setAppendedText (line 38) | public SimplePieChartValueFormatter setAppendedText(char[] appendedTex...
method getPrependedText (line 43) | public char[] getPrependedText() {
method setPrependedText (line 47) | public SimplePieChartValueFormatter setPrependedText(char[] prependedT...
method getDecimalSeparator (line 52) | public char getDecimalSeparator() {
method setDecimalSeparator (line 56) | public SimplePieChartValueFormatter setDecimalSeparator(char decimalSe...
FILE: hellocharts-library/src/lecho/lib/hellocharts/formatter/ValueFormatterHelper.java
class ValueFormatterHelper (line 10) | public class ValueFormatterHelper {
method determineDecimalSeparator (line 18) | public void determineDecimalSeparator() {
method getDecimalDigitsNumber (line 25) | public int getDecimalDigitsNumber() {
method setDecimalDigitsNumber (line 29) | public ValueFormatterHelper setDecimalDigitsNumber(int decimalDigitsNu...
method getAppendedText (line 34) | public char[] getAppendedText() {
method setAppendedText (line 38) | public ValueFormatterHelper setAppendedText(char[] appendedText) {
method getPrependedText (line 45) | public char[] getPrependedText() {
method setPrependedText (line 49) | public ValueFormatterHelper setPrependedText(char[] prependedText) {
method getDecimalSeparator (line 56) | public char getDecimalSeparator() {
method setDecimalSeparator (line 60) | public ValueFormatterHelper setDecimalSeparator(char decimalSeparator) {
method formatFloatValueWithPrependedAndAppendedText (line 76) | public int formatFloatValueWithPrependedAndAppendedText(char[] formatt...
method formatFloatValueWithPrependedAndAppendedText (line 100) | public int formatFloatValueWithPrependedAndAppendedText(char[] formatt...
method formatFloatValueWithPrependedAndAppendedText (line 107) | public int formatFloatValueWithPrependedAndAppendedText(char[] formatt...
method formatFloatValue (line 112) | public int formatFloatValue(char[] formattedValue, float value, int de...
method appendText (line 118) | public void appendText(char[] formattedValue) {
method prependText (line 125) | public void prependText(char[] formattedValue, int charsNumber) {
method getAppliedDecimalDigitsNumber (line 132) | public int getAppliedDecimalDigitsNumber(int defaultDigitsNumber) {
FILE: hellocharts-library/src/lecho/lib/hellocharts/gesture/ChartScroller.java
class ChartScroller (line 14) | public class ChartScroller {
method ChartScroller (line 20) | public ChartScroller(Context context) {
method startScroll (line 24) | public boolean startScroll(ChartComputator computator) {
method scroll (line 30) | public boolean scroll(ChartComputator computator, float distanceX, flo...
method computeScrollOffset (line 80) | public boolean computeScrollOffset(ChartComputator computator) {
method fling (line 102) | public boolean fling(int velocityX, int velocityY, ChartComputator com...
class ScrollResult (line 122) | public static class ScrollResult {
FILE: hellocharts-library/src/lecho/lib/hellocharts/gesture/ChartTouchHandler.java
class ChartTouchHandler (line 18) | public class ChartTouchHandler {
method ChartTouchHandler (line 51) | public ChartTouchHandler(Context context, Chart chart) {
method resetTouchHandler (line 61) | public void resetTouchHandler() {
method computeScroll (line 70) | public boolean computeScroll() {
method handleTouchEvent (line 85) | public boolean handleTouchEvent(MotionEvent event) {
method handleTouchEvent (line 114) | public boolean handleTouchEvent(MotionEvent event, ViewParent viewParent,
method disallowParentInterceptTouchEvent (line 126) | private void disallowParentInterceptTouchEvent() {
method allowParentInterceptTouchEvent (line 137) | private void allowParentInterceptTouchEvent(ScrollResult scrollResult) {
method computeTouch (line 149) | private boolean computeTouch(MotionEvent event) {
method checkTouch (line 208) | private boolean checkTouch(float touchX, float touchY) {
method isZoomEnabled (line 224) | public boolean isZoomEnabled() {
method setZoomEnabled (line 228) | public void setZoomEnabled(boolean isZoomEnabled) {
method isScrollEnabled (line 233) | public boolean isScrollEnabled() {
method setScrollEnabled (line 237) | public void setScrollEnabled(boolean isScrollEnabled) {
method getZoomType (line 241) | public ZoomType getZoomType() {
method setZoomType (line 245) | public void setZoomType(ZoomType zoomType) {
method isValueTouchEnabled (line 249) | public boolean isValueTouchEnabled() {
method setValueTouchEnabled (line 253) | public void setValueTouchEnabled(boolean isValueTouchEnabled) {
method isValueSelectionEnabled (line 257) | public boolean isValueSelectionEnabled() {
method setValueSelectionEnabled (line 261) | public void setValueSelectionEnabled(boolean isValueSelectionEnabled) {
class ChartScaleGestureListener (line 265) | protected class ChartScaleGestureListener extends ScaleGestureDetector...
method onScale (line 267) | @Override
class ChartGestureListener (line 281) | protected class ChartGestureListener extends GestureDetector.SimpleOnG...
method onDown (line 285) | @Override
method onDoubleTap (line 298) | @Override
method onScroll (line 307) | @Override
method onFling (line 322) | @Override
FILE: hellocharts-library/src/lecho/lib/hellocharts/gesture/ChartZoomer.java
class ChartZoomer (line 13) | public class ChartZoomer {
method ChartZoomer (line 21) | public ChartZoomer(Context context, ZoomType zoomType) {
method startZoom (line 26) | public boolean startZoom(MotionEvent e, ChartComputator computator) {
method computeZoom (line 37) | public boolean computeZoom(ChartComputator computator) {
method scale (line 57) | public boolean scale(ChartComputator computator, float focusX, float f...
method setCurrentViewport (line 78) | private void setCurrentViewport(ChartComputator computator, float left...
method getZoomType (line 89) | public ZoomType getZoomType() {
method setZoomType (line 93) | public void setZoomType(ZoomType zoomType) {
FILE: hellocharts-library/src/lecho/lib/hellocharts/gesture/ContainerScrollType.java
type ContainerScrollType (line 6) | public enum ContainerScrollType {
FILE: hellocharts-library/src/lecho/lib/hellocharts/gesture/PieChartTouchHandler.java
class PieChartTouchHandler (line 17) | public class PieChartTouchHandler extends ChartTouchHandler {
method PieChartTouchHandler (line 33) | public PieChartTouchHandler(Context context, PieChartView chart) {
method computeScroll (line 42) | @Override
method handleTouchEvent (line 54) | @Override
method isRotationEnabled (line 64) | public boolean isRotationEnabled() {
method setRotationEnabled (line 68) | public void setRotationEnabled(boolean isRotationEnabled) {
class ChartScaleGestureListener (line 72) | private class ChartScaleGestureListener extends ScaleGestureDetector.S...
method onScale (line 74) | @Override
class ChartGestureListener (line 81) | private class ChartGestureListener extends GestureDetector.SimpleOnGes...
method onDown (line 82) | @Override
method onDoubleTap (line 93) | @Override
method onScroll (line 98) | @Override
method onFling (line 115) | @Override
method vectorToScalarScroll (line 142) | private float vectorToScalarScroll(float dx, float dy, float x, floa...
FILE: hellocharts-library/src/lecho/lib/hellocharts/gesture/PreviewChartTouchHandler.java
class PreviewChartTouchHandler (line 13) | public class PreviewChartTouchHandler extends ChartTouchHandler {
method PreviewChartTouchHandler (line 15) | public PreviewChartTouchHandler(Context context, Chart chart) {
class ChartScaleGestureListener (line 25) | protected class ChartScaleGestureListener extends ScaleGestureDetector...
method onScale (line 27) | @Override
class PreviewChartGestureListener (line 41) | protected class PreviewChartGestureListener extends ChartGestureListen...
method onScroll (line 43) | @Override
method onFling (line 48) | @Override
FILE: hellocharts-library/src/lecho/lib/hellocharts/gesture/ZoomType.java
type ZoomType (line 3) | public enum ZoomType {
FILE: hellocharts-library/src/lecho/lib/hellocharts/gesture/ZoomerCompat.java
class ZoomerCompat (line 27) | public class ZoomerCompat {
method ZoomerCompat (line 59) | public ZoomerCompat(Context context) {
method forceFinished (line 71) | public void forceFinished(boolean finished) {
method abortAnimation (line 80) | public void abortAnimation() {
method startZoom (line 90) | public void startZoom(float endZoom) {
method computeZoom (line 103) | public boolean computeZoom() {
method getCurrZoom (line 125) | public float getCurrZoom() {
FILE: hellocharts-library/src/lecho/lib/hellocharts/listener/BubbleChartOnValueSelectListener.java
type BubbleChartOnValueSelectListener (line 6) | public interface BubbleChartOnValueSelectListener extends OnValueDeselec...
method onValueSelected (line 8) | public void onValueSelected(int bubbleIndex, BubbleValue value);
FILE: hellocharts-library/src/lecho/lib/hellocharts/listener/ColumnChartOnValueSelectListener.java
type ColumnChartOnValueSelectListener (line 6) | public interface ColumnChartOnValueSelectListener extends OnValueDeselec...
method onValueSelected (line 8) | public void onValueSelected(int columnIndex, int subcolumnIndex, Subco...
FILE: hellocharts-library/src/lecho/lib/hellocharts/listener/ComboLineColumnChartOnValueSelectListener.java
type ComboLineColumnChartOnValueSelectListener (line 7) | public interface ComboLineColumnChartOnValueSelectListener extends OnVal...
method onColumnValueSelected (line 9) | public void onColumnValueSelected(int columnIndex, int subcolumnIndex,...
method onPointValueSelected (line 11) | public void onPointValueSelected(int lineIndex, int pointIndex, PointV...
FILE: hellocharts-library/src/lecho/lib/hellocharts/listener/DummyBubbleChartOnValueSelectListener.java
class DummyBubbleChartOnValueSelectListener (line 6) | public class DummyBubbleChartOnValueSelectListener implements BubbleChar...
method onValueSelected (line 8) | @Override
method onValueDeselected (line 13) | @Override
FILE: hellocharts-library/src/lecho/lib/hellocharts/listener/DummyColumnChartOnValueSelectListener.java
class DummyColumnChartOnValueSelectListener (line 6) | public class DummyColumnChartOnValueSelectListener implements ColumnChar...
method onValueSelected (line 8) | @Override
method onValueDeselected (line 13) | @Override
FILE: hellocharts-library/src/lecho/lib/hellocharts/listener/DummyCompoLineColumnChartOnValueSelectListener.java
class DummyCompoLineColumnChartOnValueSelectListener (line 7) | public class DummyCompoLineColumnChartOnValueSelectListener implements C...
method onColumnValueSelected (line 9) | @Override
method onPointValueSelected (line 14) | @Override
method onValueDeselected (line 19) | @Override
FILE: hellocharts-library/src/lecho/lib/hellocharts/listener/DummyLineChartOnValueSelectListener.java
class DummyLineChartOnValueSelectListener (line 6) | public class DummyLineChartOnValueSelectListener implements LineChartOnV...
method onValueSelected (line 8) | @Override
method onValueDeselected (line 13) | @Override
FILE: hellocharts-library/src/lecho/lib/hellocharts/listener/DummyPieChartOnValueSelectListener.java
class DummyPieChartOnValueSelectListener (line 6) | public class DummyPieChartOnValueSelectListener implements PieChartOnVal...
method onValueSelected (line 8) | @Override
method onValueDeselected (line 13) | @Override
FILE: hellocharts-library/src/lecho/lib/hellocharts/listener/DummyVieportChangeListener.java
class DummyVieportChangeListener (line 5) | public class DummyVieportChangeListener implements ViewportChangeListener {
method onViewportChanged (line 7) | @Override
FILE: hellocharts-library/src/lecho/lib/hellocharts/listener/LineChartOnValueSelectListener.java
type LineChartOnValueSelectListener (line 6) | public interface LineChartOnValueSelectListener extends OnValueDeselectL...
method onValueSelected (line 8) | public void onValueSelected(int lineIndex, int pointIndex, PointValue ...
FILE: hellocharts-library/src/lecho/lib/hellocharts/listener/OnValueDeselectListener.java
type OnValueDeselectListener (line 4) | public interface OnValueDeselectListener {
method onValueDeselected (line 10) | public void onValueDeselected();
FILE: hellocharts-library/src/lecho/lib/hellocharts/listener/PieChartOnValueSelectListener.java
type PieChartOnValueSelectListener (line 6) | public interface PieChartOnValueSelectListener extends OnValueDeselectLi...
method onValueSelected (line 8) | public void onValueSelected(int arcIndex, SliceValue value);
FILE: hellocharts-library/src/lecho/lib/hellocharts/listener/ViewportChangeListener.java
type ViewportChangeListener (line 10) | public interface ViewportChangeListener {
method onViewportChanged (line 15) | public void onViewportChanged(Viewport viewport);
FILE: hellocharts-library/src/lecho/lib/hellocharts/model/AbstractChartData.java
class AbstractChartData (line 11) | public abstract class AbstractChartData implements ChartData {
method AbstractChartData (line 39) | public AbstractChartData() {
method AbstractChartData (line 48) | public AbstractChartData(AbstractChartData data) {
method getAxisXBottom (line 66) | @Override
method setAxisXBottom (line 71) | @Override
method getAxisYLeft (line 76) | @Override
method setAxisYLeft (line 81) | @Override
method getAxisXTop (line 86) | @Override
method setAxisXTop (line 91) | @Override
method getAxisYRight (line 96) | @Override
method setAxisYRight (line 101) | @Override
method getValueLabelTextColor (line 106) | @Override
method setValueLabelsTextColor (line 111) | @Override
method getValueLabelTextSize (line 116) | @Override
method setValueLabelTextSize (line 121) | @Override
method getValueLabelTypeface (line 126) | @Override
method setValueLabelTypeface (line 131) | @Override
method isValueLabelBackgroundEnabled (line 136) | @Override
method setValueLabelBackgroundEnabled (line 141) | @Override
method isValueLabelBackgroundAuto (line 146) | @Override
method setValueLabelBackgroundAuto (line 151) | @Override
method getValueLabelBackgroundColor (line 156) | @Override
method setValueLabelBackgroundColor (line 161) | @Override
FILE: hellocharts-library/src/lecho/lib/hellocharts/model/Axis.java
class Axis (line 22) | public class Axis {
method Axis (line 81) | public Axis() {
method Axis (line 87) | public Axis(List<AxisValue> values) {
method Axis (line 91) | public Axis(Axis axis) {
method generateAxisFromRange (line 112) | public static Axis generateAxisFromRange(float start, float stop, floa...
method generateAxisFromCollection (line 127) | public static Axis generateAxisFromCollection(List<Float> axisValues) {
method generateAxisFromCollection (line 143) | public static Axis generateAxisFromCollection(List<Float> axisValues, ...
method getValues (line 160) | public List<AxisValue> getValues() {
method setValues (line 164) | public Axis setValues(List<AxisValue> values) {
method getName (line 175) | public String getName() {
method setName (line 179) | public Axis setName(String name) {
method isAutoGenerated (line 184) | public boolean isAutoGenerated() {
method setAutoGenerated (line 188) | public Axis setAutoGenerated(boolean isAutoGenerated) {
method hasLines (line 193) | public boolean hasLines() {
method setHasLines (line 197) | public Axis setHasLines(boolean hasLines) {
method getTextColor (line 202) | public int getTextColor() {
method setTextColor (line 206) | public Axis setTextColor(int color) {
method isInside (line 214) | public boolean isInside() {
method setInside (line 222) | public Axis setInside(boolean isInside) {
method getLineColor (line 227) | public int getLineColor() {
method setLineColor (line 231) | public Axis setLineColor(int lineColor) {
method getTextSize (line 236) | public int getTextSize() {
method setTextSize (line 240) | public Axis setTextSize(int textSize) {
method getMaxLabelChars (line 245) | public int getMaxLabelChars() {
method setMaxLabelChars (line 252) | public Axis setMaxLabelChars(int maxLabelChars) {
method getTypeface (line 262) | public Typeface getTypeface() {
method setTypeface (line 266) | public Axis setTypeface(Typeface typeface) {
method getFormatter (line 271) | public AxisValueFormatter getFormatter() {
method setFormatter (line 275) | public Axis setFormatter(AxisValueFormatter formatter) {
method setHasSeparationLine (line 287) | public Axis setHasSeparationLine(boolean hasSeparationLine) {
method hasSeparationLine (line 292) | public boolean hasSeparationLine() {
method hasTiltedLabels (line 296) | public boolean hasTiltedLabels() {
method setHasTiltedLabels (line 300) | public Axis setHasTiltedLabels(boolean hasTiltedLabels) {
FILE: hellocharts-library/src/lecho/lib/hellocharts/model/AxisValue.java
class AxisValue (line 9) | public class AxisValue {
method AxisValue (line 13) | public AxisValue(float value) {
method AxisValue (line 17) | @Deprecated
method AxisValue (line 23) | public AxisValue(AxisValue axisValue) {
method getValue (line 28) | public float getValue() {
method setValue (line 32) | public AxisValue setValue(float value) {
method getLabel (line 37) | @Deprecated
method setLabel (line 47) | public AxisValue setLabel(String label) {
method getLabelAsChars (line 52) | public char[] getLabelAsChars() {
method setLabel (line 61) | @Deprecated
method equals (line 67) | @Override
method hashCode (line 80) | @Override
FILE: hellocharts-library/src/lecho/lib/hellocharts/model/BubbleChartData.java
class BubbleChartData (line 13) | public class BubbleChartData extends AbstractChartData {
method BubbleChartData (line 24) | public BubbleChartData() {
method BubbleChartData (line 27) | public BubbleChartData(List<BubbleValue> values) {
method BubbleChartData (line 34) | public BubbleChartData(BubbleChartData data) {
method generateDummyData (line 47) | public static BubbleChartData generateDummyData() {
method update (line 60) | @Override
method finish (line 67) | @Override
method getValues (line 74) | public List<BubbleValue> getValues() {
method setValues (line 78) | public BubbleChartData setValues(List<BubbleValue> values) {
method hasLabels (line 87) | public boolean hasLabels() {
method setHasLabels (line 91) | public BubbleChartData setHasLabels(boolean hasLabels) {
method hasLabelsOnlyForSelected (line 102) | public boolean hasLabelsOnlyForSelected() {
method setHasLabelsOnlyForSelected (line 110) | public BubbleChartData setHasLabelsOnlyForSelected(boolean hasLabelsOn...
method getMinBubbleRadius (line 123) | public int getMinBubbleRadius() {
method setMinBubbleRadius (line 131) | public void setMinBubbleRadius(int minBubbleRadius) {
method getBubbleScale (line 140) | public float getBubbleScale() {
method setBubbleScale (line 148) | public void setBubbleScale(float bubbleScale) {
method getFormatter (line 152) | public BubbleChartValueFormatter getFormatter() {
method setFormatter (line 156) | public BubbleChartData setFormatter(BubbleChartValueFormatter formatte...
FILE: hellocharts-library/src/lecho/lib/hellocharts/model/BubbleValue.java
class BubbleValue (line 11) | public class BubbleValue {
method BubbleValue (line 58) | public BubbleValue() {
method BubbleValue (line 62) | public BubbleValue(float x, float y, float z) {
method BubbleValue (line 66) | public BubbleValue(float x, float y, float z, int color) {
method BubbleValue (line 71) | public BubbleValue(BubbleValue bubbleValue) {
method update (line 77) | public void update(float scale) {
method finish (line 83) | public void finish() {
method set (line 87) | public BubbleValue set(float x, float y, float z) {
method setTarget (line 103) | public BubbleValue setTarget(float targetX, float targetY, float targe...
method getX (line 111) | public float getX() {
method getY (line 115) | public float getY() {
method getZ (line 119) | public float getZ() {
method getColor (line 123) | public int getColor() {
method setColor (line 127) | public BubbleValue setColor(int color) {
method getDarkenColor (line 133) | public int getDarkenColor() {
method getShape (line 137) | public ValueShape getShape() {
method setShape (line 141) | public BubbleValue setShape(ValueShape shape) {
method getLabel (line 146) | @Deprecated
method setLabel (line 151) | public BubbleValue setLabel(String label) {
method getLabelAsChars (line 156) | public char[] getLabelAsChars() {
method setLabel (line 160) | @Deprecated
method toString (line 166) | @Override
method equals (line 171) | @Override
method hashCode (line 195) | @Override
FILE: hellocharts-library/src/lecho/lib/hellocharts/model/ChartData.java
type ChartData (line 8) | public interface ChartData {
method update (line 15) | public void update(float scale);
method finish (line 20) | public void finish();
method getAxisXBottom (line 25) | public Axis getAxisXBottom();
method setAxisXBottom (line 32) | public void setAxisXBottom(Axis axisX);
method getAxisYLeft (line 37) | public Axis getAxisYLeft();
method setAxisYLeft (line 44) | public void setAxisYLeft(Axis axisY);
method getAxisXTop (line 49) | public Axis getAxisXTop();
method setAxisXTop (line 56) | public void setAxisXTop(Axis axisX);
method getAxisYRight (line 61) | public Axis getAxisYRight();
method setAxisYRight (line 68) | public void setAxisYRight(Axis axisY);
method getValueLabelTextColor (line 73) | public int getValueLabelTextColor();
method setValueLabelsTextColor (line 78) | public void setValueLabelsTextColor(int labelsTextColor);
method getValueLabelTextSize (line 83) | public int getValueLabelTextSize();
method setValueLabelTextSize (line 88) | public void setValueLabelTextSize(int labelsTextSize);
method getValueLabelTypeface (line 95) | public Typeface getValueLabelTypeface();
method setValueLabelTypeface (line 102) | public void setValueLabelTypeface(Typeface typeface);
method isValueLabelBackgroundEnabled (line 107) | public boolean isValueLabelBackgroundEnabled();
method setValueLabelBackgroundEnabled (line 112) | public void setValueLabelBackgroundEnabled(boolean isValueLabelBackgro...
method isValueLabelBackgroundAuto (line 117) | public boolean isValueLabelBackgroundAuto();
method setValueLabelBackgroundAuto (line 122) | public void setValueLabelBackgroundAuto(boolean isValueLabelBackgrount...
method getValueLabelBackgroundColor (line 127) | public int getValueLabelBackgroundColor();
method setValueLabelBackgroundColor (line 133) | public void setValueLabelBackgroundColor(int valueLabelBackgroundColor);
FILE: hellocharts-library/src/lecho/lib/hellocharts/model/Column.java
class Column (line 17) | public class Column {
method Column (line 24) | public Column() {
method Column (line 28) | public Column(List<SubcolumnValue> values) {
method Column (line 32) | public Column(Column column) {
method update (line 42) | public void update(float scale) {
method finish (line 49) | public void finish() {
method getValues (line 55) | public List<SubcolumnValue> getValues() {
method setValues (line 59) | public Column setValues(List<SubcolumnValue> values) {
method hasLabels (line 68) | public boolean hasLabels() {
method setHasLabels (line 72) | public Column setHasLabels(boolean hasLabels) {
method hasLabelsOnlyForSelected (line 83) | public boolean hasLabelsOnlyForSelected() {
method setHasLabelsOnlyForSelected (line 91) | public Column setHasLabelsOnlyForSelected(boolean hasLabelsOnlyForSele...
method getFormatter (line 99) | public ColumnChartValueFormatter getFormatter() {
method setFormatter (line 103) | public Column setFormatter(ColumnChartValueFormatter formatter) {
FILE: hellocharts-library/src/lecho/lib/hellocharts/model/ColumnChartData.java
class ColumnChartData (line 12) | public class ColumnChartData extends AbstractChartData {
method ColumnChartData (line 20) | public ColumnChartData() {
method ColumnChartData (line 23) | public ColumnChartData(List<Column> columns) {
method ColumnChartData (line 30) | public ColumnChartData(ColumnChartData data) {
method generateDummyData (line 40) | public static ColumnChartData generateDummyData() {
method update (line 57) | @Override
method finish (line 65) | @Override
method getColumns (line 72) | public List<Column> getColumns() {
method setColumns (line 76) | public ColumnChartData setColumns(List<Column> columns) {
method isStacked (line 85) | public boolean isStacked() {
method setStacked (line 95) | public ColumnChartData setStacked(boolean isStacked) {
method getFillRatio (line 100) | public float getFillRatio() {
method setFillRatio (line 111) | public ColumnChartData setFillRatio(float fillRatio) {
method getBaseValue (line 125) | public float getBaseValue() {
method setBaseValue (line 132) | public ColumnChartData setBaseValue(float baseValue) {
FILE: hellocharts-library/src/lecho/lib/hellocharts/model/ComboLineColumnChartData.java
class ComboLineColumnChartData (line 6) | public class ComboLineColumnChartData extends AbstractChartData {
method ComboLineColumnChartData (line 11) | public ComboLineColumnChartData() {
method ComboLineColumnChartData (line 16) | public ComboLineColumnChartData(ColumnChartData columnChartData, LineC...
method ComboLineColumnChartData (line 21) | public ComboLineColumnChartData(ComboLineColumnChartData data) {
method generateDummyData (line 28) | public static ComboLineColumnChartData generateDummyData() {
method update (line 35) | @Override
method finish (line 41) | @Override
method getColumnChartData (line 47) | public ColumnChartData getColumnChartData() {
method setColumnChartData (line 51) | public void setColumnChartData(ColumnChartData columnChartData) {
method getLineChartData (line 59) | public LineChartData getLineChartData() {
method setLineChartData (line 63) | public void setLineChartData(LineChartData lineChartData) {
FILE: hellocharts-library/src/lecho/lib/hellocharts/model/Line.java
class Line (line 16) | public class Line {
method Line (line 43) | public Line() {
method Line (line 47) | public Line(List<PointValue> values) {
method Line (line 51) | public Line(Line line) {
method update (line 75) | public void update(float scale) {
method finish (line 81) | public void finish() {
method getValues (line 87) | public List<PointValue> getValues() {
method setValues (line 91) | public void setValues(List<PointValue> values) {
method getColor (line 99) | public int getColor() {
method setColor (line 103) | public Line setColor(int color) {
method getPointColor (line 111) | public int getPointColor() {
method setPointColor (line 119) | public Line setPointColor(int pointColor) {
method getDarkenColor (line 129) | public int getDarkenColor() {
method getAreaTransparency (line 136) | public int getAreaTransparency() {
method setAreaTransparency (line 146) | public Line setAreaTransparency(int areaTransparency) {
method getStrokeWidth (line 151) | public int getStrokeWidth() {
method setStrokeWidth (line 155) | public Line setStrokeWidth(int strokeWidth) {
method hasPoints (line 160) | public boolean hasPoints() {
method setHasPoints (line 164) | public Line setHasPoints(boolean hasPoints) {
method hasLines (line 169) | public boolean hasLines() {
method setHasLines (line 173) | public Line setHasLines(boolean hasLines) {
method hasLabels (line 178) | public boolean hasLabels() {
method setHasLabels (line 182) | public Line setHasLabels(boolean hasLabels) {
method hasLabelsOnlyForSelected (line 193) | public boolean hasLabelsOnlyForSelected() {
method setHasLabelsOnlyForSelected (line 201) | public Line setHasLabelsOnlyForSelected(boolean hasLabelsOnlyForSelect...
method getPointRadius (line 209) | public int getPointRadius() {
method setPointRadius (line 219) | public Line setPointRadius(int pointRadius) {
method getGradientToTransparent (line 224) | public boolean getGradientToTransparent() {
method setHasGradientToTransparent (line 228) | public Line setHasGradientToTransparent(boolean hasGradientToTranspare...
method isCubic (line 233) | public boolean isCubic() {
method setCubic (line 237) | public Line setCubic(boolean isCubic) {
method isSquare (line 244) | public boolean isSquare() {
method setSquare (line 248) | public Line setSquare(boolean isSquare) {
method isFilled (line 255) | public boolean isFilled() {
method setFilled (line 259) | public Line setFilled(boolean isFilled) {
method getShape (line 267) | public ValueShape getShape() {
method setShape (line 277) | public Line setShape(ValueShape shape) {
method getPathEffect (line 282) | public PathEffect getPathEffect() {
method setPathEffect (line 292) | public void setPathEffect(PathEffect pathEffect) {
method getFormatter (line 296) | public LineChartValueFormatter getFormatter() {
method setFormatter (line 300) | public Line setFormatter(LineChartValueFormatter formatter) {
FILE: hellocharts-library/src/lecho/lib/hellocharts/model/LineChartData.java
class LineChartData (line 9) | public class LineChartData extends AbstractChartData {
method LineChartData (line 15) | public LineChartData() {
method LineChartData (line 19) | public LineChartData(List<Line> lines) {
method LineChartData (line 26) | public LineChartData(LineChartData data) {
method generateDummyData (line 35) | public static LineChartData generateDummyData() {
method update (line 50) | @Override
method finish (line 57) | @Override
method getLines (line 64) | public List<Line> getLines() {
method setLines (line 68) | public LineChartData setLines(List<Line> lines) {
method getBaseValue (line 80) | public float getBaseValue() {
method setBaseValue (line 88) | public LineChartData setBaseValue(float baseValue) {
FILE: hellocharts-library/src/lecho/lib/hellocharts/model/PieChartData.java
class PieChartData (line 17) | public class PieChartData extends AbstractChartData {
method PieChartData (line 41) | public PieChartData() {
method PieChartData (line 46) | public PieChartData(List<SliceValue> values) {
method PieChartData (line 53) | public PieChartData(PieChartData data) {
method generateDummyData (line 79) | public static PieChartData generateDummyData() {
method update (line 91) | @Override
method finish (line 98) | @Override
method setAxisXBottom (line 108) | @Override
method setAxisYLeft (line 116) | @Override
method getValues (line 121) | public List<SliceValue> getValues() {
method setValues (line 125) | public PieChartData setValues(List<SliceValue> values) {
method hasLabels (line 134) | public boolean hasLabels() {
method setHasLabels (line 138) | public PieChartData setHasLabels(boolean hasLabels) {
method hasLabelsOnlyForSelected (line 149) | public boolean hasLabelsOnlyForSelected() {
method setHasLabelsOnlyForSelected (line 157) | public PieChartData setHasLabelsOnlyForSelected(boolean hasLabelsOnlyF...
method hasLabelsOutside (line 165) | public boolean hasLabelsOutside() {
method setHasLabelsOutside (line 174) | public PieChartData setHasLabelsOutside(boolean hasLabelsOutside) {
method hasCenterCircle (line 179) | public boolean hasCenterCircle() {
method setHasCenterCircle (line 183) | public PieChartData setHasCenterCircle(boolean hasCenterCircle) {
method getCenterCircleColor (line 188) | public int getCenterCircleColor() {
method setCenterCircleColor (line 192) | public PieChartData setCenterCircleColor(int centerCircleColor) {
method getCenterCircleScale (line 197) | public float getCenterCircleScale() {
method setCenterCircleScale (line 201) | public PieChartData setCenterCircleScale(float centerCircleScale) {
method getCenterText1Color (line 206) | public int getCenterText1Color() {
method setCenterText1Color (line 210) | public PieChartData setCenterText1Color(int centerText1Color) {
method getCenterText1FontSize (line 215) | public int getCenterText1FontSize() {
method setCenterText1FontSize (line 219) | public PieChartData setCenterText1FontSize(int centerText1FontSize) {
method getCenterText1Typeface (line 224) | public Typeface getCenterText1Typeface() {
method setCenterText1Typeface (line 228) | public PieChartData setCenterText1Typeface(Typeface text1Typeface) {
method getCenterText1 (line 233) | public String getCenterText1() {
method setCenterText1 (line 237) | public PieChartData setCenterText1(String centerText1) {
method getCenterText2 (line 242) | public String getCenterText2() {
method setCenterText2 (line 249) | public PieChartData setCenterText2(String centerText2) {
method getCenterText2Color (line 254) | public int getCenterText2Color() {
method setCenterText2Color (line 258) | public PieChartData setCenterText2Color(int centerText2Color) {
method getCenterText2FontSize (line 263) | public int getCenterText2FontSize() {
method setCenterText2FontSize (line 267) | public PieChartData setCenterText2FontSize(int centerText2FontSize) {
method getCenterText2Typeface (line 272) | public Typeface getCenterText2Typeface() {
method setCenterText2Typeface (line 276) | public PieChartData setCenterText2Typeface(Typeface text2Typeface) {
method getSlicesSpacing (line 281) | public int getSlicesSpacing() {
method setSlicesSpacing (line 285) | public PieChartData setSlicesSpacing(int sliceSpacing) {
method getFormatter (line 290) | public PieChartValueFormatter getFormatter() {
method setFormatter (line 294) | public PieChartData setFormatter(PieChartValueFormatter formatter) {
FILE: hellocharts-library/src/lecho/lib/hellocharts/model/PointValue.java
class PointValue (line 10) | public class PointValue {
method PointValue (line 20) | public PointValue() {
method PointValue (line 24) | public PointValue(float x, float y) {
method PointValue (line 28) | public PointValue(PointValue pointValue) {
method update (line 33) | public void update(float scale) {
method finish (line 38) | public void finish() {
method set (line 42) | public PointValue set(float x, float y) {
method setTarget (line 55) | public PointValue setTarget(float targetX, float targetY) {
method getX (line 62) | public float getX() {
method getY (line 66) | public float getY() {
method getLabel (line 70) | @Deprecated
method setLabel (line 75) | public PointValue setLabel(String label) {
method getLabelAsChars (line 80) | public char[] getLabelAsChars() {
method setLabel (line 84) | @Deprecated
method toString (line 90) | @Override
method equals (line 95) | @Override
method hashCode (line 113) | @Override
FILE: hellocharts-library/src/lecho/lib/hellocharts/model/SelectedValue.java
class SelectedValue (line 6) | public class SelectedValue {
method SelectedValue (line 23) | public SelectedValue() {
method SelectedValue (line 27) | public SelectedValue(int firstIndex, int secondIndex, SelectedValueTyp...
method set (line 31) | public void set(int firstIndex, int secondIndex, SelectedValueType typ...
method set (line 41) | public void set(SelectedValue selectedValue) {
method clear (line 47) | public void clear() {
method isSet (line 54) | public boolean isSet() {
method getFirstIndex (line 65) | public int getFirstIndex() {
method setFirstIndex (line 69) | public void setFirstIndex(int firstIndex) {
method getSecondIndex (line 76) | public int getSecondIndex() {
method setSecondIndex (line 80) | public void setSecondIndex(int secondIndex) {
method getType (line 84) | public SelectedValueType getType() {
method setType (line 88) | public void setType(SelectedValueType type) {
method hashCode (line 92) | @Override
method equals (line 102) | @Override
method toString (line 120) | @Override
type SelectedValueType (line 128) | public enum SelectedValueType {
FILE: hellocharts-library/src/lecho/lib/hellocharts/model/SliceValue.java
class SliceValue (line 11) | public class SliceValue {
method SliceValue (line 41) | public SliceValue() {
method SliceValue (line 45) | public SliceValue(float value) {
method SliceValue (line 49) | public SliceValue(float value, int color) {
method SliceValue (line 54) | public SliceValue(float value, int color, int sliceSpacing) {
method SliceValue (line 60) | public SliceValue(SliceValue sliceValue) {
method update (line 67) | public void update(float scale) {
method finish (line 71) | public void finish() {
method getValue (line 75) | public float getValue() {
method setValue (line 79) | public SliceValue setValue(float value) {
method setTarget (line 92) | public SliceValue setTarget(float target) {
method getColor (line 98) | public int getColor() {
method setColor (line 102) | public SliceValue setColor(int color) {
method getDarkenColor (line 108) | public int getDarkenColor() {
method getSliceSpacing (line 112) | @Deprecated
method setSliceSpacing (line 117) | @Deprecated
method getLabel (line 123) | @Deprecated
method setLabel (line 128) | @Deprecated
method setLabel (line 134) | public SliceValue setLabel(String label) {
method getLabelAsChars (line 139) | public char[] getLabelAsChars() {
method toString (line 143) | @Override
method equals (line 148) | @Override
method hashCode (line 166) | @Override
FILE: hellocharts-library/src/lecho/lib/hellocharts/model/SubcolumnValue.java
class SubcolumnValue (line 11) | public class SubcolumnValue {
method SubcolumnValue (line 20) | public SubcolumnValue() {
method SubcolumnValue (line 24) | public SubcolumnValue(float value) {
method SubcolumnValue (line 29) | public SubcolumnValue(float value, int color) {
method SubcolumnValue (line 35) | public SubcolumnValue(SubcolumnValue columnValue) {
method update (line 41) | public void update(float scale) {
method finish (line 45) | public void finish() {
method getValue (line 49) | public float getValue() {
method setValue (line 53) | public SubcolumnValue setValue(float value) {
method setTarget (line 66) | public SubcolumnValue setTarget(float target) {
method getColor (line 72) | public int getColor() {
method setColor (line 76) | public SubcolumnValue setColor(int color) {
method getDarkenColor (line 82) | public int getDarkenColor() {
method getLabel (line 86) | @Deprecated
method setLabel (line 91) | public SubcolumnValue setLabel(String label) {
method getLabelAsChars (line 96) | public char[] getLabelAsChars() {
method setLabel (line 100) | @Deprecated
method toString (line 106) | @Override
method equals (line 111) | @Override
method hashCode (line 128) | @Override
FILE: hellocharts-library/src/lecho/lib/hellocharts/model/ValueShape.java
type ValueShape (line 3) | public enum ValueShape {
FILE: hellocharts-library/src/lecho/lib/hellocharts/model/Viewport.java
class Viewport (line 13) | public class Viewport implements Parcelable {
method createFromParcel (line 23) | public Viewport createFromParcel(Parcel in) {
method newArray (line 32) | public Viewport[] newArray(int size) {
method Viewport (line 40) | public Viewport() {
method Viewport (line 52) | public Viewport(float left, float top, float right, float bottom) {
method Viewport (line 64) | public Viewport(Viewport v) {
method equals (line 75) | @Override
method isEmpty (line 98) | public final boolean isEmpty() {
method setEmpty (line 105) | public void setEmpty() {
method width (line 113) | public final float width() {
method height (line 121) | public final float height() {
method centerX (line 129) | public final float centerX() {
method centerY (line 137) | public final float centerY() {
method set (line 150) | public void set(float left, float top, float right, float bottom) {
method set (line 162) | public void set(Viewport src) {
method offset (line 176) | public void offset(float dx, float dy) {
method offsetTo (line 189) | public void offsetTo(float newLeft, float newTop) {
method inset (line 204) | public void inset(float dx, float dy) {
method contains (line 221) | public boolean contains(float x, float y) {
method contains (line 236) | public boolean contains(float left, float top, float right, float bott...
method contains (line 250) | public boolean contains(Viewport v) {
method union (line 266) | public void union(float left, float top, float right, float bottom) {
method union (line 292) | public void union(Viewport v) {
method intersect (line 308) | public boolean intersect(float left, float top, float right, float bot...
method intersect (line 336) | public boolean intersect(Viewport v) {
method toString (line 340) | @Override
method hashCode (line 347) | @Override
method describeContents (line 361) | public int describeContents() {
method writeToParcel (line 370) | public void writeToParcel(Parcel out, int flags) {
method readFromParcel (line 383) | public void readFromParcel(Parcel in) {
FILE: hellocharts-library/src/lecho/lib/hellocharts/provider/BubbleChartDataProvider.java
type BubbleChartDataProvider (line 5) | public interface BubbleChartDataProvider {
method getBubbleChartData (line 7) | public BubbleChartData getBubbleChartData();
method setBubbleChartData (line 9) | public void setBubbleChartData(BubbleChartData data);
FILE: hellocharts-library/src/lecho/lib/hellocharts/provider/ColumnChartDataProvider.java
type ColumnChartDataProvider (line 5) | public interface ColumnChartDataProvider {
method getColumnChartData (line 7) | public ColumnChartData getColumnChartData();
method setColumnChartData (line 9) | public void setColumnChartData(ColumnChartData data);
FILE: hellocharts-library/src/lecho/lib/hellocharts/provider/ComboLineColumnChartDataProvider.java
type ComboLineColumnChartDataProvider (line 5) | public interface ComboLineColumnChartDataProvider {
method getComboLineColumnChartData (line 7) | public ComboLineColumnChartData getComboLineColumnChartData();
method setComboLineColumnChartData (line 9) | public void setComboLineColumnChartData(ComboLineColumnChartData data);
FILE: hellocharts-library/src/lecho/lib/hellocharts/provider/LineChartDataProvider.java
type LineChartDataProvider (line 5) | public interface LineChartDataProvider {
method getLineChartData (line 7) | public LineChartData getLineChartData();
method setLineChartData (line 9) | public void setLineChartData(LineChartData data);
FILE: hellocharts-library/src/lecho/lib/hellocharts/provider/PieChartDataProvider.java
type PieChartDataProvider (line 5) | public interface PieChartDataProvider {
method getPieChartData (line 7) | public PieChartData getPieChartData();
method setPieChartData (line 9) | public void setPieChartData(PieChartData data);
FILE: hellocharts-library/src/lecho/lib/hellocharts/renderer/AbstractChartRenderer.java
class AbstractChartRenderer (line 22) | public abstract class AbstractChartRenderer implements ChartRenderer {
method AbstractChartRenderer (line 55) | public AbstractChartRenderer(Context context, Chart chart) {
method resetRenderer (line 74) | @Override
method onChartDataChanged (line 79) | @Override
method drawLabelTextAndBackground (line 104) | protected void drawLabelTextAndBackground(Canvas canvas, char[] labelB...
method isTouched (line 127) | @Override
method clearTouch (line 132) | @Override
method getMaximumViewport (line 137) | @Override
method setMaximumViewport (line 142) | @Override
method getCurrentViewport (line 149) | @Override
method setCurrentViewport (line 154) | @Override
method isViewportCalculationEnabled (line 161) | @Override
method setViewportCalculationEnabled (line 166) | @Override
method selectValue (line 171) | @Override
method getSelectedValue (line 176) | @Override
FILE: hellocharts-library/src/lecho/lib/hellocharts/renderer/AxesRenderer.java
class AxesRenderer (line 24) | public class AxesRenderer {
method AxesRenderer (line 102) | public AxesRenderer(Context context, Chart chart) {
method onChartSizeChanged (line 118) | public void onChartSizeChanged() {
method onChartDataChanged (line 122) | public void onChartDataChanged() {
method onChartDataOrSizeChanged (line 126) | private void onChartDataOrSizeChanged() {
method resetRenderer (line 133) | public void resetRenderer() {
method initAxis (line 140) | private void initAxis(Axis axis, int position) {
method initAxisAttributes (line 149) | private void initAxisAttributes(Axis axis, int position) {
method initAxisPaints (line 160) | private void initAxisPaints(Axis axis, int position) {
method initAxisTextAlignment (line 179) | private void initAxisTextAlignment(Axis axis, int position) {
method initAxisDimensionForTiltedLabels (line 198) | private void initAxisDimensionForTiltedLabels(int position) {
method initAxisDimension (line 205) | private void initAxisDimension(int position) {
method intiTiltedLabelsTranslation (line 216) | private void intiTiltedLabelsTranslation(Axis axis, int position) {
method initAxisMargin (line 246) | private void initAxisMargin(Axis axis, int position) {
method getAxisNameMargin (line 255) | private int getAxisNameMargin(Axis axis, int position) {
method insetContentRectWithAxesMargins (line 265) | private void insetContentRectWithAxesMargins(int axisMargin, int posit...
method initAxisMeasurements (line 277) | private void initAxisMeasurements(Axis axis, int position) {
method drawInBackground (line 336) | public void drawInBackground(Canvas canvas) {
method prepareAxisToDraw (line 362) | private void prepareAxisToDraw(Axis axis, int position) {
method drawInForeground (line 375) | public void drawInForeground(Canvas canvas) {
method prepareCustomAxis (line 397) | private void prepareCustomAxis(Axis axis, int position) {
method prepareAutoGeneratedAxis (line 462) | private void prepareAutoGeneratedAxis(Axis axis, int position) {
method checkRawValue (line 509) | private boolean checkRawValue(Rect rect, float rawValue, boolean axisI...
method drawAxisLines (line 531) | private void drawAxisLines(Canvas canvas, Axis axis, int position) {
method drawAxisLabelsAndName (line 573) | private void drawAxisLabelsAndName(Canvas canvas, Axis axis, int posit...
method isAxisVertical (line 629) | private boolean isAxisVertical(int position) {
FILE: hellocharts-library/src/lecho/lib/hellocharts/renderer/BubbleChartRenderer.java
class BubbleChartRenderer (line 21) | public class BubbleChartRenderer extends AbstractChartRenderer {
method BubbleChartRenderer (line 68) | public BubbleChartRenderer(Context context, Chart chart, BubbleChartDa...
method onChartSizeChanged (line 79) | @Override
method onChartDataChanged (line 90) | @Override
method onChartViewportChanged (line 101) | @Override
method draw (line 110) | @Override
method drawUnclipped (line 118) | @Override
method checkTouch (line 122) | @Override
method removeMargins (line 159) | public void removeMargins() {
method drawBubbles (line 185) | private void drawBubbles(Canvas canvas) {
method drawBubble (line 192) | private void drawBubble(Canvas canvas, BubbleValue bubbleValue) {
method drawBubbleShapeAndLabel (line 202) | private void drawBubbleShapeAndLabel(Canvas canvas, BubbleValue bubble...
method highlightBubbles (line 224) | private void highlightBubbles(Canvas canvas) {
method highlightBubble (line 230) | private void highlightBubble(Canvas canvas, BubbleValue bubbleValue) {
method processBubble (line 240) | private float processBubble(BubbleValue bubbleValue, PointF point) {
method drawLabel (line 264) | private void drawLabel(Canvas canvas, BubbleValue bubbleValue, float r...
method calculateMaxViewport (line 303) | private void calculateMaxViewport() {
FILE: hellocharts-library/src/lecho/lib/hellocharts/renderer/ChartRenderer.java
type ChartRenderer (line 11) | public interface ChartRenderer {
method onChartSizeChanged (line 13) | public void onChartSizeChanged();
method onChartDataChanged (line 15) | public void onChartDataChanged();
method onChartViewportChanged (line 17) | public void onChartViewportChanged();
method resetRenderer (line 19) | public void resetRenderer();
method draw (line 24) | public void draw(Canvas canvas);
method drawUnclipped (line 29) | public void drawUnclipped(Canvas canvas);
method checkTouch (line 35) | public boolean checkTouch(float touchX, float touchY);
method isTouched (line 40) | public boolean isTouched();
method clearTouch (line 45) | public void clearTouch();
method getMaximumViewport (line 47) | public Viewport getMaximumViewport();
method setMaximumViewport (line 49) | public void setMaximumViewport(Viewport maxViewport);
method getCurrentViewport (line 51) | public Viewport getCurrentViewport();
method setCurrentViewport (line 53) | public void setCurrentViewport(Viewport viewport);
method isViewportCalculationEnabled (line 55) | public boolean isViewportCalculationEnabled();
method setViewportCalculationEnabled (line 57) | public void setViewportCalculationEnabled(boolean isEnabled);
method selectValue (line 59) | public void selectValue(SelectedValue selectedValue);
method getSelectedValue (line 61) | public SelectedValue getSelectedValue();
FILE: hellocharts-library/src/lecho/lib/hellocharts/renderer/ColumnChartRenderer.java
class ColumnChartRenderer (line 22) | public class ColumnChartRenderer extends AbstractChartRenderer {
method ColumnChartRenderer (line 63) | public ColumnChartRenderer(Context context, Chart chart, ColumnChartDa...
method onChartSizeChanged (line 74) | @Override
method onChartDataChanged (line 78) | @Override
method onChartViewportChanged (line 88) | @Override
method draw (line 97) | public void draw(Canvas canvas) {
method drawUnclipped (line 112) | @Override
method checkTouch (line 117) | public boolean checkTouch(float touchX, float touchY) {
method calculateMaxViewport (line 128) | private void calculateMaxViewport() {
method calculateMaxViewportForSubcolumns (line 141) | private void calculateMaxViewportForSubcolumns(ColumnChartData data) {
method calculateMaxViewportForStacked (line 154) | private void calculateMaxViewportForStacked(ColumnChartData data) {
method drawColumnsForSubcolumns (line 174) | private void drawColumnsForSubcolumns(Canvas canvas) {
method highlightColumnsForSubcolumns (line 184) | private void highlightColumnsForSubcolumns(Canvas canvas) {
method checkTouchForSubcolumns (line 191) | private void checkTouchForSubcolumns(float touchX, float touchY) {
method processColumnForSubcolumns (line 205) | private void processColumnForSubcolumns(Canvas canvas, Column column, ...
method drawColumnForStacked (line 249) | private void drawColumnForStacked(Canvas canvas) {
method highlightColumnForStacked (line 260) | private void highlightColumnForStacked(Canvas canvas) {
method checkTouchForStacked (line 268) | private void checkTouchForStacked(float touchX, float touchY) {
method processColumnForStacked (line 281) | private void processColumnForStacked(Canvas canvas, Column column, flo...
method drawSubcolumn (line 321) | private void drawSubcolumn(Canvas canvas, Column column, SubcolumnValu...
method highlightSubcolumn (line 328) | private void highlightSubcolumn(Canvas canvas, Column column, Subcolum...
method checkRectToDraw (line 340) | private void checkRectToDraw(int columnIndex, int valueIndex) {
method calculateColumnWidth (line 346) | private float calculateColumnWidth() {
method calculateRectToDraw (line 356) | private void calculateRectToDraw(SubcolumnValue columnValue, float lef...
method drawLabel (line 369) | private void drawLabel(Canvas canvas, Column column, SubcolumnValue co...
FILE: hellocharts-library/src/lecho/lib/hellocharts/renderer/ComboChartRenderer.java
class ComboChartRenderer (line 12) | public class ComboChartRenderer extends AbstractChartRenderer {
method ComboChartRenderer (line 17) | public ComboChartRenderer(Context context, Chart chart) {
method onChartSizeChanged (line 22) | @Override
method onChartDataChanged (line 29) | @Override
method onChartViewportChanged (line 38) | @Override
method draw (line 58) | public void draw(Canvas canvas) {
method drawUnclipped (line 64) | @Override
method checkTouch (line 71) | public boolean checkTouch(float touchX, float touchY) {
method clearTouch (line 92) | @Override
FILE: hellocharts-library/src/lecho/lib/hellocharts/renderer/ComboLineColumnChartRenderer.java
class ComboLineColumnChartRenderer (line 9) | public class ComboLineColumnChartRenderer extends ComboChartRenderer {
method ComboLineColumnChartRenderer (line 14) | public ComboLineColumnChartRenderer(Context context, Chart chart, Colu...
method ComboLineColumnChartRenderer (line 20) | public ComboLineColumnChartRenderer(Context context, Chart chart, Colu...
method ComboLineColumnChartRenderer (line 25) | public ComboLineColumnChartRenderer(Context context, Chart chart, Colu...
method ComboLineColumnChartRenderer (line 30) | public ComboLineColumnChartRenderer(Context context, Chart chart, Colu...
FILE: hellocharts-library/src/lecho/lib/hellocharts/renderer/LineChartRenderer.java
class LineChartRenderer (line 28) | public class LineChartRenderer extends AbstractChartRenderer {
method LineChartRenderer (line 51) | public LineChartRenderer(Context context, Chart chart, LineChartDataPr...
method onChartSizeChanged (line 69) | public void onChartSizeChanged() {
method onChartDataChanged (line 80) | @Override
method onChartViewportChanged (line 91) | @Override
method draw (line 100) | @Override
method drawUnclipped (line 132) | @Override
method checkIfShouldDrawPoints (line 148) | private boolean checkIfShouldDrawPoints(Line line) {
method checkTouch (line 152) | @Override
method calculateMaxViewport (line 175) | private void calculateMaxViewport() {
method calculateContentRectInternalMargin (line 199) | private int calculateContentRectInternalMargin() {
method drawPath (line 216) | private void drawPath(Canvas canvas, final Line line) {
method drawSquarePath (line 244) | private void drawSquarePath(Canvas canvas, final Line line) {
method drawSmoothPath (line 276) | private void drawSmoothPath(Canvas canvas, final Line line) {
method prepareLinePaint (line 361) | private void prepareLinePaint(final Line line) {
method drawPoints (line 371) | private void drawPoints(Canvas canvas, Line line, int lineIndex, int m...
method drawPoint (line 397) | private void drawPoint(Canvas canvas, Line line, PointValue pointValue...
method highlightPoints (line 415) | private void highlightPoints(Canvas canvas) {
method highlightPoint (line 421) | private void highlightPoint(Canvas canvas, Line line, PointValue point...
method drawLabel (line 433) | private void drawLabel(Canvas canvas, Line line, PointValue pointValue...
method drawArea (line 479) | private void drawArea(Canvas canvas, Line line) {
method isInArea (line 508) | private boolean isInArea(float x, float y, float touchX, float touchY,...
FILE: hellocharts-library/src/lecho/lib/hellocharts/renderer/PieChartRenderer.java
class PieChartRenderer (line 31) | public class PieChartRenderer extends AbstractChartRenderer {
method PieChartRenderer (line 71) | public PieChartRenderer(Context context, Chart chart, PieChartDataProv...
method onChartSizeChanged (line 96) | @Override
method onChartDataChanged (line 107) | @Override
method onChartViewportChanged (line 134) | @Override
method draw (line 143) | @Override
method drawUnclipped (line 167) | @Override
method checkTouch (line 171) | @Override
method drawCenterCircle (line 210) | private void drawCenterCircle(Canvas canvas) {
method drawSlices (line 242) | private void drawSlices(Canvas canvas) {
method drawSeparationLines (line 259) | private void drawSeparationLines(Canvas canvas) {
method drawLabels (line 290) | public void drawLabels(Canvas canvas) {
method drawSlice (line 318) | private void drawSlice(Canvas canvas, SliceValue sliceValue, float las...
method drawLabel (line 334) | private void drawLabel(Canvas canvas, SliceValue sliceValue, float las...
method normalizeVector (line 402) | private void normalizeVector(PointF point) {
method pointToAngle (line 410) | private float pointToAngle(float x, float y, float centerX, float cent...
method calculateCircleOval (line 425) | private void calculateCircleOval() {
method calculateMaxViewport (line 443) | private void calculateMaxViewport() {
method getCircleOval (line 451) | public RectF getCircleOval() {
method setCircleOval (line 455) | public void setCircleOval(RectF orginCircleOval) {
method getChartRotation (line 459) | public int getChartRotation() {
method setChartRotation (line 463) | public void setChartRotation(int rotation) {
method getValueForAngle (line 471) | public SliceValue getValueForAngle(int angle, SelectedValue selectedVa...
method getCircleFillRatio (line 494) | public float getCircleFillRatio() {
method setCircleFillRatio (line 502) | public void setCircleFillRatio(float fillRatio) {
FILE: hellocharts-library/src/lecho/lib/hellocharts/renderer/PreviewColumnChartRenderer.java
class PreviewColumnChartRenderer (line 17) | public class PreviewColumnChartRenderer extends ColumnChartRenderer {
method PreviewColumnChartRenderer (line 24) | public PreviewColumnChartRenderer(Context context, Chart chart, Column...
method drawUnclipped (line 31) | @Override
method getPreviewColor (line 47) | public int getPreviewColor() {
method setPreviewColor (line 51) | public void setPreviewColor(int color) {
FILE: hellocharts-library/src/lecho/lib/hellocharts/renderer/PreviewLineChartRenderer.java
class PreviewLineChartRenderer (line 17) | public class PreviewLineChartRenderer extends LineChartRenderer {
method PreviewLineChartRenderer (line 24) | public PreviewLineChartRenderer(Context context, Chart chart, LineChar...
method drawUnclipped (line 31) | @Override
method getPreviewColor (line 47) | public int getPreviewColor() {
method setPreviewColor (line 51) | public void setPreviewColor(int color) {
FILE: hellocharts-library/src/lecho/lib/hellocharts/util/AxisAutoValues.java
class AxisAutoValues (line 6) | public class AxisAutoValues {
FILE: hellocharts-library/src/lecho/lib/hellocharts/util/ChartUtils.java
class ChartUtils (line 7) | public abstract class ChartUtils {
method pickColor (line 21) | public static final int pickColor() {
method nextColor (line 25) | public static final int nextColor() {
method dp2px (line 32) | public static int dp2px(float density, int dp) {
method px2dp (line 40) | public static int px2dp(float density, int px) {
method sp2px (line 44) | public static int sp2px(float scaledDensity, int sp) {
method px2sp (line 51) | public static int px2sp(float scaledDensity, int px) {
method mm2px (line 55) | public static int mm2px(Context context, int mm) {
method darkenColor (line 60) | public static int darkenColor(int color) {
FILE: hellocharts-library/src/lecho/lib/hellocharts/util/FloatUtils.java
class FloatUtils (line 3) | public class FloatUtils {
method nextUpF (line 9) | public static float nextUpF(float f) {
method nextDownF (line 21) | public static float nextDownF(float f) {
method nextUp (line 36) | public static double nextUp(double d) {
method nextDown (line 48) | public static double nextDown(double d) {
method almostEqual (line 63) | public static boolean almostEqual(float a, float b, float absoluteDiff...
method roundToOneSignificantFigure (line 84) | public static float roundToOneSignificantFigure(double num) {
method formatFloat (line 99) | public static int formatFloat(final char[] formattedValue, float value...
method computeAutoGeneratedAxisValues (line 152) | public static void computeAutoGeneratedAxisValues(float start, float s...
FILE: hellocharts-library/src/lecho/lib/hellocharts/view/AbstractChartView.java
class AbstractChartView (line 34) | public abstract class AbstractChartView extends View implements Chart {
method AbstractChartView (line 45) | public AbstractChartView(Context context) {
method AbstractChartView (line 49) | public AbstractChartView(Context context, AttributeSet attrs) {
method AbstractChartView (line 53) | public AbstractChartView(Context context, AttributeSet attrs, int defS...
method onMeasure (line 68) | @Override
method onSizeChanged (line 73) | @Override
method onDraw (line 82) | @Override
method onTouchEvent (line 99) | @Override
method computeScroll (line 124) | @Override
method startDataAnimation (line 134) | @Override
method startDataAnimation (line 139) | @Override
method cancelDataAnimation (line 144) | @Override
method animationDataUpdate (line 149) | @Override
method animationDataFinished (line 156) | @Override
method setDataAnimationListener (line 163) | @Override
method setViewportAnimationListener (line 168) | @Override
method setViewportChangeListener (line 173) | @Override
method getChartRenderer (line 178) | @Override
method setChartRenderer (line 183) | @Override
method getAxesRenderer (line 190) | @Override
method getChartComputator (line 195) | @Override
method getTouchHandler (line 200) | @Override
method isInteractive (line 205) | @Override
method setInteractive (line 210) | @Override
method isZoomEnabled (line 215) | @Override
method setZoomEnabled (line 220) | @Override
method isScrollEnabled (line 225) | @Override
method setScrollEnabled (line 230) | @Override
method moveTo (line 235) | @Override
method moveToWithAnimation (line 241) | @Override
method computeScrollViewport (line 247) | private Viewport computeScrollViewport(float x, float y) {
method isValueTouchEnabled (line 271) | @Override
method setValueTouchEnabled (line 276) | @Override
method getZoomType (line 282) | @Override
method setZoomType (line 287) | @Override
method getMaxZoom (line 292) | @Override
method setMaxZoom (line 297) | @Override
method getZoomLevel (line 303) | @Override
method setZoomLevel (line 312) | @Override
method setZoomLevelWithAnimation (line 318) | @Override
method computeZoomViewport (line 324) | private Viewport computeZoomViewport(float x, float y, float zoomLevel) {
method getMaximumViewport (line 378) | @Override
method setMaximumViewport (line 383) | @Override
method setCurrentViewportWithAnimation (line 389) | @Override
method setCurrentViewportWithAnimation (line 398) | @Override
method getCurrentViewport (line 407) | @Override
method setCurrentViewport (line 412) | @Override
method resetViewports (line 420) | @Override
method isViewportCalculationEnabled (line 426) | @Override
method setViewportCalculationEnabled (line 431) | @Override
method isValueSelectionEnabled (line 436) | @Override
method setValueSelectionEnabled (line 441) | @Override
method selectValue (line 446) | @Override
method getSelectedValue (line 453) | @Override
method isContainerScrollEnabled (line 458) | @Override
method setContainerScrollEnabled (line 463) | @Override
method onChartDataChange (line 469) | protected void onChartDataChange() {
method resetRendererAndTouchHandler (line 480) | protected void resetRendererAndTouchHandler() {
method canScrollHorizontally (line 494) | @Override
FILE: hellocharts-library/src/lecho/lib/hellocharts/view/BubbleChartView.java
class BubbleChartView (line 23) | public class BubbleChartView extends AbstractChartView implements Bubble...
method BubbleChartView (line 30) | public BubbleChartView(Context context) {
method BubbleChartView (line 34) | public BubbleChartView(Context context, AttributeSet attrs) {
method BubbleChartView (line 38) | public BubbleChartView(Context context, AttributeSet attrs, int defSty...
method getBubbleChartData (line 45) | @Override
method setBubbleChartData (line 50) | @Override
method getChartData (line 65) | @Override
method callTouchListener (line 70) | @Override
method getOnValueTouchListener (line 82) | public BubbleChartOnValueSelectListener getOnValueTouchListener() {
method setOnValueTouchListener (line 86) | public void setOnValueTouchListener(BubbleChartOnValueSelectListener t...
method removeMargins (line 98) | public void removeMargins() {
FILE: hellocharts-library/src/lecho/lib/hellocharts/view/Chart.java
type Chart (line 20) | public interface Chart {
method getChartData (line 25) | public ChartData getChartData();
method getChartRenderer (line 27) | public ChartRenderer getChartRenderer();
method setChartRenderer (line 29) | public void setChartRenderer(ChartRenderer renderer);
method getAxesRenderer (line 31) | public AxesRenderer getAxesRenderer();
method getChartComputator (line 33) | public ChartComputator getChartComputator();
method getTouchHandler (line 35) | public ChartTouchHandler getTouchHandler();
method animationDataUpdate (line 40) | public void animationDataUpdate(float scale);
method animationDataFinished (line 45) | public void animationDataFinished();
method startDataAnimation (line 51) | public void startDataAnimation();
method startDataAnimation (line 57) | public void startDataAnimation(long duration);
method cancelDataAnimation (line 62) | public void cancelDataAnimation();
method isViewportCalculationEnabled (line 67) | public boolean isViewportCalculationEnabled();
method setViewportCalculationEnabled (line 75) | public void setViewportCalculationEnabled(boolean isEnabled);
method setDataAnimationListener (line 81) | public void setDataAnimationListener(ChartAnimationListener animationL...
method setViewportAnimationListener (line 86) | public void setViewportAnimationListener(ChartAnimationListener animat...
method setViewportChangeListener (line 93) | public void setViewportChangeListener(ViewportChangeListener viewportC...
method callTouchListener (line 95) | public void callTouchListener();
method isInteractive (line 102) | public boolean isInteractive();
method setInteractive (line 108) | public void setInteractive(boolean isInteractive);
method isZoomEnabled (line 115) | public boolean isZoomEnabled();
method setZoomEnabled (line 120) | public void setZoomEnabled(boolean isZoomEnabled);
method isScrollEnabled (line 127) | public boolean isScrollEnabled();
method setScrollEnabled (line 132) | public void setScrollEnabled(boolean isScrollEnabled);
method moveTo (line 140) | public void moveTo(float x, float y);
method moveToWithAnimation (line 148) | public void moveToWithAnimation(float x, float y);
method getZoomType (line 155) | public ZoomType getZoomType();
method setZoomType (line 161) | public void setZoomType(ZoomType zoomType);
method getMaxZoom (line 166) | public float getMaxZoom();
method setMaxZoom (line 171) | public void setMaxZoom(float maxZoom);
method getZoomLevel (line 176) | public float getZoomLevel();
method setZoomLevel (line 185) | public void setZoomLevel(float x, float y, float zoomLevel);
method setZoomLevelWithAnimation (line 195) | public void setZoomLevelWithAnimation(float x, float y, float zoomLevel);
method isValueTouchEnabled (line 202) | public boolean isValueTouchEnabled();
method setValueTouchEnabled (line 207) | public void setValueTouchEnabled(boolean isValueTouchEnabled);
method getMaximumViewport (line 215) | public Viewport getMaximumViewport();
method setMaximumViewport (line 221) | public void setMaximumViewport(Viewport maxViewport);
method getCurrentViewport (line 228) | public Viewport getCurrentViewport();
method setCurrentViewport (line 233) | public void setCurrentViewport(Viewport targetViewport);
method setCurrentViewportWithAnimation (line 238) | public void setCurrentViewportWithAnimation(Viewport targetViewport);
method setCurrentViewportWithAnimation (line 243) | public void setCurrentViewportWithAnimation(Viewport targetViewport, l...
method resetViewports (line 249) | public void resetViewports();
method isValueSelectionEnabled (line 256) | public boolean isValueSelectionEnabled();
method setValueSelectionEnabled (line 262) | public void setValueSelectionEnabled(boolean isValueSelectionEnabled);
method selectValue (line 267) | public void selectValue(SelectedValue selectedValue);
method getSelectedValue (line 272) | public SelectedValue getSelectedValue();
method isContainerScrollEnabled (line 277) | public boolean isContainerScrollEnabled();
method setContainerScrollEnabled (line 283) | public void setContainerScrollEnabled(boolean isContainerScrollEnabled...
FILE: hellocharts-library/src/lecho/lib/hellocharts/view/ColumnChartView.java
class ColumnChartView (line 21) | public class ColumnChartView extends AbstractChartView implements Column...
method ColumnChartView (line 26) | public ColumnChartView(Context context) {
method ColumnChartView (line 30) | public ColumnChartView(Context context, AttributeSet attrs) {
method ColumnChartView (line 34) | public ColumnChartView(Context context, AttributeSet attrs, int defSty...
method getColumnChartData (line 40) | @Override
method setColumnChartData (line 45) | @Override
method getChartData (line 61) | @Override
method callTouchListener (line 66) | @Override
method getOnValueTouchListener (line 79) | public ColumnChartOnValueSelectListener getOnValueTouchListener() {
method setOnValueTouchListener (line 83) | public void setOnValueTouchListener(ColumnChartOnValueSelectListener t...
FILE: hellocharts-library/src/lecho/lib/hellocharts/view/ComboLineColumnChartView.java
class ComboLineColumnChartView (line 30) | public class ComboLineColumnChartView extends AbstractChartView implemen...
method ComboLineColumnChartView (line 38) | public ComboLineColumnChartView(Context context) {
method ComboLineColumnChartView (line 42) | public ComboLineColumnChartView(Context context, AttributeSet attrs) {
method ComboLineColumnChartView (line 46) | public ComboLineColumnChartView(Context context, AttributeSet attrs, i...
method getComboLineColumnChartData (line 53) | @Override
method setComboLineColumnChartData (line 58) | @Override
method getChartData (line 73) | @Override
method callTouchListener (line 78) | @Override
method getOnValueTouchListener (line 106) | public ComboLineColumnChartOnValueSelectListener getOnValueTouchListen...
method setOnValueTouchListener (line 110) | public void setOnValueTouchListener(ComboLineColumnChartOnValueSelectL...
method setColumnChartRenderer (line 116) | public void setColumnChartRenderer(Context context, ColumnChartRendere...
method setLineChartRenderer (line 120) | public void setLineChartRenderer(Context context, LineChartRenderer li...
class ComboLineChartDataProvider (line 124) | private class ComboLineChartDataProvider implements LineChartDataProvi...
method getLineChartData (line 126) | @Override
method setLineChartData (line 131) | @Override
class ComboColumnChartDataProvider (line 139) | private class ComboColumnChartDataProvider implements ColumnChartDataP...
method getColumnChartData (line 141) | @Override
method setColumnChartData (line 146) | @Override
FILE: hellocharts-library/src/lecho/lib/hellocharts/view/LineChartView.java
class LineChartView (line 23) | public class LineChartView extends AbstractChartView implements LineChar...
method LineChartView (line 28) | public LineChartView(Context context) {
method LineChartView (line 32) | public LineChartView(Context context, AttributeSet attrs) {
method LineChartView (line 36) | public LineChartView(Context context, AttributeSet attrs, int defStyle) {
method getLineChartData (line 42) | @Override
method setLineChartData (line 47) | @Override
method getChartData (line 62) | @Override
method callTouchListener (line 67) | @Override
method getOnValueTouchListener (line 80) | public LineChartOnValueSelectListener getOnValueTouchListener() {
method setOnValueTouchListener (line 84) | public void setOnValueTouchListener(LineChartOnValueSelectListener tou...
FILE: hellocharts-library/src/lecho/lib/hellocharts/view/PieChartView.java
class PieChartView (line 33) | public class PieChartView extends AbstractChartView implements PieChartD...
method PieChartView (line 40) | public PieChartView(Context context) {
method PieChartView (line 44) | public PieChartView(Context context, AttributeSet attrs) {
method PieChartView (line 48) | public PieChartView(Context context, AttributeSet attrs, int defStyle) {
method getPieChartData (line 61) | @Override
method setPieChartData (line 66) | @Override
method getChartData (line 81) | @Override
method callTouchListener (line 86) | @Override
method getOnValueTouchListener (line 98) | public PieChartOnValueSelectListener getOnValueTouchListener() {
method setOnValueTouchListener (line 102) | public void setOnValueTouchListener(PieChartOnValueSelectListener touc...
method getCircleOval (line 111) | public RectF getCircleOval() {
method setCircleOval (line 120) | public void setCircleOval(RectF orginCircleOval) {
method getChartRotation (line 131) | public int getChartRotation() {
method setChartRotation (line 141) | public void setChartRotation(int rotation, boolean isAnimated) {
method isChartRotationEnabled (line 151) | public boolean isChartRotationEnabled() {
method setChartRotationEnabled (line 164) | public void setChartRotationEnabled(boolean isRotationEnabled) {
method getValueForAngle (line 173) | public SliceValue getValueForAngle(int angle, SelectedValue selectedVa...
method getCircleFillRatio (line 180) | public float getCircleFillRatio() {
method setCircleFillRatio (line 188) | public void setCircleFillRatio(float fillRatio) {
FILE: hellocharts-library/src/lecho/lib/hellocharts/view/PreviewColumnChartView.java
class PreviewColumnChartView (line 21) | public class PreviewColumnChartView extends ColumnChartView {
method PreviewColumnChartView (line 26) | public PreviewColumnChartView(Context context) {
method PreviewColumnChartView (line 30) | public PreviewColumnChartView(Context context, AttributeSet attrs) {
method PreviewColumnChartView (line 34) | public PreviewColumnChartView(Context context, AttributeSet attrs, int...
method getPreviewColor (line 43) | public int getPreviewColor() {
method setPreviewColor (line 47) | public void setPreviewColor(int color) {
method canScrollHorizontally (line 56) | @Override
FILE: hellocharts-library/src/lecho/lib/hellocharts/view/PreviewLineChartView.java
class PreviewLineChartView (line 21) | public class PreviewLineChartView extends LineChartView {
method PreviewLineChartView (line 26) | public PreviewLineChartView(Context context) {
method PreviewLineChartView (line 30) | public PreviewLineChartView(Context context, AttributeSet attrs) {
method PreviewLineChartView (line 34) | public PreviewLineChartView(Context context, AttributeSet attrs, int d...
method getPreviewColor (line 43) | public int getPreviewColor() {
method setPreviewColor (line 47) | public void setPreviewColor(int color) {
method canScrollHorizontally (line 56) | @Override
FILE: hellocharts-library/src/lecho/lib/hellocharts/view/hack/HackyDrawerLayout.java
class HackyDrawerLayout (line 11) | public class HackyDrawerLayout extends DrawerLayout {
method HackyDrawerLayout (line 13) | public HackyDrawerLayout(Context context) {
method HackyDrawerLayout (line 17) | public HackyDrawerLayout(Context context, AttributeSet attrs) {
method HackyDrawerLayout (line 21) | public HackyDrawerLayout(Context context, AttributeSet attrs, int defS...
method onInterceptTouchEvent (line 25) | @Override
FILE: hellocharts-library/src/lecho/lib/hellocharts/view/hack/HackyViewPager.java
class HackyViewPager (line 16) | public class HackyViewPager extends ViewPager {
method HackyViewPager (line 18) | public HackyViewPager(Context context) {
method HackyViewPager (line 22) | public HackyViewPager(final Context context, final AttributeSet attrs) {
method onInterceptTouchEvent (line 26) | @Override
FILE: hellocharts-samples/src/lecho/lib/hellocharts/samples/AboutActivity.java
class AboutActivity (line 20) | public class AboutActivity extends ActionBarActivity {
method getAppVersionAndBuild (line 24) | public static Pair<String, Integer> getAppVersionAndBuild(Context cont...
method launchWebBrowser (line 34) | @SuppressLint("DefaultLocale")
method onCreate (line 59) | @Override
class PlaceholderFragment (line 71) | public static class PlaceholderFragment extends Fragment {
method PlaceholderFragment (line 73) | public PlaceholderFragment() {
method onCreateView (line 76) | @Override
FILE: hellocharts-samples/src/lecho/lib/hellocharts/samples/BubbleChartActivity.java
class BubbleChartActivity (line 27) | public class BubbleChartActivity extends ActionBarActivity {
method onCreate (line 29) | @Override
class PlaceholderFragment (line 41) | public static class PlaceholderFragment extends Fragment {
method PlaceholderFragment (line 53) | public PlaceholderFragment() {
method onCreateView (line 56) | @Override
method onCreateOptionsMenu (line 69) | @Override
method onOptionsItemSelected (line 74) | @Override
method reset (line 134) | private void reset() {
method generateData (line 144) | private void generateData() {
method setCircles (line 176) | private void setCircles() {
method setSquares (line 181) | private void setSquares() {
method toggleLabels (line 186) | private void toggleLabels() {
method toggleLabelForSelected (line 197) | private void toggleLabelForSelected() {
method toggleAxes (line 209) | private void toggleAxes() {
method toggleAxesNames (line 215) | private void toggleAxesNames() {
method prepareDataAnimation (line 225) | private void prepareDataAnimation() {
method getSign (line 232) | private int getSign() {
class ValueTouchListener (line 237) | private class ValueTouchListener implements BubbleChartOnValueSelect...
method onValueSelected (line 239) | @Override
method onValueDeselected (line 244) | @Override
FILE: hellocharts-samples/src/lecho/lib/hellocharts/samples/ColumnChartActivity.java
class ColumnChartActivity (line 27) | public class ColumnChartActivity extends ActionBarActivity {
method onCreate (line 29) | @Override
class PlaceholderFragment (line 41) | public static class PlaceholderFragment extends Fragment {
method PlaceholderFragment (line 57) | public PlaceholderFragment() {
method onCreateView (line 60) | @Override
method onCreateOptionsMenu (line 74) | @Override
method onOptionsItemSelected (line 79) | @Override
method reset (line 152) | private void reset() {
method generateDefaultData (line 162) | private void generateDefaultData() {
method generateSubcolumnsData (line 204) | private void generateSubcolumnsData() {
method generateStackedData (line 246) | private void generateStackedData() {
method generateNegativeSubcolumnsData (line 287) | private void generateNegativeSubcolumnsData() {
method generateNegativeStackedData (line 327) | private void generateNegativeStackedData() {
method getSign (line 370) | private int getSign() {
method generateData (line 375) | private void generateData() {
method toggleLabels (line 398) | private void toggleLabels() {
method toggleLabelForSelected (line 409) | private void toggleLabelForSelected() {
method toggleAxes (line 420) | private void toggleAxes() {
method toggleAxesNames (line 426) | private void toggleAxesNames() {
method prepareDataAnimation (line 436) | private void prepareDataAnimation() {
class ValueTouchListener (line 444) | private class ValueTouchListener implements ColumnChartOnValueSelect...
method onValueSelected (line 446) | @Override
method onValueDeselected (line 451) | @Override
FILE: hellocharts-samples/src/lecho/lib/hellocharts/samples/ComboLineColumnChartActivity.java
class ComboLineColumnChartActivity (line 29) | public class ComboLineColumnChartActivity extends ActionBarActivity {
method onCreate (line 31) | @Override
class PlaceholderFragment (line 43) | public static class PlaceholderFragment extends Fragment {
method PlaceholderFragment (line 61) | public PlaceholderFragment() {
method onCreateView (line 64) | @Override
method onCreateOptionsMenu (line 79) | @Override
method onOptionsItemSelected (line 84) | @Override
method generateValues (line 128) | private void generateValues() {
method reset (line 136) | private void reset() {
method generateData (line 148) | private void generateData() {
method generateLineData (line 169) | private LineChartData generateLineData() {
method generateColumnData (line 194) | private ColumnChartData generateColumnData() {
method addLineToData (line 214) | private void addLineToData() {
method toggleLines (line 225) | private void toggleLines() {
method togglePoints (line 231) | private void togglePoints() {
method toggleCubic (line 237) | private void toggleCubic() {
method toggleLabels (line 243) | private void toggleLabels() {
method toggleAxes (line 249) | private void toggleAxes() {
method toggleAxesNames (line 255) | private void toggleAxesNames() {
method prepareDataAnimation (line 261) | private void prepareDataAnimation() {
class ValueTouchListener (line 279) | private class ValueTouchListener implements ComboLineColumnChartOnVa...
method onValueDeselected (line 281) | @Override
method onColumnValueSelected (line 287) | @Override
method onPointValueSelected (line 292) | @Override
FILE: hellocharts-samples/src/lecho/lib/hellocharts/samples/GoodBadChartActivity.java
class GoodBadChartActivity (line 20) | public class GoodBadChartActivity extends ActionBarActivity {
method onCreate (line 22) | @Override
class PlaceholderFragment (line 34) | public static class PlaceholderFragment extends Fragment {
method PlaceholderFragment (line 39) | public PlaceholderFragment() {
method onCreateView (line 42) | @Override
method generateDefaultData (line 61) | private void generateDefaultData() {
FILE: hellocharts-samples/src/lecho/lib/hellocharts/samples/LineChartActivity.java
class LineChartActivity (line 30) | public class LineChartActivity extends ActionBarActivity {
method onCreate (line 32) | @Override
class PlaceholderFragment (line 44) | public static class PlaceholderFragment extends Fragment {
method PlaceholderFragment (line 66) | public PlaceholderFragment() {
method onCreateView (line 69) | @Override
method onCreateOptionsMenu (line 91) | @Override
method onOptionsItemSelected (line 96) | @Override
method generateValues (line 189) | private void generateValues() {
method reset (line 197) | private void reset() {
method resetViewport (line 215) | private void resetViewport() {
method generateData (line 226) | private void generateData() {
method addLineToData (line 277) | private void addLineToData() {
method toggleLines (line 288) | private void toggleLines() {
method togglePoints (line 294) | private void togglePoints() {
method toggleGradient (line 300) | private void toggleGradient() {
method toggleCubic (line 306) | private void toggleCubic() {
method toggleFilled (line 358) | private void toggleFilled() {
method togglePointColor (line 364) | private void togglePointColor() {
method setCircles (line 370) | private void setCircles() {
method setSquares (line 376) | private void setSquares() {
method setDiamonds (line 382) | private void setDiamonds() {
method toggleLabels (line 388) | private void toggleLabels() {
method toggleLabelForSelected (line 399) | private void toggleLabelForSelected() {
method toggleAxes (line 411) | private void toggleAxes() {
method toggleAxesNames (line 417) | private void toggleAxesNames() {
method prepareDataAnimation (line 428) | private void prepareDataAnimation() {
class ValueTouchListener (line 437) | private class ValueTouchListener implements LineChartOnValueSelectLi...
method onValueSelected (line 439) | @Override
method onValueDeselected (line 444) | @Override
FILE: hellocharts-samples/src/lecho/lib/hellocharts/samples/LineColumnDependencyActivity.java
class LineColumnDependencyActivity (line 28) | public class LineColumnDependencyActivity extends ActionBarActivity {
method onCreate (line 30) | @Override
class PlaceholderFragment (line 42) | public static class PlaceholderFragment extends Fragment {
method PlaceholderFragment (line 54) | public PlaceholderFragment() {
method onCreateView (line 57) | @Override
method generateColumnData (line 76) | private void generateColumnData() {
method generateInitialLineData (line 129) | private void generateInitialLineData() {
method generateLineData (line 162) | private void generateLineData(int color, float range) {
class ValueTouchListener (line 178) | private class ValueTouchListener implements ColumnChartOnValueSelect...
method onValueSelected (line 180) | @Override
method onValueDeselected (line 185) | @Override
FILE: hellocharts-samples/src/lecho/lib/hellocharts/samples/MainActivity.java
class MainActivity (line 31) | public class MainActivity extends ActionBarActivity {
method onCreate (line 33) | @Override
method onCreateOptionsMenu (line 42) | @Override
method onOptionsItemSelected (line 49) | @Override
type ChartType (line 63) | public enum ChartType {
class PlaceholderFragment (line 70) | public static class PlaceholderFragment extends Fragment implements On...
method PlaceholderFragment (line 75) | public PlaceholderFragment() {
method onCreateView (line 78) | @Override
method onItemClick (line 88) | @Override
method generateSamplesDescriptions (line 158) | private List<ChartSampleDescription> generateSamplesDescriptions() {
class ChartSamplesAdapter (line 191) | public static class ChartSamplesAdapter extends ArrayAdapter<ChartSamp...
method ChartSamplesAdapter (line 193) | public ChartSamplesAdapter(Context context, int resource, List<Chart...
method getView (line 197) | @Override
class ViewHolder (line 259) | private class ViewHolder {
class ChartSampleDescription (line 268) | public static class ChartSampleDescription {
method ChartSampleDescription (line 273) | public ChartSampleDescription(String text1, String text2, ChartType ...
FILE: hellocharts-samples/src/lecho/lib/hellocharts/samples/PieChartActivity.java
class PieChartActivity (line 25) | public class PieChartActivity extends ActionBarActivity {
method onCreate (line 27) | @Override
class PlaceholderFragment (line 39) | public static class PlaceholderFragment extends Fragment {
method PlaceholderFragment (line 52) | public PlaceholderFragment() {
method onCreateView (line 55) | @Override
method onCreateOptionsMenu (line 69) | @Override
method onOptionsItemSelected (line 74) | @Override
method reset (line 142) | private void reset() {
method generateData (line 153) | private void generateData() {
method explodeChart (line 197) | private void explodeChart() {
method toggleLabelsOutside (line 203) | private void toggleLabelsOutside() {
method toggleLabels (line 222) | private void toggleLabels() {
method toggleLabelForSelected (line 239) | private void toggleLabelForSelected() {
method prepareDataAnimation (line 262) | private void prepareDataAnimation() {
class ValueTouchListener (line 268) | private class ValueTouchListener implements PieChartOnValueSelectLis...
method onValueSelected (line 270) | @Override
method onValueDeselected (line 275) | @Override
FILE: hellocharts-samples/src/lecho/lib/hellocharts/samples/PreviewColumnChartActivity.java
class PreviewColumnChartActivity (line 27) | public class PreviewColumnChartActivity extends ActionBarActivity {
method onCreate (line 29) | @Override
class PlaceholderFragment (line 41) | public static class PlaceholderFragment extends Fragment {
method PlaceholderFragment (line 51) | public PlaceholderFragment() {
method onCreateView (line 54) | @Override
method onCreateOptionsMenu (line 80) | @Override
method onOptionsItemSelected (line 85) | @Override
method generateDefaultData (line 119) | private void generateDefaultData() {
method previewY (line 149) | private void previewY() {
method previewX (line 157) | private void previewX(boolean animate) {
method previewXY (line 169) | private void previewXY() {
class ViewportListener (line 183) | private class ViewportListener implements ViewportChangeListener {
method onViewportChanged (line 185) | @Override
FILE: hellocharts-samples/src/lecho/lib/hellocharts/samples/PreviewLineChartActivity.java
class PreviewLineChartActivity (line 27) | public class PreviewLineChartActivity extends ActionBarActivity {
method onCreate (line 29) | @Override
class PlaceholderFragment (line 41) | public static class PlaceholderFragment extends Fragment {
method PlaceholderFragment (line 51) | public PlaceholderFragment() {
method onCreateView (line 54) | @Override
method onCreateOptionsMenu (line 80) | @Override
method onOptionsItemSelected (line 85) | @Override
method generateDefaultData (line 119) | private void generateDefaultData() {
method previewY (line 145) | private void previewY() {
method previewX (line 153) | private void previewX(boolean animate) {
method previewXY (line 165) | private void previewXY() {
class ViewportListener (line 179) | private class ViewportListener implements ViewportChangeListener {
method onViewportChanged (line 181) | @Override
FILE: hellocharts-samples/src/lecho/lib/hellocharts/samples/SpeedChartActivity.java
class SpeedChartActivity (line 23) | public class SpeedChartActivity extends ActionBarActivity {
method onCreate (line 25) | @Override
class PlaceholderFragment (line 34) | public static class PlaceholderFragment extends Fragment {
method PlaceholderFragment (line 39) | public PlaceholderFragment() {
method onCreateView (line 42) | @Override
method generateSpeedData (line 53) | private void generateSpeedData() {
class HeightValueFormatter (line 138) | private static class HeightValueFormatter extends SimpleAxisValueFor...
method HeightValueFormatter (line 144) | public HeightValueFormatter(float scale, float sub, int decimalDig...
method formatValueForAutoGeneratedAxis (line 150) | @Override
FILE: hellocharts-samples/src/lecho/lib/hellocharts/samples/TempoChartActivity.java
class TempoChartActivity (line 24) | public class TempoChartActivity extends ActionBarActivity {
method onCreate (line 26) | @Override
class PlaceholderFragment (line 35) | public static class PlaceholderFragment extends Fragment {
method PlaceholderFragment (line 40) | public PlaceholderFragment() {
method onCreateView (line 43) | @Override
method generateTempoData (line 54) | private void generateTempoData() {
method formatMinutes (line 154) | private String formatMinutes(float value) {
class HeightValueFormatter (line 174) | private static class HeightValueFormatter extends SimpleAxisValueFor...
method HeightValueFormatter (line 180) | public HeightValueFormatter(float scale, float sub, int decimalDig...
method formatValueForAutoGeneratedAxis (line 186) | @Override
FILE: hellocharts-samples/src/lecho/lib/hellocharts/samples/ViewPagerChartsActivity.java
class ViewPagerChartsActivity (line 40) | public class ViewPagerChartsActivity extends ActionBarActivity implement...
method onCreate (line 54) | @Override
method onTabSelected (line 91) | @Override
method onTabUnselected (line 98) | @Override
method onTabReselected (line 102) | @Override
class PlaceholderFragment (line 109) | public static class PlaceholderFragment extends Fragment {
method PlaceholderFragment (line 115) | public PlaceholderFragment() {
method newInstance (line 121) | public static PlaceholderFragment newInstance(int sectionNumber) {
method onCreateView (line 129) | @Override
method generateLineChartData (line 194) | private LineChartData generateLineChartData() {
method generateColumnChartData (line 215) | private ColumnChartData generateColumnChartData() {
method generateBubbleChartData (line 239) | private BubbleChartData generateBubbleChartData() {
method generatePreviewLineChartData (line 256) | private LineChartData generatePreviewLineChartData() {
method generatePieChartData (line 279) | private PieChartData generatePieChartData() {
class SectionsPagerAdapter (line 296) | public class SectionsPagerAdapter extends FragmentPagerAdapter {
method SectionsPagerAdapter (line 298) | public SectionsPagerAdapter(FragmentManager fm) {
method getItem (line 302) | @Override
method getCount (line 309) | @Override
method getPageTitle (line 314) | @Override
Condensed preview — 180 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (592K chars).
[
{
"path": ".gitignore",
"chars": 379,
"preview": "# built application files\n*.apk\n*.ap_\n\n# files for the dex VM\n*.dex\n\n# Java class files\n*.class\n\n# generated files\nbin/\n"
},
{
"path": "LICENSE.txt",
"chars": 11358,
"preview": "\n Apache License\n Version 2.0, January 2004\n "
},
{
"path": "README.md",
"chars": 5526,
"preview": "# HelloCharts for Android\n\nCharting library for Android compatible with API 8+(Android 2.2).\nWorks best when hardware ac"
},
{
"path": "build.gradle",
"chars": 246,
"preview": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\nbuildscript {\n re"
},
{
"path": "documentation/MAIN.md",
"chars": 0,
"preview": ""
},
{
"path": "gradle/wrapper/gradle-wrapper.properties",
"chars": 231,
"preview": "#Wed Apr 10 15:27:10 PDT 2013\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_"
},
{
"path": "gradle.properties",
"chars": 721,
"preview": "VERSION_NAME=1.5.8\nVERSION_CODE=13\nGROUP=com.github.lecho\n\nPOM_DESCRIPTION=Charting library for Android compatible with "
},
{
"path": "gradlew",
"chars": 5080,
"preview": "#!/usr/bin/env bash\n\n##############################################################################\n##\n## Gradle start "
},
{
"path": "gradlew.bat",
"chars": 2314,
"preview": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem "
},
{
"path": "hellocharts-library/AndroidManifest.xml",
"chars": 309,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n package="
},
{
"path": "hellocharts-library/build.gradle",
"chars": 2917,
"preview": "apply plugin: 'com.android.library'\napply plugin: 'maven-publish'\napply from: 'https://raw.github.com/chrisbanes/gradle-"
},
{
"path": "hellocharts-library/gradle.properties",
"chars": 95,
"preview": "POM_NAME=HelloCharts Library for Android\nPOM_ARTIFACT_ID=hellocharts-library\nPOM_PACKAGING=aar\n"
},
{
"path": "hellocharts-library/pom.xml",
"chars": 1969,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2"
},
{
"path": "hellocharts-library/proguard-project.txt",
"chars": 781,
"preview": "# To enable ProGuard in your project, edit project.properties\n# to define the proguard.config property as described in t"
},
{
"path": "hellocharts-library/project.properties",
"chars": 584,
"preview": "# This file is automatically generated by Android Tools.\n# Do not modify this file -- YOUR CHANGES WILL BE ERASED!\n#\n# T"
},
{
"path": "hellocharts-library/res/values/strings.xml",
"chars": 26,
"preview": "<resources>\n\n</resources>\n"
},
{
"path": "hellocharts-library/res/values/styles.xml",
"chars": 26,
"preview": "<resources>\n\n</resources>\n"
},
{
"path": "hellocharts-library/res/values-v11/styles.xml",
"chars": 26,
"preview": "<resources>\n\n</resources>\n"
},
{
"path": "hellocharts-library/res/values-v14/styles.xml",
"chars": 26,
"preview": "<resources>\n\n</resources>\n"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/animation/ChartAnimationListener.java",
"chars": 418,
"preview": "package lecho.lib.hellocharts.animation;\n\nimport java.util.EventListener;\n\n/**\n * Listener used to listen for chart anim"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/animation/ChartDataAnimator.java",
"chars": 358,
"preview": "package lecho.lib.hellocharts.animation;\n\npublic interface ChartDataAnimator {\n\n public static final long DEFAULT_ANI"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/animation/ChartDataAnimatorV14.java",
"chars": 2154,
"preview": "package lecho.lib.hellocharts.animation;\n\nimport android.animation.Animator;\nimport android.animation.Animator.AnimatorL"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/animation/ChartDataAnimatorV8.java",
"chars": 2322,
"preview": "package lecho.lib.hellocharts.animation;\n\nimport android.os.Handler;\nimport android.os.SystemClock;\nimport android.view."
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/animation/ChartViewportAnimator.java",
"chars": 535,
"preview": "package lecho.lib.hellocharts.animation;\n\nimport lecho.lib.hellocharts.model.Viewport;\n\npublic interface ChartViewportAn"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/animation/ChartViewportAnimatorV14.java",
"chars": 3255,
"preview": "package lecho.lib.hellocharts.animation;\n\nimport android.animation.Animator;\nimport android.animation.Animator.AnimatorL"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/animation/ChartViewportAnimatorV8.java",
"chars": 3617,
"preview": "package lecho.lib.hellocharts.animation;\n\nimport android.os.Handler;\nimport android.os.SystemClock;\nimport android.view."
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/animation/DummyChartAnimationListener.java",
"chars": 289,
"preview": "package lecho.lib.hellocharts.animation;\n\npublic class DummyChartAnimationListener implements ChartAnimationListener {\n\n"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/animation/PieChartRotationAnimator.java",
"chars": 385,
"preview": "package lecho.lib.hellocharts.animation;\n\npublic interface PieChartRotationAnimator {\n\n public static final int FAST_"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/animation/PieChartRotationAnimatorV14.java",
"chars": 2632,
"preview": "package lecho.lib.hellocharts.animation;\n\nimport android.animation.Animator;\nimport android.animation.Animator.AnimatorL"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/animation/PieChartRotationAnimatorV8.java",
"chars": 2867,
"preview": "package lecho.lib.hellocharts.animation;\n\nimport android.os.Handler;\nimport android.os.SystemClock;\nimport android.view."
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/computator/ChartComputator.java",
"chars": 13281,
"preview": "package lecho.lib.hellocharts.computator;\n\nimport android.graphics.Point;\nimport android.graphics.PointF;\nimport android"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/computator/PreviewChartComputator.java",
"chars": 1222,
"preview": "package lecho.lib.hellocharts.computator;\n\nimport lecho.lib.hellocharts.model.Viewport;\n\n/**\n * Version of ChartComputat"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/formatter/AxisValueFormatter.java",
"chars": 1118,
"preview": "package lecho.lib.hellocharts.formatter;\n\n\nimport lecho.lib.hellocharts.model.AxisValue;\n\npublic interface AxisValueForm"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/formatter/BubbleChartValueFormatter.java",
"chars": 214,
"preview": "package lecho.lib.hellocharts.formatter;\n\nimport lecho.lib.hellocharts.model.BubbleValue;\n\npublic interface BubbleChartV"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/formatter/ColumnChartValueFormatter.java",
"chars": 221,
"preview": "package lecho.lib.hellocharts.formatter;\n\nimport lecho.lib.hellocharts.model.SubcolumnValue;\n\npublic interface ColumnCha"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/formatter/LineChartValueFormatter.java",
"chars": 211,
"preview": "package lecho.lib.hellocharts.formatter;\n\n\nimport lecho.lib.hellocharts.model.PointValue;\n\npublic interface LineChartVal"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/formatter/PieChartValueFormatter.java",
"chars": 209,
"preview": "package lecho.lib.hellocharts.formatter;\n\nimport lecho.lib.hellocharts.model.SliceValue;\n\npublic interface PieChartValue"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/formatter/SimpleAxisValueFormatter.java",
"chars": 2257,
"preview": "package lecho.lib.hellocharts.formatter;\n\nimport lecho.lib.hellocharts.model.AxisValue;\n\npublic class SimpleAxisValueFor"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/formatter/SimpleBubbleChartValueFormatter.java",
"chars": 1935,
"preview": "package lecho.lib.hellocharts.formatter;\n\nimport lecho.lib.hellocharts.model.BubbleValue;\n\n\npublic class SimpleBubbleCha"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/formatter/SimpleColumnChartValueFormatter.java",
"chars": 1943,
"preview": "package lecho.lib.hellocharts.formatter;\n\nimport lecho.lib.hellocharts.model.SubcolumnValue;\n\npublic class SimpleColumnC"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/formatter/SimpleLineChartValueFormatter.java",
"chars": 1916,
"preview": "package lecho.lib.hellocharts.formatter;\n\nimport lecho.lib.hellocharts.model.PointValue;\n\npublic class SimpleLineChartVa"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/formatter/SimplePieChartValueFormatter.java",
"chars": 1912,
"preview": "package lecho.lib.hellocharts.formatter;\n\nimport lecho.lib.hellocharts.model.SliceValue;\n\n\npublic class SimplePieChartVa"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/formatter/ValueFormatterHelper.java",
"chars": 5610,
"preview": "package lecho.lib.hellocharts.formatter;\n\nimport android.util.Log;\n\nimport java.text.DecimalFormat;\nimport java.text.Num"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/gesture/ChartScroller.java",
"chars": 5134,
"preview": "package lecho.lib.hellocharts.gesture;\n\nimport android.content.Context;\nimport android.graphics.Point;\nimport android.gr"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/gesture/ChartTouchHandler.java",
"chars": 11730,
"preview": "package lecho.lib.hellocharts.gesture;\n\nimport android.content.Context;\nimport android.view.GestureDetector;\nimport andr"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/gesture/ChartZoomer.java",
"chars": 4222,
"preview": "package lecho.lib.hellocharts.gesture;\n\nimport android.content.Context;\nimport android.graphics.PointF;\nimport android.v"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/gesture/ContainerScrollType.java",
"chars": 176,
"preview": "package lecho.lib.hellocharts.gesture;\n\n/**\n * Enum used to inform chart in which type of container it exists.\n */\npubli"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/gesture/PieChartTouchHandler.java",
"chars": 5780,
"preview": "package lecho.lib.hellocharts.gesture;\n\nimport android.content.Context;\nimport android.graphics.RectF;\nimport android.su"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/gesture/PreviewChartTouchHandler.java",
"chars": 1917,
"preview": "package lecho.lib.hellocharts.gesture;\n\nimport android.content.Context;\nimport android.view.GestureDetector;\nimport andr"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/gesture/ZoomType.java",
"chars": 117,
"preview": "package lecho.lib.hellocharts.gesture;\n\npublic enum ZoomType {\n\n HORIZONTAL, VERTICAL, HORIZONTAL_AND_VERTICAL;\n}\n"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/gesture/ZoomerCompat.java",
"chars": 3737,
"preview": "/*\n * Copyright 2013 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\""
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/listener/BubbleChartOnValueSelectListener.java",
"chars": 248,
"preview": "package lecho.lib.hellocharts.listener;\n\n\nimport lecho.lib.hellocharts.model.BubbleValue;\n\npublic interface BubbleChartO"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/listener/ColumnChartOnValueSelectListener.java",
"chars": 274,
"preview": "package lecho.lib.hellocharts.listener;\n\n\nimport lecho.lib.hellocharts.model.SubcolumnValue;\n\npublic interface ColumnCha"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/listener/ComboLineColumnChartOnValueSelectListener.java",
"chars": 424,
"preview": "package lecho.lib.hellocharts.listener;\n\n\nimport lecho.lib.hellocharts.model.PointValue;\nimport lecho.lib.hellocharts.mo"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/listener/DummyBubbleChartOnValueSelectListener.java",
"chars": 342,
"preview": "package lecho.lib.hellocharts.listener;\n\n\nimport lecho.lib.hellocharts.model.BubbleValue;\n\npublic class DummyBubbleChart"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/listener/DummyColumnChartOnValueSelectListener.java",
"chars": 369,
"preview": "package lecho.lib.hellocharts.listener;\n\n\nimport lecho.lib.hellocharts.model.SubcolumnValue;\n\npublic class DummyColumnCh"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/listener/DummyCompoLineColumnChartOnValueSelectListener.java",
"chars": 549,
"preview": "package lecho.lib.hellocharts.listener;\n\n\nimport lecho.lib.hellocharts.model.PointValue;\nimport lecho.lib.hellocharts.mo"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/listener/DummyLineChartOnValueSelectListener.java",
"chars": 350,
"preview": "package lecho.lib.hellocharts.listener;\n\n\nimport lecho.lib.hellocharts.model.PointValue;\n\npublic class DummyLineChartOnV"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/listener/DummyPieChartOnValueSelectListener.java",
"chars": 331,
"preview": "package lecho.lib.hellocharts.listener;\n\n\nimport lecho.lib.hellocharts.model.SliceValue;\n\npublic class DummyPieChartOnVa"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/listener/DummyVieportChangeListener.java",
"chars": 263,
"preview": "package lecho.lib.hellocharts.listener;\n\nimport lecho.lib.hellocharts.model.Viewport;\n\npublic class DummyVieportChangeLi"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/listener/LineChartOnValueSelectListener.java",
"chars": 258,
"preview": "package lecho.lib.hellocharts.listener;\n\n\nimport lecho.lib.hellocharts.model.PointValue;\n\npublic interface LineChartOnVa"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/listener/OnValueDeselectListener.java",
"chars": 311,
"preview": "package lecho.lib.hellocharts.listener;\n\n\npublic interface OnValueDeselectListener {\n\n /**\n * Called only in char"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/listener/PieChartOnValueSelectListener.java",
"chars": 240,
"preview": "package lecho.lib.hellocharts.listener;\n\n\nimport lecho.lib.hellocharts.model.SliceValue;\n\npublic interface PieChartOnVal"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/listener/ViewportChangeListener.java",
"chars": 624,
"preview": "package lecho.lib.hellocharts.listener;\n\nimport lecho.lib.hellocharts.model.Viewport;\n\n/**\n * Use implementations of thi"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/model/AbstractChartData.java",
"chars": 4468,
"preview": "package lecho.lib.hellocharts.model;\n\nimport android.graphics.Color;\nimport android.graphics.Typeface;\n\nimport lecho.lib"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/model/Axis.java",
"chars": 8545,
"preview": "package lecho.lib.hellocharts.model;\n\nimport android.graphics.Color;\nimport android.graphics.Typeface;\n\nimport java.util"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/model/AxisValue.java",
"chars": 1961,
"preview": "package lecho.lib.hellocharts.model;\n\nimport java.util.Arrays;\n\n/**\n * Single axis value, use it to manually set axis la"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/model/BubbleChartData.java",
"chars": 4833,
"preview": "package lecho.lib.hellocharts.model;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport lecho.lib.hellocharts.f"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/model/BubbleValue.java",
"chars": 5802,
"preview": "package lecho.lib.hellocharts.model;\n\nimport java.util.Arrays;\n\nimport lecho.lib.hellocharts.util.ChartUtils;\nimport lec"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/model/ChartData.java",
"chars": 3179,
"preview": "package lecho.lib.hellocharts.model;\n\nimport android.graphics.Typeface;\n\n/**\n * Base interface for all chart data models"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/model/Column.java",
"chars": 3261,
"preview": "package lecho.lib.hellocharts.model;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport lecho.lib.hellocharts.f"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/model/ColumnChartData.java",
"chars": 3636,
"preview": "package lecho.lib.hellocharts.model;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\n/**\n * Data model for column c"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/model/ComboLineColumnChartData.java",
"chars": 2099,
"preview": "package lecho.lib.hellocharts.model;\n\n/**\n * Data model for combo line-column chart. It uses ColumnChartData and LineCha"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/model/Line.java",
"chars": 7967,
"preview": "package lecho.lib.hellocharts.model;\n\nimport android.graphics.PathEffect;\n\nimport java.util.ArrayList;\nimport java.util."
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/model/LineChartData.java",
"chars": 2224,
"preview": "package lecho.lib.hellocharts.model;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\n/**\n * Data model for LineChar"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/model/PieChartData.java",
"chars": 8866,
"preview": "package lecho.lib.hellocharts.model;\n\nimport android.graphics.Color;\nimport android.graphics.Typeface;\n\nimport java.util"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/model/PointValue.java",
"chars": 3262,
"preview": "package lecho.lib.hellocharts.model;\n\nimport java.util.Arrays;\n\nimport lecho.lib.hellocharts.view.Chart;\n\n/**\n * Single "
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/model/SelectedValue.java",
"chars": 3391,
"preview": "package lecho.lib.hellocharts.model;\n\n/**\n * Holds selected values indexes, i.e. for LineChartModel it will be firstInde"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/model/SliceValue.java",
"chars": 4571,
"preview": "package lecho.lib.hellocharts.model;\n\nimport java.util.Arrays;\n\nimport lecho.lib.hellocharts.util.ChartUtils;\nimport lec"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/model/SubcolumnValue.java",
"chars": 3572,
"preview": "package lecho.lib.hellocharts.model;\n\nimport java.util.Arrays;\n\nimport lecho.lib.hellocharts.util.ChartUtils;\nimport lec"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/model/ValueShape.java",
"chars": 93,
"preview": "package lecho.lib.hellocharts.model;\n\npublic enum ValueShape {\n CIRCLE, SQUARE, DIAMOND\n}\n"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/model/Viewport.java",
"chars": 14538,
"preview": "package lecho.lib.hellocharts.model;\n\nimport android.os.Parcel;\nimport android.os.Parcelable;\n\n/**\n * Partial copy of an"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/provider/BubbleChartDataProvider.java",
"chars": 249,
"preview": "package lecho.lib.hellocharts.provider;\n\nimport lecho.lib.hellocharts.model.BubbleChartData;\n\npublic interface BubbleCha"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/provider/ColumnChartDataProvider.java",
"chars": 249,
"preview": "package lecho.lib.hellocharts.provider;\n\nimport lecho.lib.hellocharts.model.ColumnChartData;\n\npublic interface ColumnCha"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/provider/ComboLineColumnChartDataProvider.java",
"chars": 303,
"preview": "package lecho.lib.hellocharts.provider;\n\nimport lecho.lib.hellocharts.model.ComboLineColumnChartData;\n\npublic interface "
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/provider/LineChartDataProvider.java",
"chars": 237,
"preview": "package lecho.lib.hellocharts.provider;\n\nimport lecho.lib.hellocharts.model.LineChartData;\n\npublic interface LineChartDa"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/provider/PieChartDataProvider.java",
"chars": 231,
"preview": "package lecho.lib.hellocharts.provider;\n\nimport lecho.lib.hellocharts.model.PieChartData;\n\npublic interface PieChartData"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/renderer/AbstractChartRenderer.java",
"chars": 5782,
"preview": "package lecho.lib.hellocharts.renderer;\n\nimport android.content.Context;\nimport android.graphics.Canvas;\nimport android."
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/renderer/AxesRenderer.java",
"chars": 28496,
"preview": "package lecho.lib.hellocharts.renderer;\n\nimport android.content.Context;\nimport android.graphics.Canvas;\nimport android."
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/renderer/BubbleChartRenderer.java",
"chars": 13658,
"preview": "package lecho.lib.hellocharts.renderer;\n\nimport android.content.Context;\nimport android.graphics.Canvas;\nimport android."
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/renderer/ChartRenderer.java",
"chars": 1488,
"preview": "package lecho.lib.hellocharts.renderer;\n\nimport android.graphics.Canvas;\n\nimport lecho.lib.hellocharts.model.SelectedVal"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/renderer/ColumnChartRenderer.java",
"chars": 17545,
"preview": "package lecho.lib.hellocharts.renderer;\n\nimport android.content.Context;\nimport android.graphics.Canvas;\nimport android."
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/renderer/ComboChartRenderer.java",
"chars": 2870,
"preview": "package lecho.lib.hellocharts.renderer;\n\nimport android.content.Context;\nimport android.graphics.Canvas;\n\nimport java.ut"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/renderer/ComboLineColumnChartRenderer.java",
"chars": 1874,
"preview": "package lecho.lib.hellocharts.renderer;\n\nimport android.content.Context;\n\nimport lecho.lib.hellocharts.provider.ColumnCh"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/renderer/LineChartRenderer.java",
"chars": 20333,
"preview": "package lecho.lib.hellocharts.renderer;\n\nimport android.content.Context;\nimport android.graphics.Bitmap;\nimport android."
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/renderer/PieChartRenderer.java",
"chars": 20501,
"preview": "package lecho.lib.hellocharts.renderer;\n\nimport android.content.Context;\nimport android.graphics.Bitmap;\nimport android."
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/renderer/PreviewColumnChartRenderer.java",
"chars": 2129,
"preview": "package lecho.lib.hellocharts.renderer;\n\nimport android.content.Context;\nimport android.graphics.Canvas;\nimport android."
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/renderer/PreviewLineChartRenderer.java",
"chars": 2115,
"preview": "package lecho.lib.hellocharts.renderer;\n\nimport android.content.Context;\nimport android.graphics.Canvas;\nimport android."
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/util/AxisAutoValues.java",
"chars": 258,
"preview": "package lecho.lib.hellocharts.util;\n\n/**\n * A simple class representing axis label values used only for auto generated a"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/util/ChartUtils.java",
"chars": 2433,
"preview": "package lecho.lib.hellocharts.util;\n\nimport android.content.Context;\nimport android.graphics.Color;\nimport android.util."
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/util/FloatUtils.java",
"chars": 6894,
"preview": "package lecho.lib.hellocharts.util;\n\npublic class FloatUtils {\n public static final int POW10[] = {1, 10, 100, 1000, "
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/view/AbstractChartView.java",
"chars": 16186,
"preview": "package lecho.lib.hellocharts.view;\n\nimport android.content.Context;\nimport android.graphics.Canvas;\nimport android.os.B"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/view/BubbleChartView.java",
"chars": 3354,
"preview": "package lecho.lib.hellocharts.view;\n\nimport android.content.Context;\nimport android.support.v4.view.ViewCompat;\nimport a"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/view/Chart.java",
"chars": 10052,
"preview": "package lecho.lib.hellocharts.view;\n\nimport lecho.lib.hellocharts.animation.ChartAnimationListener;\nimport lecho.lib.hel"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/view/ColumnChartView.java",
"chars": 2856,
"preview": "package lecho.lib.hellocharts.view;\n\nimport android.content.Context;\nimport android.util.AttributeSet;\nimport android.ut"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/view/ComboLineColumnChartView.java",
"chars": 5807,
"preview": "package lecho.lib.hellocharts.view;\n\nimport android.content.Context;\nimport android.util.AttributeSet;\nimport android.ut"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/view/LineChartView.java",
"chars": 2912,
"preview": "package lecho.lib.hellocharts.view;\n\nimport android.content.Context;\nimport android.util.AttributeSet;\nimport android.ut"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/view/PieChartView.java",
"chars": 6898,
"preview": "package lecho.lib.hellocharts.view;\n\nimport android.content.Context;\nimport android.graphics.RectF;\nimport android.os.Bu"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/view/PreviewColumnChartView.java",
"chars": 2369,
"preview": "package lecho.lib.hellocharts.view;\n\nimport android.content.Context;\nimport android.support.v4.view.ViewCompat;\nimport a"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/view/PreviewLineChartView.java",
"chars": 2350,
"preview": "package lecho.lib.hellocharts.view;\n\nimport android.content.Context;\nimport android.support.v4.view.ViewCompat;\nimport a"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/view/hack/HackyDrawerLayout.java",
"chars": 907,
"preview": "package lecho.lib.hellocharts.view.hack;\n\nimport android.content.Context;\nimport android.support.v4.widget.DrawerLayout;"
},
{
"path": "hellocharts-library/src/lecho/lib/hellocharts/view/hack/HackyViewPager.java",
"chars": 1029,
"preview": "package lecho.lib.hellocharts.view.hack;\n\nimport android.content.Context;\nimport android.support.v4.view.ViewPager;\nimpo"
},
{
"path": "hellocharts-samples/AndroidManifest.xml",
"chars": 2867,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n package="
},
{
"path": "hellocharts-samples/build.gradle",
"chars": 1348,
"preview": "apply plugin: 'com.android.application'\n\ndependencies {\n //compile fileTree(dir: 'libs', include: '*.jar')\n compil"
},
{
"path": "hellocharts-samples/proguard-project.txt",
"chars": 781,
"preview": "# To enable ProGuard in your project, edit project.properties\n# to define the proguard.config property as described in t"
},
{
"path": "hellocharts-samples/project.properties",
"chars": 684,
"preview": "# This file is automatically generated by Android Tools.\n# Do not modify this file -- YOUR CHANGES WILL BE ERASED!\n#\n# T"
},
{
"path": "hellocharts-samples/res/color/selector_text_link.xml",
"chars": 326,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n <item "
},
{
"path": "hellocharts-samples/res/layout/activity_about.xml",
"chars": 338,
"preview": "<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/tool"
},
{
"path": "hellocharts-samples/res/layout/activity_bubble_chart.xml",
"chars": 344,
"preview": "<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/tool"
},
{
"path": "hellocharts-samples/res/layout/activity_column_chart.xml",
"chars": 344,
"preview": "<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/tool"
},
{
"path": "hellocharts-samples/res/layout/activity_combo_line_column_chart.xml",
"chars": 353,
"preview": "<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/tool"
},
{
"path": "hellocharts-samples/res/layout/activity_good_bad.xml",
"chars": 345,
"preview": "<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/tool"
},
{
"path": "hellocharts-samples/res/layout/activity_line_chart.xml",
"chars": 342,
"preview": "<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/tool"
},
{
"path": "hellocharts-samples/res/layout/activity_line_column_dependency.xml",
"chars": 353,
"preview": "<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/tool"
},
{
"path": "hellocharts-samples/res/layout/activity_main.xml",
"chars": 337,
"preview": "<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/tool"
},
{
"path": "hellocharts-samples/res/layout/activity_pie_chart.xml",
"chars": 341,
"preview": "<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/tool"
},
{
"path": "hellocharts-samples/res/layout/activity_preview_column_chart.xml",
"chars": 351,
"preview": "<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/tool"
},
{
"path": "hellocharts-samples/res/layout/activity_preview_line_chart.xml",
"chars": 349,
"preview": "<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/tool"
},
{
"path": "hellocharts-samples/res/layout/activity_tempo_chart.xml",
"chars": 343,
"preview": "<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/tool"
},
{
"path": "hellocharts-samples/res/layout/activity_view_pager_charts.xml",
"chars": 345,
"preview": "<lecho.lib.hellocharts.view.hack.HackyViewPager xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:too"
},
{
"path": "hellocharts-samples/res/layout/fragment_about.xml",
"chars": 3044,
"preview": "<ScrollView xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/tools"
},
{
"path": "hellocharts-samples/res/layout/fragment_bubble_chart.xml",
"chars": 778,
"preview": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/t"
},
{
"path": "hellocharts-samples/res/layout/fragment_column_chart.xml",
"chars": 778,
"preview": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/t"
},
{
"path": "hellocharts-samples/res/layout/fragment_combo_line_column_chart.xml",
"chars": 805,
"preview": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/t"
},
{
"path": "hellocharts-samples/res/layout/fragment_good_bad.xml",
"chars": 769,
"preview": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/t"
},
{
"path": "hellocharts-samples/res/layout/fragment_line_chart.xml",
"chars": 771,
"preview": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/t"
},
{
"path": "hellocharts-samples/res/layout/fragment_line_column_dependency.xml",
"chars": 1323,
"preview": "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/too"
},
{
"path": "hellocharts-samples/res/layout/fragment_main.xml",
"chars": 708,
"preview": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/t"
},
{
"path": "hellocharts-samples/res/layout/fragment_pie_chart.xml",
"chars": 768,
"preview": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/t"
},
{
"path": "hellocharts-samples/res/layout/fragment_preview_column_chart.xml",
"chars": 1338,
"preview": "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/too"
},
{
"path": "hellocharts-samples/res/layout/fragment_preview_line_chart.xml",
"chars": 1330,
"preview": "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/too"
},
{
"path": "hellocharts-samples/res/layout/fragment_tempo_chart.xml",
"chars": 772,
"preview": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/t"
},
{
"path": "hellocharts-samples/res/layout/fragment_view_pager_charts.xml",
"chars": 559,
"preview": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/t"
},
{
"path": "hellocharts-samples/res/layout/list_item_sample.xml",
"chars": 1154,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n an"
},
{
"path": "hellocharts-samples/res/menu/bubble_chart.xml",
"chars": 1802,
"preview": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:app=\"http://schemas.android.com/apk/res-auto\""
},
{
"path": "hellocharts-samples/res/menu/column_chart.xml",
"chars": 2065,
"preview": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:app=\"http://schemas.android.com/apk/res-auto\""
},
{
"path": "hellocharts-samples/res/menu/combo_line_column_chart.xml",
"chars": 1422,
"preview": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:app=\"http://schemas.android.com/apk/res-auto\""
},
{
"path": "hellocharts-samples/res/menu/line_chart.xml",
"chars": 2844,
"preview": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:app=\"http://schemas.android.com/apk/res-auto\""
},
{
"path": "hellocharts-samples/res/menu/main.xml",
"chars": 413,
"preview": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:app=\"http://schemas.android.com/apk/res-auto\""
},
{
"path": "hellocharts-samples/res/menu/pie_chart.xml",
"chars": 1450,
"preview": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:app=\"http://schemas.android.com/apk/res-auto\""
},
{
"path": "hellocharts-samples/res/menu/preview_column_chart.xml",
"chars": 896,
"preview": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:app=\"http://schemas.android.com/apk/res-auto\""
},
{
"path": "hellocharts-samples/res/menu/preview_line_chart.xml",
"chars": 893,
"preview": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:app=\"http://schemas.android.com/apk/res-auto\""
},
{
"path": "hellocharts-samples/res/menu/tempo_chart.xml",
"chars": 570,
"preview": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:app=\"http://schemas.android.com/apk/res-auto\""
},
{
"path": "hellocharts-samples/res/values/colors.xml",
"chars": 307,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n <color name=\"holo_blue\">#33B5E5</color>\n <color name=\"holo_bl"
},
{
"path": "hellocharts-samples/res/values/dimens.xml",
"chars": 316,
"preview": "<resources>\n\n <!-- Default screen margins, per the Android Design guidelines. -->\n <dimen name=\"activity_horizonta"
},
{
"path": "hellocharts-samples/res/values/strings.xml",
"chars": 1596,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n <string name=\"app_name\">HelloCharts</string>\n <string name=\"a"
},
{
"path": "hellocharts-samples/res/values/styles.xml",
"chars": 286,
"preview": "<resources>\n\n <style name=\"AppBaseTheme\" parent=\"Theme.AppCompat.Light\">\n <item name=\"colorPrimary\">@color/hol"
},
{
"path": "hellocharts-samples/res/values-land/dimens.xml",
"chars": 130,
"preview": "<resources>\n\n <dimen name=\"pie_chart_text1_size\">38sp</dimen>\n <dimen name=\"pie_chart_text2_size\">12dp</dimen>\n\n</"
},
{
"path": "hellocharts-samples/res/values-sw600dp/dimens.xml",
"chars": 305,
"preview": "<resources>\n\n <!--\n Customize dimensions originally defined in res/values/dimens.xml (such as\n screen"
},
{
"path": "hellocharts-samples/res/values-v11/styles.xml",
"chars": 26,
"preview": "<resources>\n\n</resources>\n"
},
{
"path": "hellocharts-samples/res/values-v14/styles.xml",
"chars": 25,
"preview": "<resources>\n\n</resources>"
},
{
"path": "hellocharts-samples/res/values-w820dp/dimens.xml",
"chars": 373,
"preview": "<resources>\n\n <!--\n Example customization of dimensions originally defined in res/values/dimens.xml\n "
},
{
"path": "hellocharts-samples/src/lecho/lib/hellocharts/samples/AboutActivity.java",
"chars": 3461,
"preview": "package lecho.lib.hellocharts.samples;\n\nimport android.annotation.SuppressLint;\nimport android.content.Context;\nimport a"
},
{
"path": "hellocharts-samples/src/lecho/lib/hellocharts/samples/BubbleChartActivity.java",
"chars": 8164,
"preview": "package lecho.lib.hellocharts.samples;\n\nimport android.os.Bundle;\nimport android.support.v4.app.Fragment;\nimport android"
},
{
"path": "hellocharts-samples/src/lecho/lib/hellocharts/samples/ColumnChartActivity.java",
"chars": 15760,
"preview": "package lecho.lib.hellocharts.samples;\n\nimport android.os.Bundle;\nimport android.support.v4.app.Fragment;\nimport android"
},
{
"path": "hellocharts-samples/src/lecho/lib/hellocharts/samples/ComboLineColumnChartActivity.java",
"chars": 9677,
"preview": "package lecho.lib.hellocharts.samples;\n\nimport android.os.Bundle;\nimport android.support.v4.app.Fragment;\nimport android"
},
{
"path": "hellocharts-samples/src/lecho/lib/hellocharts/samples/GoodBadChartActivity.java",
"chars": 4540,
"preview": "package lecho.lib.hellocharts.samples;\n\nimport android.os.Bundle;\nimport android.support.v4.app.Fragment;\nimport android"
},
{
"path": "hellocharts-samples/src/lecho/lib/hellocharts/samples/LineChartActivity.java",
"chars": 15263,
"preview": "package lecho.lib.hellocharts.samples;\n\nimport android.os.Bundle;\nimport android.support.v4.app.Fragment;\nimport android"
},
{
"path": "hellocharts-samples/src/lecho/lib/hellocharts/samples/LineColumnDependencyActivity.java",
"chars": 7053,
"preview": "package lecho.lib.hellocharts.samples;\n\nimport android.os.Bundle;\nimport android.support.v4.app.Fragment;\nimport android"
},
{
"path": "hellocharts-samples/src/lecho/lib/hellocharts/samples/MainActivity.java",
"chars": 11464,
"preview": "package lecho.lib.hellocharts.samples;\n\nimport android.content.Context;\nimport android.content.Intent;\nimport android.os"
},
{
"path": "hellocharts-samples/src/lecho/lib/hellocharts/samples/PieChartActivity.java",
"chars": 9251,
"preview": "package lecho.lib.hellocharts.samples;\n\nimport android.graphics.Typeface;\nimport android.os.Bundle;\nimport android.suppo"
},
{
"path": "hellocharts-samples/src/lecho/lib/hellocharts/samples/PreviewColumnChartActivity.java",
"chars": 7257,
"preview": "package lecho.lib.hellocharts.samples;\n\nimport android.os.Bundle;\nimport android.support.v4.app.Fragment;\nimport android"
},
{
"path": "hellocharts-samples/src/lecho/lib/hellocharts/samples/PreviewLineChartActivity.java",
"chars": 6979,
"preview": "package lecho.lib.hellocharts.samples;\n\nimport android.os.Bundle;\nimport android.support.v4.app.Fragment;\nimport android"
},
{
"path": "hellocharts-samples/src/lecho/lib/hellocharts/samples/SpeedChartActivity.java",
"chars": 6068,
"preview": "package lecho.lib.hellocharts.samples;\n\nimport android.graphics.Color;\nimport android.os.Bundle;\nimport android.support."
},
{
"path": "hellocharts-samples/src/lecho/lib/hellocharts/samples/TempoChartActivity.java",
"chars": 7966,
"preview": "package lecho.lib.hellocharts.samples;\n\nimport android.graphics.Color;\nimport android.os.Bundle;\nimport android.support."
},
{
"path": "hellocharts-samples/src/lecho/lib/hellocharts/samples/ViewPagerChartsActivity.java",
"chars": 13281,
"preview": "package lecho.lib.hellocharts.samples;\n\nimport android.os.Bundle;\nimport android.support.v4.app.Fragment;\nimport android"
},
{
"path": "settings.gradle",
"chars": 62,
"preview": "include ':hellocharts-samples'\ninclude ':hellocharts-library'\n"
}
]
// ... and 3 more files (download for full content)
About this extraction
This page contains the full source code of the lecho/hellocharts-android GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 180 files (543.8 KB), approximately 126.2k tokens, and a symbol index with 1310 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.