How to get value from database and insert into getItemShape() in JFreeChart?

hotrod

New Member
I want to get the value of mealsltvalue into the getItemShape() method. The mealsltvalue comes from the JSON Object, ie it comes from the database. Using that mealsltvalue I have to check the condition using if and else loop. \[code\]String mealsltvalue = http://stackoverflow.com/questions/15904502/jsonObject.getString("mealslot");final XYPlot xyplot = (XYPlot)chart.getPlot();XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(true,true){ Shape ellipse = new Ellipse2D.Double(-3.0,-3.0,8.0,8.0); Shape upTriangle = ShapeUtilities.createUpTriangle(4.0f); public Shape getItemShape(int row, int column) { Double value = http://stackoverflow.com/questions/15904502/(Double)xyplot.getDataset(0).getY(row,column); if (mealsltvalue .equalsIgnoreCase("Before Meal")) { return ellipse; } else { return upTriangle; } }};xyplot.setRenderer(renderer); \[/code\]
 
Back
Top