# Vision XY Chart change shape size

**URL:** <https://forum.inductiveautomation.com/t/vision-xy-chart-change-shape-size/79305>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [September 18, 2023, 5:42pm UTC](https://forum.inductiveautomation.com/t/vision-xy-chart-change-shape-size/79305 "2023-09-18T17:42:31Z")\
**Posts on this page:** 20\
**Page:** 1

<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:** [September 18, 2023, 5:42pm UTC](https://forum.inductiveautomation.com/t/vision-xy-chart-change-shape-size/79305/1 "2023-09-18T17:42:31Z")

</div>

Ignition 8.1.25

I have an XY chart and I selected lines and shapes dataset type. The size of the shapes is a bit large for my liking since I can have hundreds of points. How can I use the configureChart function to adjust the size of these shapes?

---

<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:** [September 18, 2023, 9:44pm UTC](https://forum.inductiveautomation.com/t/vision-xy-chart-change-shape-size/79305/2 "2023-09-18T21:44:28Z")

</div>

🤓 Got nerd-sniped.  
Should work across multiple datasets and subplots.

```python
def configureChart(self, chart):
	
	size = 6
	
	topPlot = chart.getXYPlot()

	# Create plot list depending if subplots exist				
	if hasattr(topPlot, 'getSubplots'):
		plotList = topPlot.getSubplots()
	else:
		plotList = [topPlot]
	
	for plot in plotList:
		datasetCount = plot.getDatasetCount()
		for dsIndex in xrange(datasetCount):
			dataset = plot.getDataset(dsIndex)
			renderer = plot.getRendererForDataset(dataset)
			
			for seriesIndex in xrange(dataset.seriesCount):
				shape = renderer.getSeriesShape(seriesIndex)
				shape.height=size
				shape.width=size
				shape.x = -size/2.0
				shape.y = -size/2.0
				renderer.setSeriesShape(seriesIndex, shape)

```

Default size of 6

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/1/a1c8ce404bb48907ce12e14fbe364039fd00df65.png)

Size of 4

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/8/68be9c14f5aafbec295544bca9de01fbfcac2ddb.png)

---

