Questions tagged [mpandroidchart]

MPAndroidChart is a powerful open-source Android chart view / graph view library. Use this tag if your question is specific to this library.

MPAndroidChart (https://github.com/PhilJay/MPAndroidChart) is a powerful open-source Android chart view / graph view library, supporting line- bar- pie- radar- bubble- and candlestick charts as well as scaling, dragging and animations.

Core features:

  • LineChart, BarChart (vertical & horizontal), PieChart, ScatterChart, CandleStickChart, RadarChart (spider web chart), BubbleChart
  • Scaling on both axes (with touch-gesture, axes separately or pinch-zoom)
  • Dragging / Panning (with touch-gesture)
  • Separate (dual) y-axes
  • Highlighting values (with customizeable popup-views)
  • Save chart to SD-Card (as image)
  • Predefined color templates
  • Legends (generated automatically, customizeable)
  • Customizeable Axes (both x- and y-axis)
  • Animations (build up animations, on both x- and y-axis)
  • Limit lines (providing additional information, maximums, ...)
  • Fully customizeable (paints, typefaces, legends, colors, background, gestures, dashed lines, ...)
  • Available as .jar file
  • Available as gradle dependency and via maven: Usage
  • Detailed documentation
  • Example Project (code for demo-application)
  • Google-PlayStore Demo Application
1939 questions
10
votes
1 answer

How can I reduce the time that MPAndroidChart spend to show data?

I have an application in which I have a BarChart and a CombinedChart but they spend 1-1.5 seconds until they show the chart with the data. I retrieve data from a database with Volley doing a request to get the data but I would like that the time…
Francisco Romero
  • 12,787
  • 22
  • 92
  • 167
10
votes
1 answer

How to hide value labels in MPAndroidChart

How to remove the label in aBarChart. I have attached screenshot with what I want to remove marked in red. How do I remove that number? Here is screenshot: BarDataSet dataset = new BarDataSet(entries, ""); BarData…
Shadow
  • 6,864
  • 6
  • 44
  • 93
10
votes
3 answers

MPAndroidChart BarChart horizontal / vertical

I am using the MPAndroidChart library. In BarChart by-default all the bars are vertical (bottom-up), how to display it in horizontally?
Kishan Vaghela
  • 7,678
  • 5
  • 42
  • 67
10
votes
1 answer

mpandroidchart - animate y-value change in barchart

When calling animateY on a barChart the entire chart is redrawn, animating the bars from y-zero to y-new. barChart.invalidate(); barChart.animateY(1000); Is it possible to restrict the animation to the value change. Thus allowing the user to see…
Thomas Kremmel
  • 14,575
  • 26
  • 108
  • 177
9
votes
1 answer

How to make a CombinedChart have two different scales on MPAndroidChart?

I have a CombinedChart and I would like that LineChart will take left axis as reference and BarChart will take right axis as reference but I could not get it out. I am trying the following…
Francisco Romero
  • 12,787
  • 22
  • 92
  • 167
9
votes
2 answers

Custom position for bar values

I'm using the MPAndroidChart library to create bar charts. We can use the following to show the bar values on top of the bar. mChart.setDrawValueAboveBar(false); or we can use this : barDataSet.setDrawValues(true); to show the bar values inside…
sauvik
  • 2,224
  • 1
  • 17
  • 25
9
votes
4 answers

How to add x axis as datetime label in MPAndroidChart?

I implemented line chart (MPAndroidChart library) for temperature report in my project.In X axis datetime should be plotted and Y axis temperature should be plotted. I just added datetime as string in X axis label but it's collapsed. So please…
Shanmugapriyan M
  • 189
  • 1
  • 2
  • 12
9
votes
4 answers

MarkerView is not showing up using MPAndroidChart

I am using MPandroidchart for showing line charts in my application.I have added following code to show Marker View, but it isn't showing on private void initializeChart(LineChart chart, String chartName) { // Chart view …
musica
  • 1,373
  • 3
  • 15
  • 34
9
votes
1 answer

Disable click on chart

I am using multiple mpandroidchart in a scrollview with a linearlayout. The thing is is i want to disable any kind of horizontal/verical scrolling in the charts because that causes problem when i'm scrolling down to next chart. I've tried setting…
div
  • 1,475
  • 3
  • 22
  • 32
9
votes
4 answers

MPAndroidChart, how to remove decimal percentages and not show percentages below 10?

I am using MPAndroidChart and I have two questions: MPAndroid Pie Chart Remove decimal percentages Not show values on the Pie Chart that have values less than 10%, but show the slice; just the text should not be shown for the percentages less than…
abhishek
  • 259
  • 4
  • 11
9
votes
1 answer

Scrollable BarChart with possibility to touch each bar using MpAndroidChart?

I'm trying to create a chart in my app using MPAndroidChart. My aim is to get a graph looking like this one: But with some specific features. The graph will be wider than the screen's width so it must have a minimum width and be scrollable ( for…
Virthuss
  • 3,142
  • 1
  • 21
  • 39
9
votes
1 answer

Android Stacked Bars Chart

I'm using the MPAndroidChart library, trying to customize the Stacked Bars. The objective is to display the differences between 2 currencies. So suppose this example for January. Currency #1 = 8; Currency #2 = 12 The idea is to show in the same bar…
psabbate
  • 767
  • 1
  • 5
  • 22
9
votes
2 answers

XAxis label angle in MPAndroidChart

I am using MPAndroidChart library for my project. Is it possible to rotate the labels of the XAxis by 270 degrees so that I can fit more text?
Kyaw
  • 117
  • 1
  • 7
9
votes
3 answers

Plot Multiple Charts in one in MPAndroidChart

I have to plot two different dataSets in a single graph. DataSet-1 String[] xAxisOne = new String[] { "0", "1", "2", "3", "4", "5", "6" }; float[] dataInput = { 1f, 2f, 3f, 4f, 5f, 6f, 7f }; DataSet-2 …
VenomVendor
  • 15,064
  • 13
  • 65
  • 96
8
votes
1 answer

MPAndroidChart - MarkerView doesn't show shadow

My app shows a line chart and a custom MarkerView. One problem with the MarkerView is that the shadow doesn't work. The same code works in activity's layout. But, if I copy it to the MarkerView's layout, the shadow doesn't show when I run the…
Jia Li
  • 488
  • 2
  • 8