帮我用javaHashMap代码展示这种数据格式 yAxis xAxis typecategory data 1-101-智能设备05
HashMap<String, Object> data = new HashMap<>();
HashMap<String, Object> yAxis = new HashMap<>();
HashMap<String, Object> xAxis = new HashMap<>();
HashMap<String, Object> xAxisData = new HashMap<>();
HashMap<String, Object> axisLabel = new HashMap<>();
HashMap<String, Object> series = new HashMap<>();
ArrayList
axisLabel.put("rotate", 30); xAxisData.put("type", "category"); xAxisData.put("data", Arrays.asList("1-101-智能设备05", "1-101-智能设备02", "1-101-智能设备16", "1-101-智能设备15", "1-101-智能设备01", "1-101-显示器", "2-108-摄像头", "2-109-键盘", "3-103-打印机", "3-102-显示器", "2-111-鼠标", "2-104-条码阅读器", "2-106-摄像头")); xAxisData.put("axisLabel", axisLabel); xAxis.put("xAxis", Arrays.asList(xAxisData));
seriesData.addAll(Arrays.asList(1, 2, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1)); series.put("series", Arrays.asList(new HashMap<String, Object>() {{ put("data", seriesData); put("type", "bar"); }}));
tooltip.put("tooltip", new HashMap<String, Object>());
title.put("title", new HashMap<String, Object>() {{ put("text", "设备统计"); }});
data.put("yAxis", yAxis); data.putAll(xAxis); data.putAll(series); data.putAll(tooltip); data.putAll(title)
原文地址: https://www.cveoy.top/t/topic/fcbE 著作权归作者所有。请勿转载和采集!