SVGElement child = (SVGElement)childNode;
String childId = child.getId();
String column_id = childId.replaceAll(datamart.getTargetFeatureName() + "_", "");
IRecord record = dataStore.getRecordByID( column_id );
//Map attributes = (Map)datamart.getAttributeseById(column_id);
String targetColor = null;
Number kpyValue = null;
if(record != null) {
IField field = record.getFieldAt( dataStoreMeta.getFieldIndex(selectedKpiName) );
String kpyValueAttr = "" + field.getValue();
//String kpyValueAttr = (String)attributes.get( selectedKpiName );
if(kpyValueAttr == null) {
targetColor = null_values_color;
} else {
kpyValue = Double.parseDouble(kpyValueAttr);
if(kpyValue.doubleValue() < lb_value.doubleValue()) {
targetColor = lb_color;
} else if(kpyValue.doubleValue() > ub_value.doubleValue()) {
targetColor = ub_color;
} else if(kpyValue.doubleValue() == ub_value.doubleValue()) {
targetColor = col_kpi_array[trash_kpi_array.length-2];
} else {
for (int j = 0; j < trash_kpi_array.length-1; j++) {
if (kpyValue.doubleValue() >= trash_kpi_array[j].doubleValue() && kpyValue.doubleValue() < trash_kpi_array[j+1].doubleValue()) {
targetColor = col_kpi_array[j];
break;
}
}
}
}
}
if(targetColor != null) {
if(child.getNodeName().equals("path")
|| child.getNodeName().equals("polygon")
|| child.getNodeName().equals("ellipse")
|| child.getNodeName().equals("circle")
|| child.getNodeName().equals("rect")
) {
child.setAttribute("fill", targetColor );
} else if(child.getNodeName().equals("line")
|| child.getNodeName().equals("polyline")
) {
child.setAttribute("stroke", targetColor );
}
String opacity = measure.getColurCalculatorParameters().getProperty("opacity");
if(opacity != null) {
child.setAttribute("opacity", opacity );
}
}
}
}
// add label
//Map values = datamart.getValues();
//Iterator it = values.keySet().iterator();
Iterator it = dataStore.iterator();
while(it.hasNext()) {
IRecord record = (IRecord)it.next();
IField field = null;
field = record.getFieldAt( dataStoreMeta.getIdFieldIndex() );
String id = (String)field.getValue();
//String id = (String)it.next();
//Map kpiValueMap = (Map)values.get(id);
String centroideId = "centroidi_" + datamart.getTargetFeatureName() + "_" + id;
Element centroide = targetMap.getElementById( centroideId );
if( centroide != null ) {
List fields = record.getFields();
int line = 0;
Element labelGroup = null;
if(fields.size()>0) labelGroup = masterMap.createElement("g");
boolean isFirst = true;
for(int i = 0; i < fields.size(); i++) {