java怎么拼成这种数据结构 option = title text 柱状图 tooltip legend data 销量
Map<String, Object> option = new HashMap<>(); Map<String, Object> title = new HashMap<>(); title.put("text", "柱状图"); option.put("title", title); option.put("tooltip", new HashMap<>()); Map<String, Object> legend = new HashMap<>(); legend.put("data", Arrays.asList("销量")); option.put("legend", legend); Map<String, Object> xAxis = new HashMap<>(); xAxis.put("data", Arrays.asList("衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子")); option.put("xAxis", xAxis); option.put("yAxis", new HashMap<>()); List<Map<String, Object>> series = new ArrayList<>(); Map<String, Object> seriesData = new HashMap<>(); seriesData.put("name", "销量"); seriesData.put("type", "bar"); seriesData.put("data", Arrays.asList(5, 20, 36, 10, 10, 20)); series.add(seriesData); option.put("series", series)
原文地址: https://www.cveoy.top/t/topic/faaS 著作权归作者所有。请勿转载和采集!