# XY dot renderer point size

**URL:** <https://forum.inductiveautomation.com/t/xy-dot-renderer-point-size/6900>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [July 20, 2013, 9:31pm UTC](https://forum.inductiveautomation.com/t/xy-dot-renderer-point-size/6900 "2013-07-20T21:31:58Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomhunt](https://avatars.discourse-cdn.com/v4/letter/t/3bc359/32.png) [@tomhunt](https://forum.inductiveautomation.com/u/tomhunt)\
**Post date:** [July 20, 2013, 9:31pm UTC](https://forum.inductiveautomation.com/t/xy-dot-renderer-point-size/6900/1 "2013-07-20T21:31:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![NCChris](https://avatars.discourse-cdn.com/v4/letter/n/2bfe46/32.png) [@NCChris](https://forum.inductiveautomation.com/u/NCChris)\
**Post date:** [August 1, 2013, 7:31pm UTC](https://forum.inductiveautomation.com/t/xy-dot-renderer-point-size/6900/2 "2013-08-01T19:31:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anna](https://avatars.discourse-cdn.com/v4/letter/a/779978/32.png) [@anna](https://forum.inductiveautomation.com/u/anna)\
**Post date:** [August 14, 2013, 11:28pm UTC](https://forum.inductiveautomation.com/t/xy-dot-renderer-point-size/6900/3 "2013-08-14T23:28:57Z")

</div>

This feature is in process of being implemented.

---

<div class="post-metadata">

**Author:** ![NCChris](https://avatars.discourse-cdn.com/v4/letter/n/2bfe46/32.png) [@NCChris](https://forum.inductiveautomation.com/u/NCChris)\
**Post date:** [August 19, 2013, 5:05pm UTC](https://forum.inductiveautomation.com/t/xy-dot-renderer-point-size/6900/4 "2013-08-19T17:05:23Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![anna](https://avatars.discourse-cdn.com/v4/letter/a/779978/32.png) [@anna](https://forum.inductiveautomation.com/u/anna)\
**Post date:** [August 22, 2013, 11:53pm UTC](https://forum.inductiveautomation.com/t/xy-dot-renderer-point-size/6900/5 "2013-08-22T23:53:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![denji26](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/denji26/32/5805_2.png) [@denji26](https://forum.inductiveautomation.com/u/denji26)\
**Post date:** [November 12, 2015, 8:20pm UTC](https://forum.inductiveautomation.com/t/xy-dot-renderer-point-size/6900/6 "2015-11-12T20:20:33Z")

</div>

The Chart component does not use pens like the Easy Chart, is it possible to adjust the dot size on that component?

---

<div class="post-metadata">

**Author:** ![denji26](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/denji26/32/5805_2.png) [@denji26](https://forum.inductiveautomation.com/u/denji26)\
**Post date:** [November 12, 2015, 8:44pm UTC](https://forum.inductiveautomation.com/t/xy-dot-renderer-point-size/6900/7 "2015-11-12T20:44:18Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![drewdin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/drewdin/32/3363_2.png) [@drewdin](https://forum.inductiveautomation.com/u/drewdin)\
**Post date:** [November 17, 2015, 2:43pm UTC](https://forum.inductiveautomation.com/t/xy-dot-renderer-point-size/6900/8 "2015-11-17T14:43:03Z")

</div>

[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

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [November 17, 2015, 5:15pm UTC](https://forum.inductiveautomation.com/t/xy-dot-renderer-point-size/6900/9 "2015-11-17T17:15:41Z")

</div>

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]

---

<div class="post-metadata">

**Author:** ![richardNZ15](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/richardnz15/32/33373_2.png) [@richardNZ15](https://forum.inductiveautomation.com/u/richardNZ15)\
**Post date:** [April 11, 2016, 10:02pm UTC](https://forum.inductiveautomation.com/t/xy-dot-renderer-point-size/6900/10 "2016-04-11T22:02:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![denji26](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/denji26/32/5805_2.png) [@denji26](https://forum.inductiveautomation.com/u/denji26)\
**Post date:** [April 11, 2016, 10:46pm UTC](https://forum.inductiveautomation.com/t/xy-dot-renderer-point-size/6900/11 "2016-04-11T22:46:14Z")

</div>

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)
```

---

<div class="post-metadata">

**Author:** ![richardNZ15](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/richardnz15/32/33373_2.png) [@richardNZ15](https://forum.inductiveautomation.com/u/richardNZ15)\
**Post date:** [April 11, 2016, 11:10pm UTC](https://forum.inductiveautomation.com/t/xy-dot-renderer-point-size/6900/12 "2016-04-11T23:10:30Z")

</div>

Thanks, i managed to get it working. Few questions though.

1. What is the 1st argument in setRenderer(0,dotRenderer) doing?

2. 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, ??).

3. 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!

---

<div class="post-metadata">

**Author:** ![anna](https://avatars.discourse-cdn.com/v4/letter/a/779978/32.png) [@anna](https://forum.inductiveautomation.com/u/anna)\
**Post date:** [July 26, 2016, 5:02pm UTC](https://forum.inductiveautomation.com/t/xy-dot-renderer-point-size/6900/13 "2016-07-26T17:02:12Z")

</div>

Richard,

I am not sure this is still relevant for you, but I will still answer these questions - at least for posterity’s sake.

1. According to JFree Chart API docs (here: [jfree.org/jfreechart/api/jav … YPlot.html](http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/plot/XYPlot.html) )

[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:

```auto
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.

1. The first three values are indeed RGB (red-green-blue) values. This last argument is the so called alpha channel (opacity).  
If you do a search for “Java Color”, you will be able to find the documentation for the java.awt.Color class: [docs.oracle.com/javase/8/docs/a … Color.html](https://docs.oracle.com/javase/8/docs/api/java/awt/Color.html)  
According to the documentation,

[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.

1. There is no reason to use self.getChart().getXYPlot() in the configureChart extension function: the function already has the chart parameter, so using self.getChart() is redundant.

---

<div class="post-metadata">

**Author:** ![AJBerera](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@AJBerera](https://forum.inductiveautomation.com/u/AJBerera)\
**Post date:** [December 21, 2018, 4:10pm UTC](https://forum.inductiveautomation.com/t/xy-dot-renderer-point-size/6900/14 "2018-12-21T16:10:30Z")

</div>

how would this work for multiple subplots? Above code only seems to work for one plot in a chart.

---

<div class="post-metadata">

**Author:** ![MUNIYANDI\_D](https://avatars.discourse-cdn.com/v4/letter/m/48db29/32.png) [@MUNIYANDI\_D](https://forum.inductiveautomation.com/u/MUNIYANDI_D)\
**Post date:** [February 18, 2025, 7:25am UTC](https://forum.inductiveautomation.com/t/xy-dot-renderer-point-size/6900/15 "2025-02-18T07:25:16Z")

</div>

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
