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

MPAndroidChart how to add info views to the axises?

I use MPAndroidChart and i trying add info views (Oct 23 /1,250) to top and to end to the highLight lines as on the picture. I can add a marker but only one to the center (cross circle) but i don't how to add views to the lines. Does any one know…
DanMan
  • 692
  • 9
  • 22
0
votes
2 answers

Intersection point for two series/ line charts in graph

I want to mark points of intersection of two lines in x-y plane on a graph.. Using GraphView in my app, I have plotted 2 series in following manner: GraphView graph = (GraphView)…
Sandeep Yohans
  • 929
  • 1
  • 14
  • 36
0
votes
1 answer

MPAndroidChart: Customise graduation steps on Y axis

I have create a simple MPAndroidChart Line Chart with values from 0 to 5. yAxis.setAxisMinimum(0.0f); yAxis.setAxisMaximum(5.0f); I have added my values (0 for every point in my example) And I also have set the formatter just to display the…
Waza_Be
  • 39,407
  • 49
  • 186
  • 260
0
votes
1 answer

How do I adjust what percentage of the graph is being used?

I'm going to apologize if this has already been asked, but I'm struggling to think of how to google this question: I'm currently using a LineChart to display data as it is received. I want to show at most 360 points on the graph. (6 minutes, of…
0
votes
1 answer

how to change Bar color in MPandroidCharts based on some individual value stored in sqlite?

If have an SQLite which stores 3 values names,credits,bunks. I have an mpandroid bar chart with x-axis:names,y-axis:bunks. I want to change the individual bar color or add limitline based on their credits for each entry,stored in SQLite. Is this…
0
votes
1 answer

Strange behavior with MPAndroidChart ValueFormatter on XAxis

I have the following code: xAxis.setValueFormatter(new IAxisValueFormatter() { @Override public String getFormattedValue(float value, AxisBase axis) { int intValue = (int) value; int xVal = intValue / 120 / 12; if (xVal…
Pink Jazz
  • 784
  • 4
  • 13
  • 34
0
votes
0 answers

MPAndroid charting library, position of labels is getting messed up

I am trying to put labels on a grouped bar chart, using the MPAndroid charting library, but am facing problems for quite some time now. I am using axis.setValueFormatter() function to set my labels. Here is my setValueFormatter function: public…
rexGibbs
  • 1
  • 4
0
votes
0 answers

MPAndroid charting library, having problems setting labels via setValueFormatter

I am trying to plot a bar chart , and want to set labels on the bar chart. But the label for the last entry is not showing. Below is how I set my graph. The machines arraylist contains the labels, which I copy into my string array mac[]. …
rexGibbs
  • 1
  • 4
0
votes
0 answers

How to make the CombinedChart-BarChart average distributed on the x-axis?

I use MpAndroidChart-CombinedChart in my project,but I met a problem,please look the follow screenshot. As you saw,the X axis right part didn't filled.In other words,I want set the bar space,but I can't. I try barData.setBarWidth(0.4f),it didn't…
Jsonzsl
  • 13
  • 6
0
votes
1 answer

How can i set color in PieChart of MPAndroidChart

I try to set color in PieChart of MPAndroidChart.But its not set it.I want to add custom color in my partition . Here is my code :- fun setupPieChartView() { mPie = findViewById(R.id.piechart) mPie?.setUsePercentValues(true) val desc:…
user9998479
0
votes
1 answer

setLabelCount(), Causing labels to mess up. MPandroid Charting Library

I am using MPAdroid to plot a Bar chart with grouped bars and labels in front of them. But the result I am getting is shown in the scrot below The upper chart is chart1 and bottom one is chart2. Now the real order of the labels should have been…
Kushagr Tyagi
  • 101
  • 2
  • 12
0
votes
1 answer

MPAndroidChart keeps throwing null error

I'm just trying this library out to see if it fits my needs and so far I have not been able to get it to work. Here is the code package com.example.user.bottomnavigationbar; import android.content.DialogInterface; import…
Ziv Ofir
  • 103
  • 1
  • 12
0
votes
1 answer

How to make a mpandroidchart horizontol-chart draw from right to left

I use MPAndroidChart in my project, today I meet a problem,please look the screenshot. enter image description here I know how to implement the left diagram,but I don't know the right how to implement.
Jsonzsl
  • 13
  • 6
0
votes
1 answer

How do I create an ArrayList of Y-axis values for a LineGraph in Kotlin using MPChartsLirary?

I am trying to add values to a dataset in the Y-Axis but I don't seem to understand how to do that. I want to add two values, a float and an integer. Below is my code, it works when it was in Java but when I translated to Kotlin, it stopped to…
Bruno Jay
  • 1
  • 2
0
votes
3 answers

MPAndroidChart pie chart in cardview is draw small

I'm using MPAndroidChart library to draw a half pie chart in a RecyclerView. this is my item layout:
Sharas
  • 1,985
  • 3
  • 20
  • 43