{"id":844,"date":"2019-12-23T22:45:22","date_gmt":"2019-12-23T12:45:22","guid":{"rendered":"https:\/\/learntodroid.com\/?p=844"},"modified":"2021-01-13T09:45:37","modified_gmt":"2021-01-12T23:45:37","slug":"how-to-display-a-bar-chart-in-your-android-app","status":"publish","type":"post","link":"http:\/\/10.0.0.14:32769\/how-to-display-a-bar-chart-in-your-android-app\/","title":{"rendered":"How to Display a Bar Chart in Your Android App"},"content":{"rendered":"\n
Bar charts are most useful for showing a comparison between different groups of numerical data or to track changes to numerical data over time.<\/p>\n\n\n\n
MPAndroidChart<\/a> is the leading open source free to use native charting library for Android that supports many different chart types including line charts<\/a>, bar charts, combined line and bar charts, pie charts, scatter plots, candlestick charts, bubble charts and others.<\/p>\n\n\n\n To display a bar chart in your Android app you will need to follow these steps.<\/p>\n\n\n\n Later in this article I will take you through a detailed step by step guide to create different types of bar charts in your Android app using the MPAndroidChart.<\/p>\n\n\n\n We will cover using MPAndroidChart to create a simple vertical bar chart, a horizontal bar chart, a group bar chart and a stacked bar chart.<\/p>\n\n\n\n All the code samples shared in this post are available in the BarChartExamples GitHub repository<\/a> I have created.<\/p>\n\n\n <\/p>\n <\/p>\n\n\n In this section, I will provide a detailed step by step guide on how to use the MPAndroidChart charting library to create a vertical bar chart in your Android app that looks like the screenshot taken from the Android emulator below.<\/p>\n\n\n\nHow to Create a Vertical Bar Chart in Android<\/h2>\n\n\n\n