Hello,
I am quite new at JFreeChart and I can't find how to use a Dotrenderer with a Paintscale.
As an example :
On this picture :
I want to replace the circles by dots, and make the dot color value follow the paintscale value. However, I don't find how to do that. Can anyone explain to me?
Thanks in advance,
Daivy
Using XYDotRenderer with PaintScale
-
- Posts: 21
- Joined: Mon Jan 09, 2017 2:04 pm
- antibot: No, of course not.
-
- Posts: 1634
- Joined: Sat Feb 17, 2007 1:51 pm
Re: Using XYDotRenderer with PaintScale
Use an XYShapeRenderer.
This renderer allows to use an PaintScale (in contrast to an XYDotRenderer), and also allows to freely define the type of the symbols (in contrast to an XYBlockRenderer, which also supports the use of a PaintScale, but always draws rectangles as symbols).
This renderer allows to use an PaintScale (in contrast to an XYDotRenderer), and also allows to freely define the type of the symbols (in contrast to an XYBlockRenderer, which also supports the use of a PaintScale, but always draws rectangles as symbols).
-
- Posts: 21
- Joined: Mon Jan 09, 2017 2:04 pm
- antibot: No, of course not.
Re: Using XYDotRenderer with PaintScale
Hello paradoxoff, thanks for you answer. You say that I can freely define the type of symbols, so how can I define the symbol as a dot ? XYShapeRenderer by default uses circle.paradoxoff wrote:Use an XYShapeRenderer.
This renderer allows to use an PaintScale (in contrast to an XYDotRenderer), and also allows to freely define the type of the symbols (in contrast to an XYBlockRenderer, which also supports the use of a PaintScale, but always draws rectangles as symbols).
Thanks again.
-
- Posts: 1634
- Joined: Sat Feb 17, 2007 1:51 pm
Re: Using XYDotRenderer with PaintScale
Just use a very small shape, such as an Ellipse2D.Double(-1, -1, 2, 2) or a Rectangle2D.Double(-1, -1, 2, 2), and set those as seriesShape on the renderer:
renderer.setSeriesShape(int indexOfSeriesInDataset, Shape theShape)
renderer.setSeriesShape(int indexOfSeriesInDataset, Shape theShape)
-
- Posts: 21
- Joined: Mon Jan 09, 2017 2:04 pm
- antibot: No, of course not.
Re: Using XYDotRenderer with PaintScale
It does the job for me ; I didn't know it was as simple as that. Thank you very much !paradoxoff wrote:Just use a very small shape, such as an Ellipse2D.Double(-1, -1, 2, 2) or a Rectangle2D.Double(-1, -1, 2, 2), and set those as seriesShape on the renderer:
renderer.setSeriesShape(int indexOfSeriesInDataset, Shape theShape)