1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- package com.chart;
- import java.util.ArrayList;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
- import com.chart.vo.ChartData;
- import com.chart.vo.QueryVo;
- import com.formaction.vo.RowSet;
- public class LineChart extends Chart{
- private String propertyName;
- private QueryVo qv = null;
- public LineChart(QueryVo qv) {
- this.qv = qv;
- this.propertyName = qv.getFieldXAxis();
- }
- @SuppressWarnings({ "rawtypes" })
- @Override
- public List<ChartData> getJsonData() {
- List<ChartData> chartData = new ArrayList<ChartData>();
- List<RowSet> datas = super.queryData(qv);
- Map<String, List<String>> temp = new HashMap<String, List<String>>();
- if (null == datas || datas.size() == 0) {
- return chartData;
- }
- for (RowSet rowSet : datas) {
- List<Map> rows = rowSet.getRows();
- for (Map m : rows) {
- for (Object key : m.keySet()) {
- String k = String.valueOf(key);
- String v = String.valueOf(m.get(k));
- if (propertyName.equalsIgnoreCase(String.valueOf(k))) {
- if (null == temp.get(v)) {
- } else {
- }
- }
- }
- }
- }
- return chartData;
- }
- }
|