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
16
votes
4 answers

How to set the x-axis label with MPAndroidChart

I use MPAndroidChart for my app like this: but I can not add tag like that
kemp
  • 201
  • 1
  • 2
  • 5
16
votes
3 answers

Show value when tapped [MPAndroidChart]

I`ve been looking for a way to enable the MPAndroidChart to only display the value(label) of data point when clicked. But It seems that I could not find it online even in the documentation. I used the line chart and what I want is to only display…
Rod_Algonquin
  • 26,074
  • 6
  • 52
  • 63
16
votes
2 answers

MPAndroidChart how to set label color?

got the following code: graph = (LineChart) convertView.findViewById(R.id.graph); graph.getPaint(Chart.PAINT_LEGEND_LABEL).setColor(Color.BLUE); graph.getPaint(Chart.PAINT_YLABEL).setColor(Color.BLUE); …
Fabian
  • 748
  • 2
  • 11
  • 20
15
votes
3 answers

MPAndroidChart fill color gradient

Is it possible with MPAndroidChart (or any other Android chart library) to fill the chart under the draw line with a gradient color? Something like this: set1.setFillColor(getResources().getColor(R.drawable.chart_fill)); then in…
David
  • 2,331
  • 4
  • 29
  • 42
15
votes
1 answer

Implement continuous date-time labels on x-axis of mpandroidchart

We collect data points at various days throughout the year and want to display them in a chart - the x-axis showing the date. Right now we create an array of length 364 each containing the value for the corresponding day. However, we want the x-axis…
Chris
  • 161
  • 5
15
votes
5 answers

How to modify the bar width in MPAndroidChart BarChart?

I am using MPAndroidChart library. I would like modify the size of bar present in bar chart. Could you let us know where to check for modify size of bar in bar chart in mp android chart
Rakesh
  • 14,997
  • 13
  • 42
  • 62
14
votes
1 answer

MPAndroidChart: x axis labels with big text size are cut off

I have used MPAndroidChart to make a LineChart and set the x axis text size to 15. Unfortunately, the x axis labels are cut off at the top due to the big text size: How can I solve this problem?
Paul
  • 848
  • 12
  • 33
14
votes
3 answers

Getting duplicate values at xAxis MPChart

Right Now I am facing this issue. I am getting repeated values in xAxis the first one and the last one.And graph values are not according to the values at respective x-axis values. and the second issue is if I want to display the values not in float…
Mehvish Ali
  • 732
  • 2
  • 10
  • 34
14
votes
4 answers

MPAndroidChart - First and last bars not rendering correctly

In the bar chart I am creating the first and last rows are consistently being cut in half (even if I add additional bars). This also causes the values above the bars to be out of place. I am inflating this within a fragment. The axis are also only…
Matt
  • 1,017
  • 2
  • 11
  • 27
14
votes
1 answer

MPAndroidChart LineChart custom highlight drawable

I'm using MPAndroid Chart library to draw Line Chart in my Android app. The status of graph is like: I want to change it like this: So I want to change MPAnroid Line Chart's points, ts called "Circle Hole" in library. I want to switch this hole…
Metehan Toksoy
  • 1,885
  • 3
  • 22
  • 39
14
votes
3 answers

MPAndroidChart setting chart padding / offset

I'm using the MPAndroidChart for my bar graph and I'm struggling with removing the padding of the graph (see pic below) My approaches regarding this problem…
Asilvia
  • 271
  • 1
  • 3
  • 9
13
votes
3 answers

MPAndroidChart: How to set x axis labels at fixed interval

I am displaying realtime chart which should display values as per second. My X axis is time in second. But I am not able to display fixed time interval in x axis ie. 0,1,2,... so on. X axis value is automatically calculated and time interval between…
sanjay
  • 626
  • 1
  • 7
  • 12
13
votes
3 answers

MPAndroidChart chart padding

I can't seem to enable padding on the horizontal BarChart in MPAndroidChart... Like on the screenshot below..the word commentary is cut off..even on tablets, both orientations e.t.c
Bmbariah
  • 687
  • 2
  • 10
  • 22
13
votes
3 answers

MPAndroidChart is not updating

I have a hashmap like this LinkedHashMap hash = new LinkedHashMap<>(); hash.put("2015-05-03", 100); hash.put("2015-05-04", 110); hash.put("2015-05-05", 90); hash.put("2015-05-06", 40); I want to design a LineChart via…
Ali Hasanzade
  • 299
  • 1
  • 3
  • 15
13
votes
5 answers

How to remove padding from horizontal barchart of mpandroidchart?

I am trying to make a horizontal barchart that covers the entire parent layout but its not. Below is my code - HorizontalBarChart barchart = new HorizontalBarChart(activity); barchart.setLayoutParams(new LinearLayout.LayoutParams(0, 110,…
Agr1909
  • 385
  • 1
  • 5
  • 17