java - Jfreechart - can we set a shape for a datapoint in StackedAreaChart? -
i using jfreechart make stacked area chart. using class stackedxyareachart.
i wanted know if draw shapes @ data points stackedareachart, (it line chart can denote each data point setting setseriesshapes()).
the method setseriesshape() doesn't seem work. have idea ?
here's have tried till (please not comment have empty dataset. plotting dynamic graph , series filled later ):
incomingdata = new timetablexydataset(); final jfreechart incomingdatachart = chartfactory.createstackedxyareachart( "chart", "time", "payload (in bytes)", incomingdata, plotorientation.vertical, true, true, false); final stackedxyarearenderer renderchart = new stackedxyarearenderer(); renderchart.setseriespaint(0, color.decode("#339900")); renderchart.setseriespaint(1, color.decode("#cc9933")); renderchart.setseriespaint(2, color.decode("#33ccff")); renderchart.setseriespaint(3, color.decode("#ff6600")); renderchart.setseriesshape(0, new ellipse2d.double(-3, -3, 10, 10)); renderchart.setseriesshape(1, new ellipse2d.double(-3, -3, 10, 10)); renderchart.setseriesshape(2, new ellipse2d.double(-3, -3, 10, 10)); renderchart.setseriesshape(3, new ellipse2d.double(-3, -3, 10, 10)); incomingdatachart.getplot().setrenderer(renderchart);
you need set type of stackedxyarearenderer "shapes , lines". renderer doesn't show shapes default.
stackedxyarearenderer renderer = new stackedxyarearenderer(stackedxyarearenderer.shapes_and_lines);
Comments
Post a Comment