<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:** [September 20, 2023, 1:39pm UTC](https://forum.inductiveautomation.com/t/vision-xy-chart-change-shape-size/79305/3 "2023-09-20T13:39:52Z")

</div>

Jordan,

This is better than I hoped. Thanks a ton!

---

<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:** [January 8, 2025, 12:32pm UTC](https://forum.inductiveautomation.com/t/vision-xy-chart-change-shape-size/79305/4 "2025-01-08T12:32:56Z")

</div>

Hi @JordanCClark and All,

Can we disable the shape for those lines in the single dataset? I have one dataset that contains four lines of chart. I'll give an Image for reference. I have Min, Max, Target, and Actual. These are the four Values I have in the dataset. I had to change the line into Line/Shapes in the chart properties. Then, all of the line styles are changed. But I should need to change the Line style for Actual only. Could you please help me to resolve this issue?

In Chart Customizer:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/4/e4621979a4b57185d6498e6e3cabe84dce623adc.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/7/57471910c2fa9445fd5b58d478a035bc110bf4b9.png)  
The above one is my dataset. The Manz ID is an X-Axis value, then HC CH5 590mm is the Actual value and threes are max, min, and target values.

Thanks,  
Muniyandi D

---

<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:** [January 8, 2025, 9:20pm UTC](https://forum.inductiveautomation.com/t/vision-xy-chart-change-shape-size/79305/5 "2025-01-08T21:20:48Z")

</div>

I'd make a filter to use the specific dataset column names.

```python
def configureChart(self, chart):

	size = defaultSize = 6
	seriesFilter = ['HC CH5 590mm']
	
	topPlot = chart.getXYPlot()

	# Create plot list depending if subplots exist				
	if hasattr(topPlot, 'getSubplots'):
		plotList = topPlot.getSubplots()
	else:
		plotList = [topPlot]
	
	for plot in plotList:
		datasetCount = plot.getDatasetCount()
		for dsIndex in xrange(datasetCount):
			dataset = plot.getDataset(dsIndex)
			columnNames = list(dataset.getDataSetForSeries(0).getColumnNames())[1:]
			renderer = plot.getRendererForDataset(dataset)
			for seriesIndex, seriesName in enumerate(columnNames):
				if seriesName in seriesFilter:
						size = 0
				else:
					size = defaultSize
				shape = renderer.getSeriesShape(seriesIndex)
				shape.height=size
				shape.width=size
				shape.x = -size/2.0
				shape.y = -size/2.0
				renderer.setSeriesShape(seriesIndex, shape)

```

---

<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:** [January 9, 2025, 7:51am UTC](https://forum.inductiveautomation.com/t/vision-xy-chart-change-shape-size/79305/6 "2025-01-09T07:51:19Z")

</div>

Thanks, @JordanCClark for your support. But I got an error whenever this script was run.

Sample Image:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/1/61ffca742281f6f8bec1acda7b96e2e8fe33bafe.png)

And the mentioned column's data line's shape size is also not reduced.

FYR:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/a/7a4d4cbf2c29e5364dc87e67c4000625d9ced7d5.png)

Pink - 'HC CH5 590mm'  
Orange - Top - 'Max', Bottom - 'Min'  
Green - 'Target'

Thanks,  
Muniyandi D

---

<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:** [January 9, 2025, 9:07am UTC](https://forum.inductiveautomation.com/t/vision-xy-chart-change-shape-size/79305/7 "2025-01-09T09:07:11Z")

</div>

Can you post a export of the window? If the dataset property is bound to something, remove the binding first, to preserve the data. I should be able to take a closer look this afternoon (currently, its 4am here 😉)

EDIT: Also, what version of Ignition? Just to be sure I'm on the same page.

---

<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:** [January 9, 2025, 9:25am UTC](https://forum.inductiveautomation.com/t/vision-xy-chart-change-shape-size/79305/8 "2025-01-09T09:25:36Z")

</div>

Thank You @JordanCClark for your reply messages at 4 am. I'll add an example window and one client tag for that chart. Should need to assign the substrate\_id column in the tag as "Manz ID" fro that charts.

[Chart\_dataset\_tags.json](https://forum.inductiveautomation.com/uploads/short-url/a45sHDdJ3L2WrN1HRj677bkIzYq.json) (96.9 KB)  
[Chart\_Example\_Window.zip](https://forum.inductiveautomation.com/uploads/short-url/kFV5aLEZB8hlgcnIZDT3oU4kqOr.zip) (45.4 KB)

You can use this to Check and validate which error has throwing while running the script.

Our ignition version is 8.1.33 (b2023101913)

Thanks,  
Muniyandi D

---

<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:** [January 14, 2025, 5:41pm UTC](https://forum.inductiveautomation.com/t/vision-xy-chart-change-shape-size/79305/9 "2025-01-14T17:41:56Z")

</div>

Sorry for the late reply. Work requirements are building up...

Anyway, here's a quick and dirty one that will hide series shapes only. No resizing, as, in my limited time, resizing a polygon is a pain. 😆

```python
def configureChart(self, chart):

	seriesFilter = ['HC CH5 590nm', 'Target']

	
	topPlot = chart.getXYPlot()

	# Create plot list depending if subplots exist				
	if hasattr(topPlot, 'getSubplots'):
		plotList = topPlot.getSubplots()
	else:
		plotList = [topPlot]
	
	for plot in plotList:
		datasetCount = plot.getDatasetCount()
		
		for dsIndex in xrange(datasetCount):
			dataset = plot.getDataset(dsIndex)
			columnNames = list(dataset.getDataSetForSeries(0).getColumnNames())[1:]
			renderer = plot.getRendererForDataset(dataset)
			
			# Create a shape to use for hiding a series shape.
			hiddenShape = renderer.getSeriesShape(0)			
			hiddenShape.height = 0
			hiddenShape.width = 0
			hiddenShape.x = 0
			hiddenShape.y = 0
			
			for seriesIndex, seriesName in enumerate(columnNames):	
				if seriesName in seriesFilter:
					renderer.setSeriesShape(seriesIndex, hiddenShape)

```

---

<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:** [January 16, 2025, 7:15am UTC](https://forum.inductiveautomation.com/t/vision-xy-chart-change-shape-size/79305/10 "2025-01-16T07:15:23Z")

</div>

Thank you, Mr.@JordanCClark, for your guidance and support. This script is doing what I expected. And Hats off @JordanCClark for your dedication and support to achieve their goals anytime.

Thanks,  
Muniyandi D

---

<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:** [January 20, 2025, 5:15am UTC](https://forum.inductiveautomation.com/t/vision-xy-chart-change-shape-size/79305/11 "2025-01-20T05:15:33Z")

</div>

Is there any way to change the Graph line type? For example, I used XY/Shapes Renderer only. So, the lines and shapes showed a series. But, here my doubt is, can we show only shapes for any one line out of four lines? I mentioned it previously in the previous chats.

Thanks,  
Muniyandi D

---

<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:** [January 21, 2025, 12:33am UTC](https://forum.inductiveautomation.com/t/vision-xy-chart-change-shape-size/79305/12 "2025-01-21T00:33:43Z")

</div>

```python
def configureChart(self, chart):

	noShapesFilter = ['HC CH5 590nm']
	noLineFilter = ['Target']
	
	topPlot = chart.getXYPlot()

	# Create plot list depending if subplots exist				
	if hasattr(topPlot, 'getSubplots'):
		plotList = topPlot.getSubplots()
	else:
		plotList = [topPlot]
	
	for plot in plotList:
		datasetCount = plot.getDatasetCount()
		
		for dsIndex in xrange(datasetCount):
			dataset = plot.getDataset(dsIndex)
			columnNames = list(dataset.getDataSetForSeries(0).getColumnNames())[1:]
			renderer = plot.getRendererForDataset(dataset)
			# Get base stroke and create a hidden version.
			baseStroke = renderer.baseStroke
			hiddenStroke = baseStroke.class(0)
			# Create a shape to use for hiding a series shape.
			hiddenShape = renderer.getBaseShape()		
			hiddenShape.height = 0
			hiddenShape.width = 0
			hiddenShape.x = 0
			hiddenShape.y = 0
			
			for seriesIndex, seriesName in enumerate(columnNames):	
				if seriesName in noShapesFilter:
					renderer.setSeriesShape(seriesIndex, hiddenShape)
				if seriesName in noLineFilter:
					renderer.setSeriesStroke(seriesIndex, hiddenStroke)

```

---

<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:** [January 21, 2025, 4:44am UTC](https://forum.inductiveautomation.com/t/vision-xy-chart-change-shape-size/79305/13 "2025-01-21T04:44:07Z")

</div>

Thanks, Mr. @JordanCClark. I think you haven't mentioned the "hiddenLine" variable you had passed in the noLineFilter condition. That's why I got an error?

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/6/263b7766a540cd45ebd82ccecbcbbece6a84e5a9.png)

---

<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:** [January 21, 2025, 1:40pm UTC](https://forum.inductiveautomation.com/t/vision-xy-chart-change-shape-size/79305/14 "2025-01-21T13:40:04Z")

</div>

Probably. I was pretty sleepy when I wrote it. 😉

Change `hiddenLine` to `hiddenStroke`

---

<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:** [January 22, 2025, 10:19am UTC](https://forum.inductiveautomation.com/t/vision-xy-chart-change-shape-size/79305/15 "2025-01-22T10:19:28Z")

</div>

No worries Mr. @JordanCClark ! Sleepy coding is the birthplace of all kinds of creative bugs. 😉 I've updated it to **hiddenStroke** - it's ready to roll! But I'm facing one small issue with that. The shapes of those columns we mentioned in the **noShapeFilter** list columns should be hidden. am I correct? However, all column shapes are hidden whenever the script is enabled.

```python
def configureChart(self, chart):
	
	noShapesFilter = ["Min", "Max", "Target"]
	noLineFilter = ["HC Ch5 590nm"]
	
	topPlot = chart.getXYPlot()
	
	# Create plot list depending if subplots exist				
	if hasattr(topPlot, 'getSubplots'):
		plotList = topPlot.getSubplots()
	else:
		plotList = [topPlot]
	
	for plot in plotList:
		datasetCount = plot.getDatasetCount()
		
		for dsIndex in xrange(datasetCount):
			dataset = plot.getDataset(dsIndex)
			columnNames = list(dataset.getDataSetForSeries(0).getColumnNames())[1:]
			renderer = plot.getRendererForDataset(dataset)
			
			# Get base stroke and create a hidden version.
			baseStroke = renderer.baseStroke
			hiddenStroke = baseStroke.class(0)
			
			# Create a shape to use for hiding a series shape.
			hiddenShape = renderer.getBaseShape()
			hiddenShape.height = 0
			hiddenShape.width = 0
			hiddenShape.x = 0
			hiddenShape.y = 0
			
			for seriesIndex, seriesName in enumerate(columnNames):
			
				if str(seriesName) in noShapesFilter:
					renderer.setSeriesShape(seriesIndex, hiddenShape)
					
				if seriesName in noLineFilter:
					renderer.setSeriesStroke(seriesIndex, hiddenStroke)

```

Here, I tried to Hide the shapes for which columns I had mentioned in the **noShapesFilter** list and to reduce the visibility of the line that is mentioned in the **noLineFiletr** list. But, I'm not hiding the shapes **noLineFilter** mentioned column.

Example Image:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/c/fce54e237497d3d930df8257f63fad13b2b02bed.png)

I hope you can see the white colored line under the green line that was an "HC Ch5 590nm" column mentioned in **noLineFilter**. The **"HC Ch5 590nm"** data line hiding is working well. But, the line Shapes was not showing. We had not mentioned that column name in the **noShapeFilter** List. Then, how is this happening?

Thanks,  
Muniyandi D

---

<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:** [January 27, 2025, 2:54pm UTC](https://forum.inductiveautomation.com/t/vision-xy-chart-change-shape-size/79305/16 "2025-01-27T14:54:47Z")

</div>

_EDIT: Correct file uploded._

Since you have your charts in separate groups, I reworked Graph\_1. This will be a lot easier for you to maintain.  
[Campaign\_Chart\_Example\_JC.zip](https://forum.inductiveautomation.com/uploads/short-url/54EEOSvrEto5KqSNwDwAffXgk4G.zip) (32.4 KB)

- added custom properties to the Graph\_1 group.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/8/e8751587dfda6284f2ff903f83a7ed0cecaeedfa.png)
- added propertyChange script to look for changes in the raw data or column names to sort.
- added datasets to graph and bound them to the custom dataset properties of the group.

The script:

```python
if event.propertyName in ['_rawData', 'lineSeries', 'shapeSeries']:
	dataIn = system.dataset.toPyDataSet(event.source._rawData)
	
	dataHeaders = []
	dataCols = []
	
	linesHeaders = []
	linesCols = []
	
	shapesHeaders = []
	shapesCols = []
	
	lineSeries = [item.strip() for item in event.source.lineSeries.split(',')]
	shapeSeries = [item.strip() for item in event.source.shapeSeries.split(',')]
	
	for i, col in enumerate(dataIn.columnNames):
		newCol = dataIn.getColumnAsList(i)
		if i==0:
			dataHeaders.append(col)
			dataCols.append(newCol)
			if len(lineSeries[0]) > 0:
				linesHeaders.append(col)
				linesCols.append(newCol)
			if len(shapeSeries[0]) > 0:
				shapesHeaders.append(col)
				shapesCols.append(newCol)
		elif col in lineSeries:
			linesHeaders.append(col)
			linesCols.append(newCol)
		elif col in shapeSeries:
			shapesHeaders.append(col)
			shapesCols.append(newCol)
		else:
			dataHeaders.append(col)
			dataCols.append(newCol)
	
	event.source.data = system.dataset.toDataSet(dataHeaders, zip(*dataCols))
	event.source.linesOnlyData = system.dataset.toDataSet(linesHeaders, zip(*linesCols))
	event.source.shapesOnlyData = system.dataset.toDataSet(shapesHeaders, zip(*shapesCols))

```

---

<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 3, 2025, 5:04am UTC](https://forum.inductiveautomation.com/t/vision-xy-chart-change-shape-size/79305/17 "2025-02-03T05:04:32Z")

</div>

Hi @JordanCClark , Thanks for your reply. But i have a doubt, are you given a correct sample window. Becoz, there are two templates in the sample window which you are given in the previous reply. Could please re-check that?

Inside of the Sample file,

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/2/4211e833a201dad595458c39201821e239a3eb93.png),  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/2/026075a20b76fa8bbe8093c0b40e4eaed4ec6c4c.png)

Thanks,  
Muniyandi D

---

<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:** [February 3, 2025, 10:31am UTC](https://forum.inductiveautomation.com/t/vision-xy-chart-change-shape-size/79305/18 "2025-02-03T10:31:56Z")

</div>

Hah! Uploded the wrong one. I'll be into work in a bit and give you the correct one. 😆

---

<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:** [February 3, 2025, 11:10am UTC](https://forum.inductiveautomation.com/t/vision-xy-chart-change-shape-size/79305/19 "2025-02-03T11:10:28Z")

</div>

Correct one attached to the post above.

Really and for true... 🙂

---

<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 7, 2025, 10:28am UTC](https://forum.inductiveautomation.com/t/vision-xy-chart-change-shape-size/79305/20 "2025-02-07T10:28:50Z")

</div>

Hi Mr. @JordanCClark thank you for the correction. your suggestion is the best one. But, in that some issues are there. I did what you suggested to me. But, I faced another issue when opened that on the client. I have four charts in that window. Whenever I enable the checkbox component lines and shapes datasets are enabled and the data dataset has to be disabled. Then the data are showing as I want. but, sometime later the data are disappeared automatically then that will appear at sometimes later. I don't know why this is happening. I will give a sample window of what I have used. Just move your mouse as a zig-zag on the charts, then you can see that.

Sample Image:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/c/ccaae27f887ebdba2b8feada1150a6b0bedd90f8.png)

Sample window:  
[Chart\_Window.zip](https://forum.inductiveautomation.com/uploads/short-url/rTvlTYyyezdpRdqDARVg7e2jsnc.zip) (57.5 KB)

Thanks ,  
Muniyandi D
