我想在我的应用程序中制作折线图。在X轴上我将显示类别和Y轴我将显示百分比,对于我想要显示折线图的特定学生。查看图片。请帮助我
注意:如果学生A获得10%的体育项目,20%的教育费用和10%的额外费用,那么任何人都可以帮助我
答案 0 :(得分:0)
您可以使用EazeGraph,只需将其添加到您的依赖项中,并且您在github wiki页面上有很多代码示例;)
对于折线图:XML:
<org.eazegraph.lib.charts.ValueLineChart
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/cubiclinechart"
android:layout_width="match_parent"
android:layout_height="200dp"
app:egUseCubic="true"
app:egUseOverlapFill="true"
app:egCurveSmoothness="0.4"
app:egIndicatorLineColor="#FE6DA8"
app:egLegendHeight="40dp"
app:egShowStandardValue="true"/>´
爪哇:
ValueLineChart mCubicValueLineChart = (ValueLineChart)
findViewById(R.id.cubiclinechart);
ValueLineSeries series = new ValueLineSeries();
series.setColor(0xFF56B7F1);
series.addPoint(new ValueLinePoint("Jan", 2.4f));
series.addPoint(new ValueLinePoint("Feb", 3.4f));
series.addPoint(new ValueLinePoint("Mar", .4f));
series.addPoint(new ValueLinePoint("Apr", 1.2f));
series.addPoint(new ValueLinePoint("Mai", 2.6f));
mCubicValueLineChart.addSeries(series);
mCubicValueLineChart.startAnimation();