Is it possible to increase the dot size beyond one pixel? Single pixels are difficult to see, but I don't see a custom property in the chart customizer.
Thanks,
Tom
Is it possible to increase the dot size beyond one pixel? Single pixels are difficult to see, but I don't see a custom property in the chart customizer.
Thanks,
Tom
I would echo this request. I am using the dot plot to show flaws captured by an imaging system on our non-woven fabric line. I would like to show flaw size represented by the dot size.
-Chris
This feature is in process of being implemented.
I would request that the feature be flexible enough to use any shape, size and color graphic to represent a data point.
Thank you for reading our requests!
An update: Dot thickness is adjustable (from Edit Pen settings/Line Weight) as of 7.6.3-rc4.
Setting color for the dot and choosing shape instead of the dot was already possible.
The Chart component does not use pens like the Easy Chart, is it possible to adjust the dot size on that component?
If this helps anyone, here is what I used to increase dot size on the Chart XY Dot Render:
from org.jfree.chart.renderer.xy import XYDotRenderer
plot = chart.getXYPlot()
dotRenderer = XYDotRenderer()
dotRenderer.setDotWidth(4)
dotRenderer.setDotHeight(4)
plot.setRenderer(dotRenderer)
[quote=ādenji26ā]If this helps anyone, here is what I used to increase dot size on the Chart XY Dot Render:
from org.jfree.chart.renderer.xy import XYDotRenderer
plot = chart.getXYPlot()
dotRenderer = XYDotRenderer()
dotRenderer.setDotWidth(4)
dotRenderer.setDotHeight(4)
plot.setRenderer(dotRenderer)[/quote]
This fails and tells me .getXYPlot() is npot a valid function, any ideas?
Thanks
You need to grab the underlying Jfree chart first:
[code]from org.jfree.chart.renderer.xy import XYDotRenderer
chart=event.source.parent.getComponent(āChartā)
plot = chart.getChart().getXYPlot()
dotRenderer = XYDotRenderer()
dotRenderer.setDotWidth(4)
dotRenderer.setDotHeight(4)
plot.setRenderer(dotRenderer)[/code]
Iāve got an XY plot rendered with the XY Dot Renderer. Im having similar problems increasing the dot size.
Looking in the Chart Customizer there still doesnāt seem to be any pen customization still, besides the series colors.
Iāve tried the code posted above, which worked, but Iāve had to use a button on click script to get it to invoke.
I wanted to put the code under the Charts Extension Function āConfigure Chartā but couldnāt figure out why the function wasnāt getting invoked. Can anyone tell me when this extension is supposed to be invoked?
I donāt want to have to put the code to increase button size on a window initialize script or something silly, when it should be configurable on the chart itself. Cheers
I put my script on the configureChart extension function where it executes properly. For reference this is my full configureChart code. Hope it helps!
from org.jfree.chart.renderer.xy import XYDotRenderer
from java.awt import Color
plot = chart.getXYPlot()
gridColor = Color(85,85,85,192)
dotColor = Color(117,117,117,255)
dotSize = 4
plot.setDomainGridlinePaint(gridColor);
plot.setRangeGridlinePaint(gridColor);
dotRenderer = XYDotRenderer()
dotRenderer.setDotWidth(dotSize)
dotRenderer.setDotHeight(dotSize)
dotRenderer.setPaint(dotColor)
plot.setRenderer(0, dotRenderer)
Thanks, i managed to get it working. Few questions though.
What is the 1st argument in setRenderer(0,dotRenderer) doing?
Also I get an error now āNull āpaintā argumentā when trying to use the setPaint() function. Any idea why this might be? what are the components of Color()? is it Color(Red, Blue, Green, ??).
When i used: plot = self.getChart().getXYPlot()
the changes would be made, then revert back to what it was previously. Why does it behave this way?
It works fine (permanently) if i use: plot = chart.getXYPlot()
Thanks!
Richard,
I am not sure this is still relevant for you, but I will still answer these questions - at least for posterityās sake.
[quote]setRenderer(int index, XYItemRenderer renderer)
Sets the renderer for the datasetwith the specified index and sends a change event to all registered listeners.[/quote]
You are working with only one dataset, so you do not have to specify its index, and can use this instead:
[quote]setRenderer(XYItemRenderer renderer)
Sets the renderer for the primary dataset and sends a change event to all registered listeners.[/quote]
So the last line in denji26ās code can also be:
plot.setRenderer(dotRenderer)
When working with JFree chart API (or any API for that matter), make sure to always check the API documentation as the first step towards understanding what a method does and what the parameters are. For example, in this case, do a web search for something like āJFree chart setRendererā, which will bring up the page I gave a link to above.
[quote]Color(int r, int g, int b, int a)
Creates an sRGB color with the specified red, green, blue, and alpha values in the range (0 - 255).[/quote]
Looking at the constructor list on the same page, you will also notice that you can use the constructor without the alpha channel parameter:
[quote]Color(int r, int g, int b)
Creates an opaque sRGB color with the specified red, green, and blue values in the range (0 - 255).[/quote]
So if you did not want to work with opacity, you could modify the code as follows:
gridColor = Color(85,85,85)
dotColor = Color(117,117,117)
If you are getting an error setting paint, pease show us your code adn the complete error text.
how would this work for multiple subplots? Above code only seems to work for one plot in a chart.
Hi all... Is there any way to increase or decrease the size of the XY-Dot in the renderer and Increase / Decrease the Tooltip Box Size? Should increase the size of the dot and Tooltip Box when the mouse cursor over the exact dot. When the cursor leaves the dot, the Dot's and Tooltip size will decrease.
Thanks,
Muniyandi D