Vision XY Chart change shape size

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?

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

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

Size of 4

2 Likes

Jordan,

This is better than I hoped. Thanks a ton!