Skip to content
This repository was archived by the owner on Oct 9, 2022. It is now read-only.

Commit 13dc644

Browse files
Bug fixes, add donut chart, add names and colors and other improvements.
1 parent c2d5fd4 commit 13dc644

File tree

88 files changed

+1368
-890
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+1368
-890
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. iOS]
28+
- Browser [e.g. chrome, safari]
29+
- Version [e.g. 22]
30+
31+
**Smartphone (please complete the following information):**
32+
- Device: [e.g. iPhone6]
33+
- OS: [e.g. iOS8.1]
34+
- Browser [e.g. stock browser, safari]
35+
- Version [e.g. 22]
36+
37+
**Additional context**
38+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
| Q | A
2+
| ------------------ | ---
3+
| Bug fix? | no
4+
| New feature? | no
5+
| BC breaks? | no
6+
| Deprecations? | no
7+
| Fixed tickets | fixes #issuenum
8+
| Related issues/PRs | #issuenum
9+
| License | MIT
10+
11+
#### What's in this PR?
12+
13+
Explain the contents of the PR.
14+
15+
#### Why?
16+
17+
Which problem does the PR fix?
18+
19+
#### Example Usage
20+
21+
```php
22+
$foo = new Foo();
23+
24+
// Now we can do
25+
$foo->doSomething();
26+
27+
// Remove this section if not needed
28+
~~~
29+
30+
#### BC Breaks/Deprecations
31+
32+
Describe BC breaks/deprecations here (Remove this section if not needed).
33+
34+
#### To Do
35+
36+
- [ ] Create tests

.gitignore

Lines changed: 7 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,8 @@
1-
# Built application files
2-
*.apk
3-
*.ap_
4-
5-
# Files for the ART/Dalvik VM
6-
*.dex
7-
8-
# Java class files
9-
*.class
10-
11-
# Generated files
12-
bin/
13-
gen/
14-
out/
15-
16-
# Gradle files
17-
.gradle/
18-
build/
19-
20-
# Local configuration file (sdk path, etc)
21-
local.properties
22-
23-
# Proguard folder generated by Eclipse
24-
proguard/
25-
26-
# Log Files
27-
*.log
28-
29-
# Android Studio Navigation editor temp files
30-
.navigation/
31-
32-
# Android Studio captures folder
33-
captures/
34-
35-
# Intellij
361
*.iml
37-
.idea/
38-
39-
# Keystore files
40-
*.jks
41-
*.pro
2+
.gradle
3+
/local.properties
4+
.DS_Store
5+
/build
6+
/captures
7+
.externalNativeBuild
8+
.idea

.travis.yml

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,15 @@ jdk: oraclejdk8
33
# Use the Travis Container-Based Infrastructure
44
sudo: false
55

6-
cache:
7-
directories:
8-
- ${TRAVIS_BUILD_DIR}/gradle/caches/
9-
- ${TRAVIS_BUILD_DIR}/gradle/wrapper/dists/
10-
11-
env:
12-
global:
13-
- ANDROID_API_LEVEL=25
14-
- ANDROID_BUILD_TOOLS_VERSION=25.0.1
15-
166
android:
177
components:
18-
- tools # to get the new `repository-11.xml`
19-
- platform-tools
20-
- tools # to install Android SDK tools 25.1.x
21-
- build-tools-$ANDROID_BUILD_TOOLS_VERSION
22-
- android-$ANDROID_API_LEVEL
23-
# For Google APIs
24-
- addon-google_apis-google-$ANDROID_API_LEVEL
25-
# Google Play Services
26-
- extra-google-google_play_services
27-
# Support library
28-
- extra-android-support
29-
# Latest artifacts in local repository
30-
- extra-google-m2repository
31-
- extra-android-m2repository
8+
- build-tools-28.0.3
9+
- android-28
10+
- extra-android-m2repository
11+
- extra-google-m2repository
12+
- extra-google-google_play_services
13+
licenses:
14+
- 'android-sdk-license-.+'
3215

3316
script:
34-
- ./gradlew connectedAndroidTest coveralls
17+
- ./gradlew clean assembleDebug -x library:signArchives -PdisablePreDex

README.md

Lines changed: 84 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,106 @@
1-
# Google Maps Android 3D Pie Chart - Bar Chart Marker Clustering Java.
1+
# Google Maps Chart for Android
22

3-
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Google%20Maps%20Android%203D%20Pie%20Chart-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/5748)
4-
[![Build Status](https://travis-ci.org/aminyazdanpanah/google-maps-3D-pie-chart-marker-clustering-java.svg?branch=master)](https://travis-ci.org/aminyazdanpanah/google-maps-3D-pie-chart-marker-clustering-java)
5-
[![API](https://img.shields.io/badge/API-15%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=15)
6-
[![](https://jitpack.io/v/aminyazdanpanah/google-maps-3D-pie-chart-marker-clustering-java.svg)](https://jitpack.io/#aminyazdanpanah/google-maps-3D-pie-chart-marker-clustering-java)
7-
[![codebeat badge](https://codebeat.co/badges/96e44347-d1d9-41d1-9a3b-8651a810895f)](https://codebeat.co/projects/github-com-aminyazdanpanah-google-maps-3d-pie-chart-marker-clustering-java-master)
8-
[![Known Vulnerabilities](https://snyk.io/test/github/aminyazdanpanah/google-maps-3d-pie-chart-marker-clustering-java/badge.svg)](https://snyk.io/test/github/aminyazdanpanah/google-maps-3d-pie-chart-marker-clustering-java)
9-
[![BCH compliance](https://bettercodehub.com/edge/badge/aminyazdanpanah/google-maps-3D-pie-chart-marker-clustering-java?branch=master)](https://bettercodehub.com/)
10-
[![Build Status](https://www.bitrise.io/app/2038295db52acff7/status.svg?token=H9fw_ujGCmzsXbNICx1D3A&branch=master)](https://www.bitrise.io/app/2038295db52acff7)
3+
[![Build Status](https://travis-ci.org/aminyazdanpanah/google-maps-android-charts.svg?branch=master)](https://travis-ci.org/aminyazdanpanah/google-maps-android-charts)
114

12-
This open-source library for marker clustering that has a beautiful 3D Pie chart and also bar chart for clustering which can useful for statistical regions.
5+
A Google Maps Android library to render marker clusters as charts categorized on map with specified values.
6+
Available Charts: [Pie Chart](#pie-chart), [Bar Chart](#bar-chart) and [Donut Chart](#donut-chart)
137

8+
![Demo](/docs/demo.gif?raw=true "Demo")
149

15-
- **Display 3D pie chart for clustering**
16-
- **Display Bar chart for clustering**
10+
## Installation
1711

18-
![Demo](/doc/demo.gif?raw=true "Demo")
12+
1. Make sure you have JCenter in your repository list:
13+
```groovy
14+
repositories {
15+
jcenter()
16+
}
17+
```
18+
2. Add a dependency to your build.gradle:
19+
```groovy
20+
dependencies {
21+
compile ''
22+
}
23+
```
1924

25+
## Usage
2026

21-
### Usage
27+
This library is a wrapper around "[Google Maps Android API utility library](https://github.com/googlemaps/android-maps-utils)". So you need to implement `com.google.maps.android:android-maps-utils:0.5+` and `com.google.android.gms:play-services-maps:16.1.0` in your build dependencies.
2228

23-
First add jitpack to your projects build.gradle file
29+
Before using this library, please read the "[Google Maps Android API utility library documentation](https://developers.google.com/maps/documentation/android-sdk/utility/)" .
30+
31+
### Marker
32+
33+
Firstly, you need to generate markers that have a name.
34+
You must initialize `CMaker` class that is implemented `ClusterItem` and pass the LarLng, the name of marker and the drawable Id. Also you can set the title and snippet of marker.
35+
36+
```java
37+
38+
CMarker marker = new CMarker(new LatLng(), "Somthing", 12355468);
39+
marker.setTitle("somthing");
2440

