|
|
@@ -220,16 +220,8 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
private void initData() {
|
|
|
sendHttpResquest();
|
|
|
isHasSubordinate(6);//下属
|
|
|
- /* loadLocalServer();*/
|
|
|
}
|
|
|
|
|
|
- /* private void loadLocalServer(){
|
|
|
- String url = "http://192.168.253.200:8080/spring-mvc-showcase/client/info";
|
|
|
- final Map<String, Object> param = new HashMap<>();
|
|
|
- LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
|
|
|
- headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
|
|
|
- ViewUtil.httpSendRequest(ct, url, param, mHandler, headers, 100, null, null, "get");
|
|
|
- }*/
|
|
|
|
|
|
private void initBarChart() {
|
|
|
mChart.setDescription("");
|
|
|
@@ -398,10 +390,15 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
xVals.add(mMonths[i % 4]);
|
|
|
}
|
|
|
ArrayList<BarEntry> yVals1 = new ArrayList<BarEntry>();
|
|
|
+ float maxHight=0;
|
|
|
for (int i = 0; i < count; i++) {
|
|
|
float val = ydata[i];
|
|
|
yVals1.add(new BarEntry(val, i));
|
|
|
+ if (maxHight<ydata[i]){
|
|
|
+ maxHight=ydata[i];
|
|
|
+ }
|
|
|
}
|
|
|
+ mChart.getAxisLeft().setAxisMaxValue(maxHight+10);
|
|
|
BarDataSet set1 = new BarDataSet(yVals1, "月销售额(单位:人民币 万元)");
|
|
|
int[] JOYFUL_COLORS = {
|
|
|
Color.rgb(121, 191, 174), Color.rgb(91, 161, 209)
|
|
|
@@ -409,7 +406,7 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
set1.setColors(JOYFUL_COLORS);
|
|
|
//set1.setVisible(false);
|
|
|
//set1.setDrawValues(false);
|
|
|
- /*set1.setValueFormatter(new ValueFormatter() {
|
|
|
+ set1.setValueFormatter(new ValueFormatter() {
|
|
|
private DecimalFormat mFormat;
|
|
|
|
|
|
public void DefaultValueFormatter(int digits) {
|
|
|
@@ -429,14 +426,14 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
if (value == 0) {
|
|
|
return "";
|
|
|
} else {
|
|
|
- return new DecimalFormat("###,###,##0").format(value);
|
|
|
+ return new DecimalFormat("#,##").format(value);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
return "";
|
|
|
}
|
|
|
- });*/
|
|
|
+ });
|
|
|
dataSets.clear();
|
|
|
dataSets.add(set1);
|
|
|
|
|
|
@@ -562,7 +559,7 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
}
|
|
|
|
|
|
|
|
|
- private Handler mHandler = new Handler() {
|
|
|
+ private Handler mHandler = new Handler() {
|
|
|
@Override
|
|
|
public void handleMessage(Message msg) {
|
|
|
switch (msg.what) {
|
|
|
@@ -798,9 +795,15 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
ydata1[6] = root.getJSONArray("visit").getIntValue(0);
|
|
|
tv_chuhuo.setText("出货" + root.getFloatValue("saleamount") + "万元");
|
|
|
tv_huikuan.setText("回款" + root.getFloatValue("backamount") + "万元");
|
|
|
+ float maxHeight=0;
|
|
|
for (int i = 0; i < ydata1.length; i++) {
|
|
|
Log.i(TAG, "handleMessage:ydata1[" + i + "]=" + ydata1[i]);
|
|
|
+ if (maxHeight<ydata1[i]){
|
|
|
+ maxHeight=ydata1[i];
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
+ sChart.getAxisLeft().setAxisMaxValue(maxHeight+10);
|
|
|
setData1(7, ydata1);
|
|
|
} else {
|
|
|
setData1(7, ydata1);
|