Easy Chart Auto range margin crossing zero

Version 8.1.44 Vision

I have an easy chart that uses historical pens. I want the y axis to be auto ranging around 5%, but even when configuring this, if my minimum values are 0 or near 0 the 5% margin does not appear because it doesn't cross 0 to show negative range values.

I already have a custom method on my easy chart that determines min and max values over my historical range so I can easily figure out the lowest datapoint value.

Is there a way, from this custom method, that I can I disable auto range to set my lower bound and turn back on auto range?
I can't seem to get a reference to the chart from the method so this fails:

	# Set your start and end dates
	s = self.startDate
	e = self.endDate
	
	# Convert tagPens to a Python dataset
	newTagPens = self.tagPens
	tagPens = system.dataset.toPyDataSet(self.tagPens)
	
	# Loop through the tag pens and retrieve min, max values from the tag history
	for i in range(len(tagPens)):
	    pen = tagPens[i]
	    tagPath = pen["TAG_PATH"]
	    
	    minValue = None
	    maxValue = None
	    avgValue = None
	    
	    try:
	        historyValues = system.tag.queryTagHistory(
	            paths=[tagPath, tagPath, tagPath], 
	            startDate=s, 
	            endDate=e, 
	            returnSize=1, 
	            columnNames=['%sMin', '%sMax', '%sAvg'], 
	            aggregationModes=['Minimum', 'Maximum', 'Average']
	        )
	        if historyValues.getRowCount():
	            minValue = historyValues.getValueAt(0, 1)
	            maxValue = historyValues.getValueAt(0, 2)
	            avgValue = historyValues.getValueAt(0, 3)
	    except:
	        pass
	    
	    # Only adjust if minValue is valid and less than 5
	    if minValue is not None and minValue < 5:
	    	lowerBound = minValue - (maxValue - minValue) * 0.05
	    	chart = self
	    	chart.setAutoRange(False)  # Temporarily disable auto-range to set custom bounds
	    	chart.getYAxes().get(0).setLowerBound(lowerBound)  # Set lower bound for Y-axis
	    	chart.setAutoRange(True)  # Re-enable auto-range for the upper bound

Oy!

Doing a history query in a chart event? When the chart already has all the data? Ewww! (UI stalls much?)

I would recommend, in the configureChart method, replacing the Y axis (or axes) with a customized ValueAxis instance, that has the getUpperBound(), getRange(), and getLowerBound() overridden.

When constructing that instance, pass the plot object that applies, so that those functions can scan the plot's already-retrieved data to find the min or max (or both) you need at that moment.

This approach works even if the chart data is updated without the chart calling configureChart again, which commonly happens with Classic Charts, but ought to happen with EasyCharts, too (for performance).