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
8
votes
2 answers

Pie Chart Alignment issue using MPAndroidChart

In my application am using piechart. Using the following library api 'com.github.PhilJay:MPAndroidChart:v3.0.3'. But am facing an issue the alignment problem.Attaching the screenshots,Please have a look on it: Code: public static void…
Sunisha Guptan
  • 1,555
  • 17
  • 44
8
votes
1 answer

How to set two decimal point into Bar Entry in Mp android Bar Chart in Android

How to set J SON data in bar entry in two decimal point?
Anand Gaur
  • 225
  • 2
  • 10
8
votes
4 answers

Add padding on first and last label on x-axis in MPAndroidChart

I am using a Scatter Chart (MPAndroidChart library) and it looks like below presently. Everything works well so far except for the values on the first and last label (Su and S) wherein the circles are cut off. Is there a way to add padding so that…
Abhishek Sabbarwal
  • 3,758
  • 1
  • 26
  • 41
8
votes
2 answers

How to remove or hide MarkerView in MPAndroidChart?

I did a bar chart with MPAndroidChart. I did a custom marker view class to view the values of the bar. I would remove or hide the view after some seconds. It should work as a toast. But I cannot do it. This is a problem first of all because after I…
Grancein
  • 642
  • 10
  • 19
8
votes
2 answers

Android - Fill the color between two lines using MPAndroidChart

I am using setFillFormatter, but it's not helping me and, setfillColor() crosses the second line(black) as there is no way to stop the first line(Yellow) at Y values of the second line. I want to implement something like…
Amit
  • 3,422
  • 3
  • 28
  • 39
8
votes
2 answers

MPAndroidChart: How to reverse the order of a HorizontalBarChart?

Just hoping someone here could explain how to reverse the order of the HorizontalBarChart which is shown in the screenshot of MPAndroidChart (so instead of 44.0 being at the top it'd be at the bottom). The code below shows how I create the…
Mark O'Sullivan
  • 10,138
  • 6
  • 39
  • 60
8
votes
5 answers

MPAndroidChart PieChart how to set label text?

got the following code: Legend legend = mChart.getLegend(); legend.setLabels(new String[]{"aaaaa", "bbbbb", "ccccc"}); This setting does not take effect Is there an other way to set the text ?
Fomovet
  • 313
  • 1
  • 5
  • 15
8
votes
3 answers

How to not draw zero values on a linechart while showing their X axis values on MPAndroidChart?

I'm using MPAndroidChart to display my data in a line graph. For each date I have its own value. This works just fine. What I want to do now is to not draw the 0 values, but instead draw the line between 2 adjacent non-zero values (like a…
limlim
  • 3,115
  • 2
  • 34
  • 46
8
votes
1 answer

MPAndroidChart: Can I set different colours for the x-axis labels?

So I want to be able to select a bar in my bar chart, and when I select a bar, it changes the colour of the bar (which I know how to do), but also change the colour of the corresponding x-axis label. Is there a way to do this, if so, can someone…
rohan
  • 523
  • 1
  • 5
  • 22
8
votes
2 answers

Timeseries chart in MPAndroidChart

To do: Plot time series line chart using the library, where x-axis time-stamps are not equidistant. Sample Data: 1467886121: 325 1467886153: 326 1467886185: 325 1467886248: 326 1467886280: 326 1467886311: 326 1467886343: 327 1467886375: …
8
votes
2 answers

MPAndroidChart: How to customise bar value labels

I am using MPAndroidChart in my Android app. I use a BarChart composed of BarEntry. I also enabled the y-values to be displayed on top of the bar. My issue is that I want the values on top of the bars to be whole numbers like 5. But currently the…
Mandroid
  • 6,200
  • 12
  • 64
  • 134
8
votes
0 answers

scrollable legend mpandroidchart piechart

I have implemented a piechart with help of the mpandroid library: as you can see everything works fine... but I have a small problem with my pie chart legend on the right side. The highness of the page is to small. The legend is not displayed…
nano_nano
  • 12,351
  • 8
  • 55
  • 83
8
votes
2 answers

MPAndroidChart MarkerView

I have intention on looking for a specific point in a line chart of MPAndroidChart and then display the the marker to highlight the point after a button is hit. The example given is where the marker is only displayed after touching event which is…
Han Whiteking
  • 184
  • 2
  • 13
8
votes
2 answers

How can I make my HorizontalBarChart scrollable?

Currently trying to implement a HorizontalBarChart using MPAndroidChart. However, there are too many bars and they won't all fit on the screen. HorizontalBarChart will scroll only if I zoom in, but will never go past what was already on the screen.…
squeegene
  • 467
  • 1
  • 5
  • 18
8
votes
1 answer

MPAndroidChart how to set x-axis to the bottom of the chart?

I have downloaded the MPAndroidChart library to draw a LineChart, i have noticed that this LineChart always draw the xAxis on top of yAxis, me i need to draw xAxis on bottom of yAxis this is how i initialize the chart mChart = (LineChart)…
Amalo
  • 772
  • 3
  • 13
  • 32