PhilJay/MPAndroidChart
A powerful π Android chart view / graph view library, supporting line- bar- pie- radar- bubble- and candlestick charts as well as scaling, panning and animations.
Slowing β last commit 11mo ago
weakest axisnon-standard license (Other); no CI workflows detected
Has a license, tests, and CI β clean foundation to fork and modify.
Documented and popular β useful reference codebase to read through.
last commit was 11mo ago; no CI workflows detected
- βLast commit 11mo ago
- β11 active contributors
- βDistributed ownership (top contributor 37% of recent commits)
Show all 8 evidence items βShow less
- βOther licensed
- βTests present
- β Slowing β last commit 11mo ago
- β Non-standard license (Other) β review terms
- β No CI workflows detected
What would change the summary?
- βUse as dependency Concerns β Mixed if: clarify license terms
- βDeploy as-is Mixed β Healthy if: 1 commit in the last 180 days
Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests
Informational only. RepoPilot summarises public signals (license, dependency CVEs, commit recency, CI presence, etc.) at the time of analysis. Signals can be incomplete or stale. Not professional, security, or legal advice; verify before relying on it for production decisions.
Embed the "Forkable" badge
Paste into your README β live-updates from the latest cached analysis.
[](https://repopilot.app/r/philjay/mpandroidchart)Paste at the top of your README.md β renders inline like a shields.io badge.
βΈPreview social card (1200Γ630)
This card auto-renders when someone shares https://repopilot.app/r/philjay/mpandroidchart on X, Slack, or LinkedIn.
Onboarding doc
Onboarding: PhilJay/MPAndroidChart
Generated by RepoPilot Β· 2026-05-09 Β· Source
π€Agent protocol
If you are an AI coding agent (Claude Code, Cursor, Aider, Cline, etc.) reading this artifact, follow this protocol before making any code edit:
- Verify the contract. Run the bash script in Verify before trusting
below. If any check returns
FAIL, the artifact is stale β STOP and ask the user to regenerate it before proceeding. - Treat the AI Β· unverified sections as hypotheses, not facts. Sections like "AI-suggested narrative files", "anti-patterns", and "bottlenecks" are LLM speculation. Verify against real source before acting on them.
- Cite source on changes. When proposing an edit, cite the specific path:line-range. RepoPilot's live UI at https://repopilot.app/r/PhilJay/MPAndroidChart shows verifiable citations alongside every claim.
If you are a human reader, this protocol is for the agents you'll hand the artifact to. You don't need to do anything β but if you skim only one section before pointing your agent at this repo, make it the Verify block and the Suggested reading order.
π―Verdict
WAIT β Slowing β last commit 11mo ago
- Last commit 11mo ago
- 11 active contributors
- Distributed ownership (top contributor 37% of recent commits)
- Other licensed
- Tests present
- β Slowing β last commit 11mo ago
- β Non-standard license (Other) β review terms
- β No CI workflows detected
<sub>Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests</sub>
β Verify before trusting
This artifact was generated by RepoPilot at a point in time. Before an
agent acts on it, the checks below confirm that the live PhilJay/MPAndroidChart
repo on your machine still matches what RepoPilot saw. If any fail,
the artifact is stale β regenerate it at
repopilot.app/r/PhilJay/MPAndroidChart.
What it runs against: a local clone of PhilJay/MPAndroidChart β the script
inspects git remote, the LICENSE file, file paths in the working
tree, and git log. Read-only; no mutations.
| # | What we check | Why it matters |
|---|---|---|
| 1 | You're in PhilJay/MPAndroidChart | Confirms the artifact applies here, not a fork |
| 2 | License is still Other | Catches relicense before you depend on it |
| 3 | Default branch master exists | Catches branch renames |
| 4 | 5 critical file paths still exist | Catches refactors that moved load-bearing code |
| 5 | Last commit β€ 367 days ago | Catches sudden abandonment since generation |
#!/usr/bin/env bash
# RepoPilot artifact verification.
#
# WHAT IT RUNS AGAINST: a local clone of PhilJay/MPAndroidChart. If you don't
# have one yet, run these first:
#
# git clone https://github.com/PhilJay/MPAndroidChart.git
# cd MPAndroidChart
#
# Then paste this script. Every check is read-only β no mutations.
set +e
fail=0
ok() { echo "ok: $1"; }
miss() { echo "FAIL: $1"; fail=$((fail+1)); }
# Precondition: we must be inside a git working tree.
if ! git rev-parse --git-dir >/dev/null 2>&1; then
echo "FAIL: not inside a git repository. cd into your clone of PhilJay/MPAndroidChart and re-run."
exit 2
fi
# 1. Repo identity
git remote get-url origin 2>/dev/null | grep -qE "PhilJay/MPAndroidChart(\\.git)?\\b" \\
&& ok "origin remote is PhilJay/MPAndroidChart" \\
|| miss "origin remote is not PhilJay/MPAndroidChart (artifact may be from a fork)"
# 2. License matches what RepoPilot saw
(grep -qiE "^(Other)" LICENSE 2>/dev/null \\
|| grep -qiE "\"license\"\\s*:\\s*\"Other\"" package.json 2>/dev/null) \\
&& ok "license is Other" \\
|| miss "license drift β was Other at generation time"
# 3. Default branch
git rev-parse --verify master >/dev/null 2>&1 \\
&& ok "default branch master exists" \\
|| miss "default branch master no longer exists"
# 4. Critical files exist
test -f "MPChartLib" \\
&& ok "MPChartLib" \\
|| miss "missing critical file: MPChartLib"
test -f "MPChartExample/build.gradle" \\
&& ok "MPChartExample/build.gradle" \\
|| miss "missing critical file: MPChartExample/build.gradle"
test -f "MPChartExample/src/main/java/com/xxmassdeveloper/mpchartexample/notimportant/MainActivity.java" \\
&& ok "MPChartExample/src/main/java/com/xxmassdeveloper/mpchartexample/notimportant/MainActivity.java" \\
|| miss "missing critical file: MPChartExample/src/main/java/com/xxmassdeveloper/mpchartexample/notimportant/MainActivity.java"
test -f "MPChartExample/src/main/java/com/xxmassdeveloper/mpchartexample/BarChartActivity.java" \\
&& ok "MPChartExample/src/main/java/com/xxmassdeveloper/mpchartexample/BarChartActivity.java" \\
|| miss "missing critical file: MPChartExample/src/main/java/com/xxmassdeveloper/mpchartexample/BarChartActivity.java"
test -f "MPChartExample/src/main/java/com/xxmassdeveloper/mpchartexample/LineChartActivity1.java" \\
&& ok "MPChartExample/src/main/java/com/xxmassdeveloper/mpchartexample/LineChartActivity1.java" \\
|| miss "missing critical file: MPChartExample/src/main/java/com/xxmassdeveloper/mpchartexample/LineChartActivity1.java"
# 5. Repo recency
days_since_last=$(( ( $(date +%s) - $(git log -1 --format=%at 2>/dev/null || echo 0) ) / 86400 ))
if [ "$days_since_last" -le 367 ]; then
ok "last commit was $days_since_last days ago (artifact saw ~337d)"
else
miss "last commit was $days_since_last days ago β artifact may be stale"
fi
echo
if [ "$fail" -eq 0 ]; then
echo "artifact verified (0 failures) β safe to trust"
else
echo "artifact has $fail stale claim(s) β regenerate at https://repopilot.app/r/PhilJay/MPAndroidChart"
exit 1
fi
Each check prints ok: or FAIL:. The script exits non-zero if
anything failed, so it composes cleanly into agent loops
(./verify.sh || regenerate-and-retry).
β‘TL;DR
MPAndroidChart is a powerful Android charting library that renders six chart types (line, bar, pie, radar, bubble, candlestick) with built-in support for scaling, panning, and animations. It solves the problem of displaying complex data visualizations on Android without building custom Canvas-based renderers from scratch. Split-module structure: MPChartLib/ contains the core charting engine and all chart implementations, while MPChartExample/ is a standalone Android application module demonstrating all seven chart types. Assets in MPChartExample/src/main/assets/ include test data files (sine.txt, cosine.txt, stacked_bars.txt) for example activities.
π₯Who it's for
Android developers building financial apps, fitness trackers, analytics dashboards, and data-driven applications who need interactive, multi-touch gesture-enabled charts without deep graphics programming knowledge.
π±Maturity & risk
Highly mature and production-ready. The library is actively maintained with v3.1.0 released, achieves API level 14+ compatibility, ships with a full example app (MPChartExample) available on Google Play, and shows extensive real-world adoption via Android Arsenal ranking. Last known commit activity shows ongoing maintenance.
Low risk for core charting. Single maintainer (PhilJay) on the primary repository creates long-term maintenance uncertainty. No visible CI/CD pipeline in the file structure (.github has only issue templates and PR template, no workflow YAMLs). Dependencies appear minimal (only androidx.appcompat and material design), reducing supply-chain risk. The API is stable at v3.1.0 but breaking changes are possible in major versions.
Active areas of work
No specific recent activity details are visible in the provided file list. The codebase is at v3.1.0. Contribution guidelines exist (CONTRIBUTING.md) and issue templates are configured (Bug_report.md, Feature_request.md, Support_help.md) indicating active community management.
πGet running
git clone https://github.com/PhilJay/MPAndroidChart.git && cd MPAndroidChart && ./gradlew build && ./gradlew :MPChartExample:assembleDebug
Daily commands: Load the project in Android Studio, select MPChartExample as the run configuration (defined in .idea/runConfigurations/MPChartExample.xml), and deploy to an emulator or connected device via Gradle: ./gradlew :MPChartExample:installDebug
πΊοΈMap of the codebase
MPChartLibβ Root library module containing all chart rendering engines, data structures, and core visualization logicMPChartExample/build.gradleβ Example app build configuration that demonstrates how to integrate MPChartLib as a dependencyMPChartExample/src/main/java/com/xxmassdeveloper/mpchartexample/notimportant/MainActivity.javaβ Entry point demonstrating how to initialize and navigate between different chart type examplesMPChartExample/src/main/java/com/xxmassdeveloper/mpchartexample/BarChartActivity.javaβ Reference implementation showing data binding, configuration, and interaction patterns for bar chartsMPChartExample/src/main/java/com/xxmassdeveloper/mpchartexample/LineChartActivity1.javaβ Reference implementation demonstrating line chart setup, styling, and animation configurationMPChartExample/src/main/java/com/xxmassdeveloper/mpchartexample/PieChartActivity.javaβ Reference implementation for pie chart initialization, value formatting, and touch interactionMPChartExample/src/main/AndroidManifest.xmlβ Android manifest declaring all activities and permissions required by example application
π οΈHow to make changes
Add a New Chart Type Example Activity
- Create new Activity class extending AppCompatActivity in MPChartExample/src/main/java/com/xxmassdeveloper/mpchartexample/ (
MPChartExample/src/main/java/com/xxmassdeveloper/mpchartexample/NewChartActivity.java) - Inflate chart view in onCreate() and configure with data: mChart = findViewById(R.id.chart); mChart.setData(generateChartData()); (
MPChartExample/src/main/java/com/xxmassdeveloper/mpchartexample/NewChartActivity.java) - Create corresponding layout XML file in res/layout/ with chart view component (
MPChartExample/src/main/res/layout/activity_new_chart.xml) - Add activity intent declaration to AndroidManifest.xml under <application> (
MPChartExample/src/main/AndroidManifest.xml) - Add ContentItem entry in MainActivity.java to make example discoverable in navigation menu (
MPChartExample/src/main/java/com/xxmassdeveloper/mpchartexample/notimportant/MainActivity.java)
Add Custom Value Formatter for Chart Labels
- Create new class extending ValueFormatter in MPChartExample/src/main/java/com/xxmassdeveloper/mpchartexample/custom/ (
MPChartExample/src/main/java/com/xxmassdeveloper/mpchartexample/custom/CustomFormatter.java) - Override getFormattedValue(float value, Entry entry, int dataSetIndex, ViewPortHandler handler) method with custom formatting logic (
MPChartExample/src/main/java/com/xxmassdeveloper/mpchartexample/custom/CustomFormatter.java) - Apply formatter to chart in activity: chart.getXAxis().setValueFormatter(new CustomFormatter()); (
MPChartExample/src/main/java/com/xxmassdeveloper/mpchartexample/BarChartActivity.java)
Add Custom Marker View for Touch Interactions
- Create new class extending MarkerView in MPChartExample/src/main/java/com/xxmassdeveloper/mpchartexample/custom/ (
MPChartExample/src/main/java/com/xxmassdeveloper/mpchartexample/custom/CustomMarkerView.java) - Override refreshContent(Entry e, Highlight h) to update marker display with entry data (
MPChartExample/src/main/java/com/xxmassdeveloper/mpchartexample/custom/CustomMarkerView.java) - Create marker layout XML in res/layout/ with TextViews for data display (
MPChartExample/src/main/res/layout/custom_marker_layout.xml) - Instantiate and attach to chart in activity: chart.setMarker(new CustomMarkerView(context, R.layout.custom_marker_layout)); (
MPChartExample/src/main/java/com/xxmassdeveloper/mpchartexample/BarChartActivity.java)
Create Chart as Reusable ListView Item
- Create new class extending ChartItem in MPChartExample/src/main/java/com/xxmassdeveloper/mpchartexample/listviewitems/ (
MPChartExample/src/main/java/com/xxmassdeveloper/mpchartexample/listviewitems/CustomChartItem.java) - Override getView(int position, View convertView, ViewGroup parent) to inflate chart layout and bind data (
MPChartExample/src/main/java/com/xxmassdeveloper/mpchartexample/listviewitems/CustomChartItem.java) - Create item layout XML in res/layout/ with chart view component (
MPChartExample/src/main/res/layout/list_item_chart.xml) - Add CustomChartItem instances to list in activity: chartItems.add(new CustomChartItem(context, getChartData())); (
MPChartExample/src/main/java/com/xxmassdeveloper/mpchartexample/ListViewBarChartActivity.java)
π§Why these technologies
- Android Canvas API β Provides native, high-performance 2D graphics rendering for charts without external dependencies
- Custom View (extends View) β Enables full control over drawing pipeline, touch handling, and animations for interactive visualizations
- Android Animation Framework β Smooth property animations for chart entry transitions and axis scaling effects
- ValueFormatter/AxisValueFormatter interfaces β undefined
πͺ€Traps & gotchas
No external service dependencies or complex environment setup required. Key constraints: minSdkVersion is 16 (older APIs), compileSdkVersion 28 may require manual updates for newer Android projects. Chart rendering is Canvas-based and runs on the main threadβlarge datasets (1000+ entries per series) can cause jank without proper data aggregation. No built-in ProGuard rules are provided despite minifyEnabled: false being set, so custom obfuscation rules may be needed for production builds.
ποΈArchitecture
π‘Concepts to learn
- Canvas-based Custom View Rendering β All charts in this library draw directly to Android Canvas; understanding onDraw() lifecycle, Paint objects, and coordinate transformations is essential for modifying chart appearance or adding new chart types
- Gesture Detection & Multi-touch Handling β Charts support pinch-to-zoom and drag-to-pan via GestureDetector and ScaleGestureDetector; understanding these Android APIs is needed to extend or customize gesture behavior
- Property Animation & ValueAnimator β The custom Animator.java class interpolates chart values over time using frame-based updates; knowledge of Android animation concepts helps optimize animation performance
- Viewport Transformation & Matrix Math β Charts transform data coordinates (0-1000 on Y-axis) to screen pixels via viewport calculations and matrix transformations; this is critical for zoom/pan and accurate data positioning
- Data Binding Pattern β Charts update their visual state when underlying DataSet objects change; understanding this observer-like pattern prevents missed updates and stale rendered data
- Anti-aliasing & Paint Rasterization β Line charts use anti-aliased strokes and Bezier curves for smooth rendering; tuning Paint flags affects visual quality and CPU rendering cost
- Marker Positioning & Hit Detection β Charts detect tap/touch events on data points to show markers (popup values); this requires reverse-mapping screen coordinates back to data coordinates
πRelated repos
danielgindi/Chartsβ Official iOS port of MPAndroidChart; same API surface for cross-platform chart implementationsAnyChart/AnyChart-Androidβ Alternative Android charting library supporting similar chart types with different architecture (may be useful for feature comparisons)WayneD/StockChart-MPAndroidChartβ Community extension of MPAndroidChart specifically for financial/stock data with candlestick enhancementsandroid/architecture-samplesβ Google's reference Android app architecture; useful for understanding modern Android patterns when extending MPChartExample
πͺPR ideas
To work on one of these in Claude Code or Cursor, paste:
Implement the "<title>" PR idea from CLAUDE.md, working through the checklist as the task list.
Add comprehensive unit tests for MPChartLib core components
The repo has extensive example activities in MPChartExample but no visible test directory structure for MPChartLib itself. Core chart classes (BarChart, LineChart, PieChart, etc.) lack unit test coverage. This is critical for a charting library where visual accuracy and data integrity are paramount. New contributors can add foundational tests for data entry validation, chart calculations, and rendering logic.
- [ ] Create MPChartLib/src/test/java directory structure
- [ ] Add unit tests for Entry and ChartData classes to validate data structure integrity
- [ ] Add tests for AxisBase and XAxis/YAxis classes for axis calculations and formatting
- [ ] Add tests for chart type-specific data handling (BarDataSet, LineDataSet, PieDataSet)
- [ ] Set up JUnit/Mockito test framework in MPChartLib/build.gradle
Add GitHub Actions CI workflow for automated testing and builds
The repo has CI template structure (.github/ISSUE_TEMPLATE/) but no .github/workflows/ directory for GitHub Actions. The project uses Gradle and has minSdkVersion 16 with compileSdkVersion 28, making automated builds and test execution essential for maintaining compatibility. This prevents regression and validates contributions across different configurations.
- [ ] Create .github/workflows/android-build.yml for automated Gradle builds on PR/push
- [ ] Add build matrix testing for minSdkVersion 16 and compileSdkVersion 28 compatibility
- [ ] Configure workflow to run unit tests (once tests are added per PR #1)
- [ ] Add lint checks using Android Lint in the workflow
- [ ] Add status badge to README.md referencing the workflow
Add missing API documentation for public chart customization APIs
MPChartExample demonstrates 25+ chart types and activities but there's no comprehensive API reference documenting chart styling, data formatting, and configuration options. Key classes lack JavaDoc for public methods (e.g., chart legend configuration, marker customization, axis value formatting). Contributors can document the public API surface that users most commonly need.
- [ ] Add JavaDoc to ChartBase class for core configuration methods (getDescription(), setData(), etc.)
- [ ] Document Legend class public methods (setPosition(), setXOffset(), setYOffset(), etc.) with usage examples
- [ ] Document IAxisValueFormatter and IValueFormatter interfaces with code examples in javadoc
- [ ] Add JavaDoc for chart-specific styling classes (BarDataSet, LineDataSet, PieDataSet) for color/style customization
- [ ] Create JAVADOC.md in repo root linking to generated documentation and highlighting commonly-used APIs
πΏGood first issues
- Add unit tests for the animation framework (Animator.java) which currently has no visible test coverage in the file structure; start in a new MPChartLib/src/test directory following Android conventions
- Create a CI/CD workflow file (.github/workflows/android.yml) to run gradlew build and :MPChartExample:assembleDebug on every PR, improving reliability signaling
- Write a 'Performance optimization guide' document explaining dataset aggregation techniques for >1000 entry datasets, since the library's Canvas rendering can stutter without this knowledge
βTop contributors
Click to expand
Top contributors
- @danielgindi β 37 commits
- @PhilJay β 31 commits
- @almic β 19 commits
- @oatrice β 3 commits
- @RobertZagorski β 3 commits
πRecent commits
Click to expand
Recent commits
9c7275aβ Merge pull request #5456 from UrielFrankel/master (danielgindi)3aa0209β Make MPAndroidChart compatible with Android Studio Iguana (2024) (UrielFrankel)0550d3fβ Update README.md (PhilJay)9ba46d8β Update README.md (PhilJay)5a732b0β Update README.md (PhilJay)696ebd0β Update README.md (PhilJay)8c92fcdβ Merge pull request #5011 from danielgindi/fix/value_formatter (danielgindi)bc0be2cβ Revert: e5b66192 - bring back polymorphism to value formatters (danielgindi)8e4dccfβ Update LICENSE (PhilJay)423fc67β Update README.md (PhilJay)
πSecurity observations
The codebase has significant security concerns primarily related to outdated dependencies and build configurations. The most critical issues are the use of Android SDK 28 from 2018 (missing years of security patches), disabled code obfuscation in release builds, and very old minimum SDK version support (API 16 from 2012). These allow for easier reverse engineering and limit access to modern security APIs. Immediate action is required to update the build target, enable minification, and upgrade all dependencies to current versions. The example application serves as a reference implementation, so these security gaps should be addressed before using this library in production applications.
- High Β· Outdated Android SDK and Dependencies β
MPChartExample/build.gradle. The project targets compileSdkVersion 28 and uses androidx dependencies from 2019 (appcompat:1.0.2, material:1.0.0). These versions are significantly outdated and likely contain known security vulnerabilities. Android SDK 28 was released in 2018 and is missing years of security patches. Fix: Update compileSdkVersion to at least 33-34, targetSdkVersion to 34, and update androidx dependencies to latest stable versions (appcompat:1.6.x, material:1.10.x). Review and update all transitive dependencies. - High Β· Disabled Code Obfuscation in Release Builds β
MPChartExample/build.gradle. The release build configuration has minifyEnabled set to false. This means the APK is not obfuscated, making reverse engineering significantly easier. The included ProGuard rules file appears to be unused. Fix: Set minifyEnabled to true in release builds. Ensure proper ProGuard/R8 configuration is in place to obfuscate and shrink code. Test thoroughly to ensure functionality is preserved after minification. - Medium Β· Low Minimum SDK Version β
MPChartExample/build.gradle. The minSdkVersion is set to 16, which corresponds to Android 4.1 (released in 2012). Supporting such old Android versions exposes the application to numerous known vulnerabilities and prevents use of modern security APIs and best practices. Fix: Increase minSdkVersion to at least 21 (Android 5.0) or higher. This allows use of modern security APIs and reduces the attack surface. Consider targeting minSdkVersion 24+ for better security posture. - Medium Β· Potentially Unsafe Asset Files β
MPChartExample/src/main/assets/. The assets directory contains multiple data files (sine.txt, cosine.txt, etc.) with no apparent validation mechanism visible in the file structure. If these are parsed without proper input validation, they could be vulnerable to denial-of-service or injection attacks. Fix: Implement proper input validation and bounds checking for all asset file parsing. Consider using secure parsing libraries. Validate file sizes and content before processing. - Low Β· Missing Security-Relevant Build Configuration β
MPChartExample/build.gradle and AndroidManifest.xml. The build configuration does not show explicit security settings such as network security configuration, certificate pinning setup, or cleartext traffic restrictions for modern Android versions. Fix: Create a network_security_config.xml file to restrict cleartext traffic, implement certificate pinning for API calls if applicable, and configure appropriate security policies in AndroidManifest.xml.
LLM-derived; treat as a starting point, not a security audit.
πWhere to read next
- Open issues β current backlog
- Recent PRs β what's actively shipping
- Source on GitHub
Generated by RepoPilot. Verdict based on maintenance signals β see the live page for receipts. Re-run on a new commit to refresh.