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
0
votes
1 answer

BarChart must not be null in MPAndroidChart

Background: I am trying to display bar chart based on the Fragments clicked, I have two fragments and one activity in my test project. I am using MPAndroidBarchart and kotlin is used for this test project. Library used is…
0
votes
2 answers

MPAndroidChart Set month value on X axis and draw line under graph

I am trying to set a value on X axis as month but the y value are not corresponding to x value that I am trying to set. private void CreateGraph() { float[] yDataL = {30, 60, 500,231}; String[] xDataL = {"Jan", "Feb" , "Mac" , "Apr"}; …
0
votes
1 answer

MPAndroid chart in ConstraintLayout with additional widgets (they are not visible)

I am trying to add PieChart from MPAndroidChart and seekBar under it. But still no luck, chart is visible, but other content is noT visible, despite it visible when I open design tab during xml configuration. I already have tried to set a barrier…
Andrew
  • 591
  • 2
  • 12
  • 33
0
votes
1 answer

MPAndroidChart: constant position of Y-axis lines independent of data

I'm using MPAndroid chart to display a line chart. The chart is updated with different data and of course, when the data changes, the y-axis lines and the zoom level is changed because of the different sets of input data. Is there any way to…
adriennoir
  • 1,329
  • 1
  • 15
  • 29
0
votes
1 answer

show big numbers (double value) in pie chart using MpAndroidChart

I'm using a pie chart in my activity. When I set a big value into the entries, it doesn't show the value correctly. For example: My value is 627050000 but the chart shows is 627049986, or my value is 477470000 but the chart shows is…
Hamid
  • 51
  • 7
0
votes
1 answer

MPAndroidChart setData Multiline

I want to set my Bar-Data with two lines. It's not possible to do it with \n. I use MPAndroidChart Version v2.2.4. I tried it with this code: Bar1 = new BarEntry(20f,0,"20"+"\n"+"2"); Bar2 = new BarEntry(80f,1,"80"+"\n"+"8"); Bar3 = new…
Maho42
  • 1
  • 1
0
votes
2 answers

bar line mpandroid chart

I have a chart and use mpandroidchart the shape is as shown below how can my line be neat and not too sideways?
Lely Suju
  • 71
  • 2
  • 12
0
votes
1 answer

MPAndroidChart Pie Chart Custom Legends are not displaying correctly

I have create piechart using MpAndroidChart and data is retrieved from firebase.I need to display custom legends but only one item is displaying but pieChart has more than 5items.Since getColor() and getLabels() are deprecated and i have used this…
0
votes
2 answers

MPAndroidChart - getChartBitmap not showing line chart

I'm trying to generate and share the image of a chart built with MPAndroidChart. I'm using a ShareIntent and this is the onCreateOptionsMenu method: public boolean onCreateOptionsMenu(Menu menu) { // Inflate menu resource file …
Michele
  • 326
  • 8
  • 18
0
votes
1 answer

Grouped Stacked Bar Chart using MpChart

I have implemented BarChart and my Bar Chart is Grouped and Stacked. I am done with Grouping and Stacking BarChart using MpChart Library in Android. But I am unable to find a way of giving a different color to each bar and each stack. Currently, I…
Developine
  • 12,483
  • 8
  • 38
  • 42
0
votes
2 answers

Context Not Available within Fragment .onStart() Method

I am using MPAndroidCharts within a Fragment, and it is allowing me to generate the necessary tables that I want to display. Part of the MPAndroidCharts library requires the following to initialize the charts, I have this code within my Fragment…
tccpg288
  • 3,242
  • 5
  • 35
  • 80
0
votes
1 answer

Xamarin.Android MPAndroidChart Barchart : bars are not aligned correctly on x-axis labels

i am using MPAndroidChart barchart ... every thing is okay except the x-axis... my bars are not aligned properly on labels. when i zoome the chart then bars come on its labels but that zoom is not what i wanted and also when i zooming the labels…
Rouzbeh Zarandi
  • 1,047
  • 2
  • 16
  • 34
0
votes
1 answer

MPAndroidChart - Setting a fixed interval on X axis for a time value

I am trying to display a time on my X axis with a fixed interval. Currently the X axis is not behaving like I want it to. I'm trying to have an interval of 5 minutes. When I zoom in my points are at the right timestamp.
0
votes
2 answers

mpAndroidChart: Xaxis.setPosition to Bottom_Inside not working on HorizontalBarChart

I have a HorizontalBarChart with mpAndroidChart and I am having problems to display the labels on the left side, but within the graph. It looks like this: the labels are chopped of on the left side. This is done via the…
Apfelsaft23
  • 316
  • 2
  • 23
0
votes
1 answer

Fit chart bounds to data on change

I have an app that displays line chart data, and each line can be hidden or shown. How can I reset the chart boundaries when a line is hidden / shown? This is the code I'm using to hide each line: let lineIndex = sender.checkedValue! as! Int …
Peter S
  • 827
  • 1
  • 8
  • 24