単一のシリーズ、つまり時系列チャートでは、さまざまな形状を取得する必要があります。しかし、それは来ません... plsは次のコードを参照して、私が犯した間違いを教えてください?
TimeSeriesCollection dataset = new TimeSeriesCollection(glucoseries);
JFreeChart chart = ChartFactory.createTimeSeriesChart("Glucometer","Date","value",dataset,true,true,false);
XYPlot xyplot = (XYPlot)chart.getPlot();
XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) xyplot.getRenderer();
int glucovalue = Integer.parseInt(glcvalue);
if(glucovalue<80)
{
renderer.setSeriesShape(0,new Ellipse2D.Double(-3.0,-3.0,8.0,8.0));
renderer.setSeriesShapesVisible(0,true);
}
else if(glucovalue>80 && glucovalue<100)
{
renderer.setSeriesShape(0,ShapeUtilities.createUpTriangle(4.0f));
renderer.setSeriesShapesVisible(0,true);
}
else if(glucovalue>100 && glucovalue< 120)
{
renderer.setSeriesShape(0,ShapeUtilities.createDiamond(4.0f));
renderer.setSeriesShapesVisible(0,true);
}
else
{
renderer.setSeriesShape(0,ShapeUtilities.createDownTriangle(4.0f));
renderer.setSeriesShapesVisible(0,true);
}
ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection());
File file1 = new File(request.getRealPath("\\jspchart\\gluco7.png"));
ChartUtilities.saveChartAsPNG(file1, chart, 700, 400, info);