I am running the probalmetic codes in a solatis machine too, but can you teach me as where to set java properties ,RV wrote:I set this prop to disable X11 dependency. And it works fine on solaris 2.8
I got the serveletexception errot when I try to declare a feference variable of CategoryAxis objCategoryAxis = null;
below is a snippet of my codes
Code: Select all
private JFreeChart createChart(CategoryDataset categorydataset, String strProfileDesc) throws Exception{
logger.debug("[createChart] -> Start");
JFreeChart objFreeChart = null;
NumberAxis objNumAxis = null;
CategoryPlot objCatPlot = null;
CategoryAxis objCategoryAxis = null;
try{
objFreeChart = ChartFactory.createLineChart(strProfileDesc,"Time Series","YTM",categorydataset, PlotOrientation.VERTICAL,true, true, false);
objCatPlot = objFreeChart.getCategoryPlot();
objNumAxis = (NumberAxis)objCatPlot.getRangeAxis();
objFreeChart.setBackgroundPaint(Color.white);
objNumAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
objNumAxis.setAutoRangeIncludesZero(true);
objNumAxis.setUpperMargin(0.05);
objNumAxis.setLowerMargin(0.05);
objNumAxis.setLabelAngle(1.5707963267948966D);
logger.debug("Untill Here Ok !!!!");
objCategoryAxis = objCatPlot.getDomainAxis();
objCategoryAxis.setUpperMargin(0.05);
objCategoryAxis.setLowerMargin(0.05);
objCategoryAxis.setTickLabelFont(new Font("SansSerif",0,6));
// Set Plot Area Color
objCatPlot.setBackgroundPaint(Color.lightGray);//new Color(238, 238, 255));
objCatPlot.setDomainGridlinePaint(Color.white); // Vertical Grid Line
objCatPlot.setRangeGridlinePaint(Color.white); // Horizontal Grid Line
// Show Graph Grid lines
objCatPlot.setDomainGridlinesVisible(true);
objNumAxis.setAxisLineVisible(true);
// To Get The Dot Marks On The Line
LineAndShapeRenderer lineandshaperenderer = (LineAndShapeRenderer)objCatPlot.getRenderer();
lineandshaperenderer.setShapesVisible(true);
lineandshaperenderer.setDrawOutlines(true);
//lineandshaperenderer.setUseFillPaint(true);
//lineandshaperenderer.setFillPaint(Color.red);
// To get value label mraks on the Dot
lineandshaperenderer.setItemLabelsVisible(true);
lineandshaperenderer.setItemLabelGenerator(new StandardCategoryItemLabelGenerator());
// Set lable of Axis X to display vertically
objNumAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
objCategoryAxis = (CategoryAxis) objCatPlot.getDomainAxis();
objCategoryAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_45);
logger.debug("Font = "+objCategoryAxis.getTickLabelFont());
}catch(Exception e){
logger.error("[createChart]",e);
throw e;
}
return objFreeChart;
}
Plase advise ? I need to get this up and running by this week please help Iam in a crisis now....