use of org.jfree.data.time.TimeTableXYDataset in project cubrid-manager by CUBRID.
the class CombinedBarTimeSeriesChart method updateValueMapIfArea.
/**
* Update the value based on the new value if series chart uses the area
* renderer
*
* @param valueMap the valueMap to set
* @param barLabel the label text in the bar chart
*/
private void updateValueMapIfArea(TreeMap<String, String> valueMap, String barLabel) {
this.valueMap = valueMap;
bardataset.clear();
double allValue = 0;
for (Map.Entry<String, String> entry : valueMap.entrySet()) {
String value = entry.getValue();
String key = entry.getKey();
if (value != null) {
double newValue = Double.parseDouble(value);
bardataset.addValue(newValue, key, "");
((TimeTableXYDataset) seriesdataset).add(new Second(), newValue, key);
allValue += newValue;
}
}
if (allValue > barMax) {
barMax = allValue;
}
bardataset.addValue(barMax - allValue, "100", "");
numberaxis.setRange(0 - 1, barMax + barMax / 100);
String label = barLabel;
if ("%".equals(label)) {
label = Integer.toString((int) (allValue + 0.5)) + label;
}
categoryAxis.setLabel(label);
}
Aggregations