# Hide the grid-line of bar chart in python script

**URL:** <https://forum.inductiveautomation.com/t/hide-the-grid-line-of-bar-chart-in-python-script/21394>\
**Category:** Ignition\
**Created:** [December 13, 2018, 8:07am UTC](https://forum.inductiveautomation.com/t/hide-the-grid-line-of-bar-chart-in-python-script/21394 "2018-12-13T08:07:18Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [December 13, 2018, 8:07am UTC](https://forum.inductiveautomation.com/t/hide-the-grid-line-of-bar-chart-in-python-script/21394/1 "2018-12-13T08:07:18Z")

</div>

I want to know how to hide the grid-line of bar chart in python script.  
I start with .getChart().getPlot() but I don’t know how to access gridline color.  
barchart= event.source  
plot = barchart.getChart().getPlot()

---

<div class="post-metadata">

**Author:** ![schenk](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@schenk](https://forum.inductiveautomation.com/u/schenk)\
**Post date:** [December 13, 2018, 2:08pm UTC](https://forum.inductiveautomation.com/t/hide-the-grid-line-of-bar-chart-in-python-script/21394/2 "2018-12-13T14:08:10Z")

</div>

You can set visibility with the following.

```auto
barChart = event.source
plot = barChart.getChart().getPlot()
plot.setRangeGridlinesVisible(0)

```

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [December 13, 2018, 2:49pm UTC](https://forum.inductiveautomation.com/t/hide-the-grid-line-of-bar-chart-in-python-script/21394/3 "2018-12-13T14:49:13Z")

</div>

Thanks schenk.  
Could you tell me how to change the axis tick color?  
Every time the value of bar chart change, it refresh itselft, the gridline show and hide again. Is it possible to disable this behavior?

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/c/cd2045d6bc3e7c1689b517ef616810294876d83e.jpg)

Could you tell me how did you find this information?

---

<div class="post-metadata">

**Author:** ![schenk](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@schenk](https://forum.inductiveautomation.com/u/schenk)\
**Post date:** [December 13, 2018, 3:28pm UTC](https://forum.inductiveautomation.com/t/hide-the-grid-line-of-bar-chart-in-python-script/21394/4 "2018-12-13T15:28:01Z")

</div>

The axis tick color can be changed within the Property Editor

You can find information about all of the classes here:  
[http://files.inductiveautomation.com/sdk/javadoc/ignition79/795/index.html](http://files.inductiveautomation.com/sdk/javadoc/ignition79/795/index.html)

If you need to find the type of object or its methods/fields, you can put this code in a button on the screen. It will output the info to the console in the designer.

```auto
comp = event.source.parent.getComponent('componentName')
print type(comp) # Prints the component type. You can then find this in the above link.
print dir(comp) # Prints all fields and methods for the component.

```

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [December 13, 2018, 3:30pm UTC](https://forum.inductiveautomation.com/t/hide-the-grid-line-of-bar-chart-in-python-script/21394/5 "2018-12-13T15:30:35Z")

</div>

They only change label not the gray line. As you see there is a gray line beside axis value.

---

<div class="post-metadata">

**Author:** ![jpark](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jpark](https://forum.inductiveautomation.com/u/jpark)\
**Post date:** [December 13, 2018, 3:34pm UTC](https://forum.inductiveautomation.com/t/hide-the-grid-line-of-bar-chart-in-python-script/21394/6 "2018-12-13T15:34:52Z")

</div>

`plot.setOutlinePaint(None)`

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [December 13, 2018, 3:38pm UTC](https://forum.inductiveautomation.com/t/hide-the-grid-line-of-bar-chart-in-python-script/21394/7 "2018-12-13T15:38:21Z")

</div>

plot.setOutlinePaint(None)  
not working still there.

---

<div class="post-metadata">

**Author:** ![schenk](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@schenk](https://forum.inductiveautomation.com/u/schenk)\
**Post date:** [December 13, 2018, 4:20pm UTC](https://forum.inductiveautomation.com/t/hide-the-grid-line-of-bar-chart-in-python-script/21394/8 "2018-12-13T16:20:20Z")

</div>

That line can be removed with this:

`plot.getRangeAxis().setAxisLineVisible(0)`

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [December 13, 2018, 4:35pm UTC](https://forum.inductiveautomation.com/t/hide-the-grid-line-of-bar-chart-in-python-script/21394/9 "2018-12-13T16:35:45Z")

</div>

plot.getRangeAxis().setAxisLineVisible(0)  
No luck the gray border is still remain 😓

---

<div class="post-metadata">

**Author:** ![schenk](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@schenk](https://forum.inductiveautomation.com/u/schenk)\
**Post date:** [December 13, 2018, 4:45pm UTC](https://forum.inductiveautomation.com/t/hide-the-grid-line-of-bar-chart-in-python-script/21394/10 "2018-12-13T16:45:12Z")

</div>

How/where are you running this code?

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [December 13, 2018, 4:47pm UTC](https://forum.inductiveautomation.com/t/hide-the-grid-line-of-bar-chart-in-python-script/21394/11 "2018-12-13T16:47:34Z")

</div>

In window open event and bar chart property change event.  
I put it in property change event because every time the value changes the bar back to its default configuration, gridline come back to visible!!

barChart = event.source  
plot = barChart.getChart().getPlot()  
plot.setRangeGridlinesVisible(0)  
plot.getRangeAxis().setAxisLineVisible(0)  
the grid hide but the gray outline is still there.

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/8/89250eecfe859ad28490877a70db279003d57ab6.jpg)

---

<div class="post-metadata">

**Author:** ![schenk](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@schenk](https://forum.inductiveautomation.com/u/schenk)\
**Post date:** [December 13, 2018, 5:26pm UTC](https://forum.inductiveautomation.com/t/hide-the-grid-line-of-bar-chart-in-python-script/21394/13 "2018-12-13T17:26:09Z")

</div>

FYI, if you use triple back-ticks before and after your code, it will format nicely.

You may need to include this also

> [@jpark](#):
>
> plot.setOutlinePaint(None)

I was able to get this to work in a client:

```auto
if event.propertyName in ['data', 'componentRunning']:
	plot = event.source.getChart().getPlot()
	range = plot.getRangeAxis()
	domain = plot.getDomainAxis()

	plot.setRangeGridlinesVisible(0)
	plot.setOutlinePaint(None)
	range.setAxisLineVisible(0) # Remove left line
	domain.setAxisLineVisible(0)	# Remove bottom line

```

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [December 13, 2018, 5:43pm UTC](https://forum.inductiveautomation.com/t/hide-the-grid-line-of-bar-chart-in-python-script/21394/14 "2018-12-13T17:43:55Z")

</div>

Thank you very much schenk.  
I just see some some annoying refreshing every time input data change for bar chart. It causes every thing back to its default and set again. (fast blink in gridlines, axis hide/show).  
Is there a way to disable refreshing of Bar component?

---

<div class="post-metadata">

**Author:** ![jpark](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jpark](https://forum.inductiveautomation.com/u/jpark)\
**Post date:** [December 13, 2018, 5:47pm UTC](https://forum.inductiveautomation.com/t/hide-the-grid-line-of-bar-chart-in-python-script/21394/15 "2018-12-13T17:47:08Z")

</div>

I would switch over to the regular chart component and set it to the category Plot.

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [December 13, 2018, 5:54pm UTC](https://forum.inductiveautomation.com/t/hide-the-grid-line-of-bar-chart-in-python-script/21394/16 "2018-12-13T17:54:09Z")

</div>

like bar chart in regular chart doesn’t have gridlines color property so I need again write those code and it blink each time the data changes.

---

<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 13, 2018, 6:02pm UTC](https://forum.inductiveautomation.com/t/hide-the-grid-line-of-bar-chart-in-python-script/21394/17 "2018-12-13T18:02:57Z")

</div>

In a regular chart you can put your adjustments in the configureChart method (with some edits) which is run before the first paint event.
