NumberAxis yAxis = new NumberAxis(xLabel);
yAxis.setUpperMargin(0.0);
yAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
yAxis.setRange(hourMin, hourMax);
XYBlockRenderer renderer = new XYBlockRenderer();
renderer.setBlockWidth(BLOCK_HEIGHT);
// one block for each minute!
renderer.setBlockHeight(0.017);
//renderer.setBlockWidth(1);
renderer.setBlockAnchor(RectangleAnchor.BOTTOM_LEFT);
// MyXYItemLabelGenerator my=new MyXYItemLabelGenerator();
// renderer.setItemLabelsVisible(null);
// renderer.setSeriesItemLabelGenerator(0, my);
// renderer.setSeriesItemLabelsVisible(0, true);
// XYTextAnnotation annotation1 = new XYTextAnnotation(
// "P_",1.2309372E12, 14.3);
// XYTextAnnotation annotation2 = new XYTextAnnotation(
// "P_",1.2308508E12, 16.3);
for (Iterator iterator = annotations.keySet().iterator(); iterator.hasNext();) {
String annotationCode = (String) iterator.next();
AnnotationBlock annotationBlock=annotations.get(annotationCode);
XYTextAnnotation xyAnnotation = new XYTextAnnotation(
annotationBlock.getAnnotation(),annotationBlock.getXPosition()+ANNOTATION_HEIGHT, annotationBlock.getYPosition());
if(styleAnnotation!=null){
xyAnnotation.setFont(new Font(styleAnnotation.getFontName(),Font.BOLD,styleAnnotation.getSize()));
xyAnnotation.setPaint(styleAnnotation.getColor());
}
else{
xyAnnotation.setFont(new Font("Nome",Font.BOLD,8));
xyAnnotation.setPaint(Color.BLACK);
}
xyAnnotation.setTextAnchor(TextAnchor.BOTTOM_LEFT);
renderer.addAnnotation(xyAnnotation);
}
logger.debug("Annotation set");
LookupPaintScale paintScale = new LookupPaintScale(0.5, ranges.size()+0.5, color);
String[] labels=new String[ranges.size()+1];
labels[0]="";
// ******************** SCALE ****************************
for (Iterator iterator = ranges.iterator(); iterator.hasNext();) {
RangeBlocks range = (RangeBlocks) iterator.next();
Integer index=patternRangeIndex.get(range.getPattern());
Color color=range.getColor();
if(color!=null){
//Paint colorTransparent=new Color(color.getRed(), color.getGreen(), color.getBlue(), 50);
Paint colorTransparent=null;
if(addTransparency==true){
colorTransparent=new Color(color.getRed(), color.getGreen(), color.getBlue(),50);
}
else{
colorTransparent=new Color(color.getRed(), color.getGreen(), color.getBlue());
}
paintScale.add(index+0.5, colorTransparent);
}
//String insertLabel=" "+range.getLabel();
String insertLabel=range.getLabel();
labels[index+1]=insertLabel;
}
renderer.setPaintScale(paintScale);
SymbolAxis scaleAxis = new SymbolAxis(null, labels);
scaleAxis.setRange(0.5, ranges.size()+0.5);