How to change color of timestamp and line of X-Trace in Chart

Hello am formation a Chart and I change label color backround and font for X-trace but The font and color of my timestamp don't change and I don't know how to acces. Any one have an idea.


I'm not sure how you could change the background color of the crosshair label, but obviously, you already know how to add your own annotation labels, so I'll tell you how to get rid of the timestamp label at the bottom, and you can replace it with a label of your own.

# Written for the configureChart extension function 
#def configureChart(self, chart):
	from java.text import SimpleDateFormat
	from org.jfree.chart.axis import DateAxis
	pureDateFormat = SimpleDateFormat("")
	pureTimeFormat = SimpleDateFormat("")			
	dateAxis = DateAxis()
	plot = chart.getPlot()
	plotField1 = plot.getClass().getDeclaredField('dateFormat')
	plotField2 = plot.getClass().getDeclaredField('timeFormat')
	plotField1.set(plot, pureDateFormat)
	plotField2.set(plot, pureTimeFormat)

I originally developed this script for changing the date format of the timestamp label to "yyyy/MM/dd", but I found that if you change the date and time formats to empty strings, the label disappears.


1 Like

Thank for your time Is I been using a previous post you have write for annotation label :smiley: So am gonna just add a date format annotation format and with the color I want. Its really appreciated.