# Vision Chart - possible to show minor tick labels on logarithmic axis?

**URL:** <https://forum.inductiveautomation.com/t/vision-chart-possible-to-show-minor-tick-labels-on-logarithmic-axis/109651>\
**Category:** Ignition\
**Tags:** ignition81, vision, scripting\
**Created:** [August 12, 2025, 4:50pm UTC](https://forum.inductiveautomation.com/t/vision-chart-possible-to-show-minor-tick-labels-on-logarithmic-axis/109651 "2025-08-12T16:50:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rpavlicek](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rpavlicek/32/55868_2.png) [@rpavlicek](https://forum.inductiveautomation.com/u/rpavlicek)\
**Post date:** [August 12, 2025, 4:50pm UTC](https://forum.inductiveautomation.com/t/vision-chart-possible-to-show-minor-tick-labels-on-logarithmic-axis/109651/1 "2025-08-12T16:50:39Z")

</div>

I’m creating a Classic Chart in Vision (8.1.26) and noticed that when I use the logarithmic axis, the tick labels show only the major ticks labels. It would be nice to show the minor tick labels as well. I did some looking, and am I correct that the jFreeChart in Vision is version 1.0 and doesn’t support minor tick mark control? Anyway around this?

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

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [August 12, 2025, 6:08pm UTC](https://forum.inductiveautomation.com/t/vision-chart-possible-to-show-minor-tick-labels-on-logarithmic-axis/109651/2 "2025-08-12T18:08:49Z")

</div>

> [@rpavlicek](#):
>
> am I correct that the jFreeChart in Vision is version 1.0

That does look to be correct. I am on version 8.1.48, and the jar is still `jfreechart-min-1.0.0.jar`

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [December 19, 2025, 7:40am UTC](https://forum.inductiveautomation.com/t/vision-chart-possible-to-show-minor-tick-labels-on-logarithmic-axis/109651/3 "2025-12-19T07:40:07Z")

</div>

I was able to build a custom Logarithmic Axis that includes labels for all the ticks

**Result:**

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

**Configure Chart extension function script:**

```python
#def configureChart(self, chart):
	from java.lang import Math
	from java.util import ArrayList
	from org.jfree.chart.axis import LogarithmicAxis, NumberTick
	from org.jfree.ui import TextAnchor
	
	class LabelAllLogTicksAxis(LogarithmicAxis):
		def refreshTicksVertical(self, g2, dataArea, edge):
			lowerBound = self.range.lowerBound
			upperBound = self.range.upperBound
			
			ticks = ArrayList()

			# lowerGuard variable added by rpavlicek to cover cases where the lower bound is less than or equal to zero			
			lowerGuard = lowerBound if lowerBound > 0 else 1e-10
			startingDecade = int(Math.floor(Math.log10(lowerGuard)))
			endingDecade = int(Math.ceil(Math.log10(upperBound)))
		
			for decade in xrange(startingDecade, endingDecade):
				base = 10.0 ** decade
				for multiplier in xrange(1, 10):
					value = multiplier * base
					
					# Added to remove a negative label that was appearing below the lower bound
					if value < lowerBound or value > upperBound:
						continue
					
					# https://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/axis/NumberTick.html
					# NumberTick(Number number, String label, TextAnchor textAnchor, TextAnchor rotationAnchor, double angle)
					ticks.add(NumberTick(value, unicode(value), TextAnchor.CENTER_RIGHT, TextAnchor.CENTER_RIGHT, 0.0))
		
			return ticks
	
	plot = chart.plot
	oldLogAxis = plot.rangeAxis
	newLogAxis = LabelAllLogTicksAxis(oldLogAxis.label)
	newLogAxis.range = oldLogAxis.range
	plot.rangeAxis = newLogAxis

```

**Edit:** Added lower guard variable developed by @rpavlicek that covers cases where the lower bound of the chart is less than or equal to zero

---

<div class="post-metadata">

**Author:** ![rpavlicek](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rpavlicek/32/55868_2.png) [@rpavlicek](https://forum.inductiveautomation.com/u/rpavlicek)\
**Post date:** [December 22, 2025, 3:49pm UTC](https://forum.inductiveautomation.com/t/vision-chart-possible-to-show-minor-tick-labels-on-logarithmic-axis/109651/4 "2025-12-22T15:49:46Z")

</div>

Thank you for providing this, I do however get an error: “Error Drawing Chart” - “OverflowError: cannot convert float infinity to long” on these lines:

```python
  startingDecade = int(Math.floor(Math.log10(lowerBound)))
  endingDecade = int(Math.ceil(Math.log10(upperBound)))

```

If I change the two int to float, I get the same error on a different line:

> ```python
> for decade in xrange(startingDecade, endingDecade):
> 
> ```

I’m trying to work through this now to resolve. Might be a None type or negative that’s messing with it.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 22, 2025, 3:56pm UTC](https://forum.inductiveautomation.com/t/vision-chart-possible-to-show-minor-tick-labels-on-logarithmic-axis/109651/5 "2025-12-22T15:56:47Z")

</div>

You cannot have a lower bound of zero on a logarithmic scale. That makes negative infinity. (Nor any negative lower bound.)

The error is intrinsic--it's fundamental math.

---

<div class="post-metadata">

**Author:** ![rpavlicek](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rpavlicek/32/55868_2.png) [@rpavlicek](https://forum.inductiveautomation.com/u/rpavlicek)\
**Post date:** [December 22, 2025, 4:20pm UTC](https://forum.inductiveautomation.com/t/vision-chart-possible-to-show-minor-tick-labels-on-logarithmic-axis/109651/6 "2025-12-22T16:20:39Z")

</div>

Yes, I put a safe guard in place and works great. Thanks to @justinedwards.jle !

```python
            lowerGuard = lowerBound if lowerBound > 0 else 1e-10 
            startingDecade = int(Math.floor(Math.log10(lowerGuard)))
            endingDecade = int(Math.ceil(Math.log10(upperBound)))

```
