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
5 answers

Adding Axis Titles to mpandroidchart

I am trying to add axis titles to the bar chart created using mpandroid chart library. I am using more than one fragments in my activity and the bar chart is a fragment. I am adding data dynamically and everything is working fine. I want to add…
Sriram Thiagarajan
  • 200
  • 1
  • 1
  • 8
8
votes
1 answer

MPAndroidChart PieChart is not displayed when used inside ScrollView

I want to show a PieChart in my fragment. Following is the xml I have written,
Shruti Dasgopal
  • 551
  • 4
  • 10
8
votes
3 answers

MPAndroidChart - Remove top border / axis since v2

I upgraded MPAndroidChart from v1.7 to v2 and had to change a couple things. One of the new things is that i now appear to have a top border for the maximum value. My code trying to hide all borders is like this: LineChart graph = (LineChart)…
James Cameron
  • 1,681
  • 25
  • 40
8
votes
1 answer

MPAndroidChart: Hide 0 value labels in a stacked bar chart

I am using MPAndroidChart to show a stacked bar chart containing two sets of data (Income and Expenditure). I'm having an issue when the value is 0 the label overlap other x axis values. In the case of the screenshot you can see that the bars which…
RunLoop
  • 20,288
  • 21
  • 96
  • 151
8
votes
2 answers

Draw vertical line in the middle of a line chart (indicator)

I am using a chart library called MPAndroidChart and I am very pleased with it. However, I want to draw a thick vertical line (as a background, not as data) serving as an indicator in the the middle of the line graph. How can I do this? Best…
Moonlit
  • 5,171
  • 14
  • 57
  • 95
8
votes
4 answers

How to change chart background with MPAndroidChart library?

I'm using the amazing library MPAndroidChart. It works like a charm, except when I'm trying to change the background color of the BarData. Default color is white, and I want to change it to Transparent. I've tried this : Paint p1 =…
Phil
  • 4,730
  • 1
  • 41
  • 39
7
votes
0 answers

MPAndroidChart (PieChart) not showing highlighted Slice for Rounded corners

I am trying to create a chart like below, For my android application using MPAndroidChart(PieChart). I was unable to figure out, how to make the Piechart's edges as round edged. then I saw pieChart.setDrawRoundedSlices(true) this line of code…
Atif AbbAsi
  • 5,633
  • 7
  • 26
  • 47
7
votes
1 answer

How to customize pie chart using MPAndroidChart in Android?

What I have done: I'm using the MPAndroidChart and I was able to customize it to my requirement and tried further functionalities to remove Description Label, and to increase the font and customize the legend. What I have is now ; …
Sachz
  • 391
  • 5
  • 21
7
votes
1 answer

How to manage multiple markerview on same x,y values

I used MPChart android library in my project and it was fulfilling my requirements but now in new enhancements in my project, I'm facing some issues. How can I use markerview with direction arrow (Means if there is no space on the left side then…
Jitesh Prajapati
  • 2,533
  • 4
  • 29
  • 51
7
votes
2 answers

Android MP Pie Chart how to remove text and values from Pie chart

How can i achieve this using MPAndroidChart ? Using version : com.github.PhilJay:MPAndroidChart:v3.1.0-alpha Adding code for Legend and piechart margin: private void setPieChartData() { //https://stackoverflow.com/a/50551488/1427037 …
Erum
  • 790
  • 3
  • 14
  • 36
7
votes
1 answer

MPAndroidChart - Linechart - shrink part of the graph with no X values

Is it possible to do something like this: ? I have in the app LineChart with the time values (seconds) on X axis and temperature on Y axis. And it's possible that I don't have a data for some bigger time interval (day and more for example) and it…
Pepa Zapletal
  • 2,879
  • 3
  • 39
  • 69
7
votes
2 answers

How to programmatically detect when an item is visible in a RecyclerView?

My Android app has a RecyclerView with PagerSnapHelper. Each item has width and height as match_parent. Thus, only 1 view item stays on the page. I am interested in knowing when a particular view item is fully visible to the user. I want to perform…
mumayank
  • 1,670
  • 2
  • 21
  • 34
7
votes
0 answers

Android stacked column and linechart with MPAndroidChart doesnt center

I have tried the following. Am using the MP android charts specifically the combined chart // draw bars behind lines mChart.setDrawOrder(new CombinedChart.DrawOrder[]{ CombinedChart.DrawOrder.BAR, …
Geoff
  • 6,277
  • 23
  • 87
  • 197
7
votes
1 answer

MPAndroidChart - all pieces of the pie chart are the same colour

I am using MPAndroidChart (https://github.com/PhilJay/MPAndroidChart) library to generate pie chart. I followed multiple tutorials including the wiki page, but when I create my pie chart all of the pieces are the same color. Any idea how can I solve…
Matt D.
  • 175
  • 1
  • 9
7
votes
2 answers

Android mp android chart set type face for XAxisLeft

I have a line chart using the library MPAndroidChart mChart.setData(data); mChart.getAxisLeft().setTypeface(MyApplication.giloryItaly); mChart.invalidate(); …
Amalo
  • 772
  • 3
  • 13
  • 32