简体   繁体   English

使用MPAndroidChart库的LineChart问题

[英]LineChart issue using MPAndroidChart library

I am trying to make a simple smooth line chart which show the X axis as date-time on bottom and Y axis as normal left side. 我试图制作一个简单的平滑折线图,它将X轴显示为底部的日期时间,Y轴显示为正常的左侧。 I just started using MPAndroidChart API and its example app in Git. 我刚开始在Git中使用MPAndroidChart API及其示例应用程序。 In the example Line chart I am not able to find option to change X axis labels to show on bottom instead of top as show currently. 在示例折线图中,我无法找到更改X轴标签的选项,以显示在底部而不是当前显示的顶部。

Just like: 就像:

在此输入图像描述

Also is there a way to handle date-time data for X axis values ? 还有办法处理X轴值的日期时间数据吗?

Also I tried my hand on Androidplot API but to make the line smooth there I need to make changes in library code which is not compiling at all in my Eclipse and giving errors. 此外,我尝试使用Androidplot API但是为了使线条平滑,我需要在库代码中进行更改,这在Eclipse中根本没有编译并且给出错误。 Also in Androidplot I did not find an option to show popup with data once I click on line chart. 同样在Androidplot中,我没有找到一个选项,一旦我点击折线图显示弹出数据。

So if anyone know how to make a smooth line chart using Androidplot API without modifying its library code and how to bring small popup with data in Androidplot API please reply. 因此,如果有人知道如何使用Androidplot API制作流畅的折线图而不修改其库代码,以及如何在Androidplot API中带来小数据弹出的数据,请回复。

// XAxis settings
graph.getXAxis().setPosition(XAxis.XAxisPosition.BOTTOM);
graph.getXAxis().setLabelsToSkip(0);

// and
// make the line smooth
graph.getLineData().getDataSets().get(0).lineDataSet.setDrawCubic(true);

Refer this: http://wptrafficanalyzer.in/blog/android-drawing-line-chart-using-achartengine/ 请参阅: http//wptrafficanalyzer.in/blog/android-drawing-line-chart-using-achartengine/

for smooth curve lines please refer this: 对于平滑曲线,请参考:

How to make line with rounded (smooth) corners with AndroidPlot 如何使用AndroidPlot使用圆角(平滑)角线

Hope this may help you. 希望这可以帮到你。

AChartEngine is a charting library for Android applications. AChartEngine是Android应用程序的图表库。 Using AChartEngine library, we can plot various charts like line chart, area chart, pie chart, time chart, bubble chart etc. 使用AChartEngine库,我们可以绘制各种图表,如折线图,面积图,饼图,时间图,气泡图等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM