Get rid of Date in X axis in Status chart

Hi all,

I am trying to remove the date axis in a status chart but I have got only halfway there. I managed to get the date hidden but can’t guess what is the right propertyName to use to trigger the code in the propertyChange script. I am using the following code and it works but only if you hover over the chart with the mouse. Any suggestions? Thanks!

Have you tried just setting the showRangeAxis property of the status chart to false in the Property Editor? No script required


Sorry for not being clear I want to keep the X axis but get rid of the bit that shows the date.
Like that:

Not like that:

I can get the code to work but it does trigger only if I hover over on the item.

Are you trying to hide it and have the chart resize itself based on the new space? If not, and you just need to hide the text, try putting a rectangle with the same fill color as the background. Make sure the layout modes match and you should be good to go.

1 Like

I have been attempting to figure out the same thing, and your post has helped me get pretty close.

First if the data for the status chart is not updating then the data property will not change, so your code will not be executed.

In my particular case the status chart has a tag history binding with the polling mode set to relative and a polling rate set to 15 sec.

The first thing that I did was to add the needed script to the internalFrameActivated event on the window, again my particular case has multiple charts so my code is slightly different for that reason.

The next thing I did was to add a similar script to the property change event of the status chart, but I filtered for data and propertiesLoading.

if event.propertyName in ['data','propertiesLoading']:
	axis = event.source.getChart().getPlot().getRangeAxis()

This all seems a bit hacky to me, so I was wondering if you or anyone else had ever come up with a final (better) solution, as mine seems to work with the exception of the occasional flash of the date during a redraw event.


Is there maybe some way to use jFreeChart to accomplish this? overriding the setDiplayDayInTitle property works but there is still something that is forcing a redraw which I can’t seem to catch.