803a85ff271880b98e02c51709bf6a0fa2f78f30.svn-base 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. package com.chart;
  2. import java.util.ArrayList;
  3. import java.util.HashMap;
  4. import java.util.List;
  5. import java.util.Map;
  6. import com.chart.vo.ChartData;
  7. import com.chart.vo.QueryVo;
  8. import com.formaction.vo.RowSet;
  9. public class LineChart extends Chart{
  10. private String propertyName;
  11. private QueryVo qv = null;
  12. public LineChart(QueryVo qv) {
  13. this.qv = qv;
  14. this.propertyName = qv.getFieldXAxis();
  15. }
  16. @SuppressWarnings({ "rawtypes" })
  17. @Override
  18. public List<ChartData> getJsonData() {
  19. List<ChartData> chartData = new ArrayList<ChartData>();
  20. List<RowSet> datas = super.queryData(qv);
  21. Map<String, List<String>> temp = new HashMap<String, List<String>>();
  22. if (null == datas || datas.size() == 0) {
  23. return chartData;
  24. }
  25. for (RowSet rowSet : datas) {
  26. List<Map> rows = rowSet.getRows();
  27. for (Map m : rows) {
  28. for (Object key : m.keySet()) {
  29. String k = String.valueOf(key);
  30. String v = String.valueOf(m.get(k));
  31. if (propertyName.equalsIgnoreCase(String.valueOf(k))) {
  32. if (null == temp.get(v)) {
  33. } else {
  34. }
  35. }
  36. }
  37. }
  38. }
  39. return chartData;
  40. }
  41. }