# Change each bar width in histogram chart

**URL:** <https://forum.inductiveautomation.com/t/change-each-bar-width-in-histogram-chart/66847>\
**Category:** Ignition\
**Tags:** vision, scripting\
**Created:** [November 23, 2022, 11:49am UTC](https://forum.inductiveautomation.com/t/change-each-bar-width-in-histogram-chart/66847 "2022-11-23T11:49:56Z")\
**Posts on this page:** 1\
**Showing post:** 39

<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:** [March 8, 2023, 5:18am UTC](https://forum.inductiveautomation.com/t/change-each-bar-width-in-histogram-chart/66847/39 "2023-03-08T05:18:17Z")

</div>

> [@prasath.t](#):
>
> tired your tooltip script for area bar
> 
> but that also not working.

I'm sorry you had trouble figuring out. I was able to adapt the tool tip script to your usage case. **Here is the script:**

```auto
#def configureChart(self, chart):
	from java.awt import BasicStroke, Color
	from org.jfree.chart.annotations import XYTextAnnotation
	plot = chart.getPlot()
	plot.setOutlineStroke(BasicStroke(1))
	plot.setOutlinePaint(Color.black)
	for annotation in plot.getAnnotations():
		if isinstance(annotation, XYTextAnnotation):
			plot.removeAnnotation(annotation)

	#This will be your WO datset, so correct the path accordingly
	labelData = self.parent.getComponent('Power Table 1').data
	
	barData = self.parent.getComponent('Power Table').data
	for row in range(0, labelData.rowCount - 1):
		text = str(labelData.getValueAt(row, 1))
		startTime = float(barData.getValueAt(row, 0).getTime())
		endTime = float(barData.getValueAt(row + 1 , 0).getTime())
		topBound = float(barData.getValueAt(row, 2))
		bottomBound = float(barData.getValueAt(row, 1))
		x = (startTime + endTime) * .5
		y = (topBound + bottomBound) * .5
		annotation = XYTextAnnotation(text, x, y)
		plot.addAnnotation(annotation)

```

**Here is the result:**

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

---

_[View the full topic](https://forum.inductiveautomation.com/t/change-each-bar-width-in-histogram-chart/66847)._
