19 package org.turro.charts;
21 import java.util.ArrayList;
22 import org.turro.string.Strings;
23 import org.turro.elephant.context.IConstructor;
24 import org.turro.marker.ElephantMarker;
37 this.series =
new ArrayList<>();
53 StringBuilder sb =
new StringBuilder();
60 for(
Data d : s.getData()) {
61 if(first) { first =
false; }
else { sb.append(
","); }
65 .append(d.getValue(0.0));
66 if(!Strings.isBlank(d.getLink())) {
67 sb.append(
",events:{click:function(){location.href=\"")
79 StringBuilder sb =
new StringBuilder();
86 for(
Data d : s.getData()) {
87 if(first) { first =
false; }
else { sb.append(
","); }
91 .append(d.getValue(0.0));
92 if(!Strings.isBlank(d.getLink())) {
93 sb.append(
",events:{click:function(){location.href=\"")
101 return sb.toString();
112 public String
parsePie(String identifier, String title) {
115 marker.
put(
"identifier", identifier);
116 marker.
put(
"title", title);
118 return marker.
parse(
"charts",
"pie");
121 public String
parseLine(String identifier, String title) {
124 marker.
put(
"identifier", identifier);
125 marker.
put(
"title", title);
127 return marker.
parse(
"charts",
"line");
ArrayList< Series > series
ArrayList< Series > getSeries()
Series addSeries(String name)
String parsePie(String identifier)
String parseLine(String identifier, String title)
String parsePie(String identifier, String title)
String parseLine(String identifier)
Chart(IConstructor constructor)
String parse(String rootTmpl, String tmpl)
Object put(Object key, Object value)