gpt4 book ai didi

java - 带有来自 Volley 的 json 数据的 MPAndroid 图表

转载 作者:行者123 更新时间:2023-11-30 10:10:33 24 4
gpt4 key购买 nike

我正在使用 MPAndroid Chart,我正在按照此处的教程进行操作 Android Bar & Radar Chart using Volley MSQL PHP JSON

但是,我遇到了这个错误

enter image description here

我该如何解决这个 TIA。

我正在使用 MPAndroidChart 3.0.3

最佳答案

Your solution is here

因为MPchart不能通过String来设置他的描述。

Description description = new Description();
description.setText("Add Your string here");
chart.setDescription(description);

You can set BarData like below code :

BarDataSet set1;
set1 = new BarDataSet(xValue, "");
set1.setDrawIcons(true);
set1.setStackLabels(new String[]{"Male", "Female"});
set1.setDrawValues(true);
set1.setValueTextSize(12f);
set1.setColors(ColorTemplate.JOYFUL_COLORS);

BarData data1 = new BarData(set1);
data1.setBarWidth(15f);
positiveChart.setData(data1);
positiveChart.setFitBars(true);
positiveChart.invalidate();

关于java - 带有来自 Volley 的 json 数据的 MPAndroid 图表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52773118/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com