25-
```gradle
26-
allprojects {
27-
repositories {
28-
...
29-
maven { url "https://jitpack.io" }
30-
}
31-
}
3241
```
42+
### Chart
3343

34-
Then add the dependency in modules build.gradle file
44+
This library uses the the name to calculate the values of charts. In face, the number of each slice of chart is sum of names.
45+
Also you must set the names of markers and the colors you would like to render. The length of names array must be the same as length of colors array.
46+
```java
47+
48+
String[] markerIcon = {"red", "green", "blue", "yellow"};
49+
int[] colors = {Color.RED, Color.GREEN, Color.BLUE, Color.YELLOW};
3550

36-
```gradle
37-
dependencies {
38-
compile 'com.github.aminyazdanpanah:google-maps-3D-pie-chart-marker-clustering-java:v1.2'
39-
}
4051
```
52+
#### Pie Chart
4153

42-
## Installing Demo
43-
Before build the demo, you should get an [API key][API] and replace it in [AndroidManifest.xml][manifest].
54+
```java
55+
PieChartRenderer chart = new PieChartRenderer(getApplicationContext(), googleMap, clusterManager);
56+
chart.colors(colors);
57+
chart.names(names);
58+
```
4459

45-
# Developed By
60+
#### Bar Chart
4661

47-
* [Amin Yazdanpanah](https://www.linkedin.com/in/aminyazdanpanah/)
4862

63+
```java
64+
BarChartRenderer chart = new BarChartRenderer(getApplicationContext(), googleMap, clusterManager);
65+
chart.colors(colors);
66+
chart.names(names);
67+
```
4968

50-
# License
69+
#### Donut Chart
5170

52-
Copyright 2017 Amin Yazdanpanah
71+
72+
```java
73+
DonutChartRenderer chart = new DonutChartRenderer(getApplicationContext(), googleMap, clusterManager);
74+
chart.colors(colors);
75+
chart.names(names);
76+
```
77+
78+
At the end, you must pass `chart` object to `setRenderer` method in `ClusterManager` class:
79+
80+
```java
81+
clusterManager.setRenderer(chart);
82+
```
83+
84+
## Contributing
85+
86+
I'd love your help in improving, correcting, adding to the specification.
87+
Please [file an issue](https://github.com/aminyazdanpanah/google-maps-android-charts/issues)
88+
or [submit a pull request](https://github.com/aminyazdanpanah/google-maps-android-charts/pulls).
89+
90+
Please see [Contributing File](https://github.com/aminyazdanpanah/google-maps-android-charts/blob/master/CONTRIBUTING.md) for more information.
91+
92+
## Security
93+
94+
If you discover a security vulnerability within this package, please send an e-mail to Amin Yazdanpanah via:
95+
contact [AT] aminyazdanpanah • com.
96+
97+
## Credits
98+
99+
- [Amin Yazdanpanah](http://www.aminyazdanpanah.com/?u=github.com/aminyazdanpanah/google-maps-android-charts)
100+
101+
## License
102+
103+
Copyright 2019 Amin Yazdanpanah<www.aminyazdanpanah.com>
53104

54105
Licensed under the Apache License, Version 2.0 (the "License");
55106
you may not use this file except in compliance with the License.
@@ -64,8 +115,3 @@ Before build the demo, you should get an [API key][API] and replace it in [Andro
64115
limitations under the License.
65116

66117

67-
For more information, check out [my website][my-website].
68-
69-
[my-website]: http://www.aminyazdanpanah.com
70-
[manifest]: https://github.com/aminyazdanpanah/google-maps-3D-pie-chart-marker-clustering-java/blob/master/demo/src/main/AndroidManifest.xml#L39
71-
[API]:https://developers.google.com/maps/documentation/android-api/signup

build.gradle

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,23 @@
22

33
buildscript {
44
repositories {
5+
google()
56
jcenter()
7+
68
}
79
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.3.2'
9-
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.4.0'
10+
classpath 'com.android.tools.build:gradle:3.3.0'
11+
1012
// NOTE: Do not place your application dependencies here; they belong
1113
// in the individual module build.gradle files
1214
}
1315
}
1416

1517
allprojects {
1618
repositories {
19+
google()
1720
jcenter()
21+
1822
}
1923
}
2024

0 commit comments

Comments
 (0)