Hi , I have figured this out and here the solution.
All following scripts were added to window custom methods and were called when internalFrameActivated and when from other window events(if needed).
For Changing the Axis Color:
def boxPlox_axis(self, event):
from org.jfree.chart.ChartPanel import getChart
from java.awt import Color
from org.jfree.chart.axis import Axis
JFreechart = getChart(system.gui.getParentWindow(event).getComponentForPath('Root Container.Box and Whisker Chart')) #Jfree Get Chart
boxPlotComponent = system.gui.getParentWindow(event).getComponentForPath('Root Container.Box and Whisker Chart') #Boxplot component
boxPlot = JFreechart.getCategoryPlot() #As Boxplot is a category plot type, Get Category Plot from chart
axisY = boxPlot.getRangeAxis()# Get Y Axis of Boxplot ##.getPlotType()#.getCategories()
axisX = boxPlot.getDomainAxis()#Get X Axis of the Boxplot
white = Color(255,255,255,255) #Declare Color, White
axisY.setTickLabelPaint(white) #Set Y Axis tick label
axisX.setTickLabelPaint(white) #Set X Axis tick label
axisY.setLabelPaint(white)#Set Y Axis label
For adding threshold / range bands:
def boxPlox_intervalMarker(self, event):
from org.jfree.chart.ChartPanel import getChart
from java.awt import Color
from org.jfree.ui import Layer
from org.jfree.chart.plot import IntervalMarker
JFreechart = getChart(system.gui.getParentWindow(event).getComponentForPath('Root Container.Box and Whisker Chart')) #Jfree Get Chart
boxPlotComponent = system.gui.getParentWindow(event).getComponentForPath('Root Container.Box and Whisker Chart') #Boxplot component
boxPlot = JFreechart.getCategoryPlot() #As Boxplot is a category plot type, Get Category Plot from chart
threshold_Hi = system.gui.getParentWindow(event).getComponentForPath('Root Container').threshold_Hi
threshold_HiHi = system.gui.getParentWindow(event).getComponentForPath('Root Container').threshold_HiHi
threshold_Lo = system.gui.getParentWindow(event).getComponentForPath('Root Container').threshold_Lo
threshold_LoLo = system.gui.getParentWindow(event).getComponentForPath('Root Container').threshold_LoLo
OutsideLimitColor = Color(140, 47, 57,255)
InsideLimitColor = Color(106, 153, 78,255)
boxPlot.addRangeMarker(0,IntervalMarker(threshold_LoLo,threshold_HiHi, OutsideLimitColor),Layer.BACKGROUND)
boxPlot.addRangeMarker(0,IntervalMarker(threshold_Lo,threshold_Hi, InsideLimitColor),Layer.BACKGROUND)
For changing / repainting the box colors based on the threshold / range limits:
def boxPlox_axis(self, event):
from org.jfree.chart.ChartPanel import getChart
from java.awt import Color
from org.jfree.chart.renderer.category import BoxAndWhiskerRenderer
JFreechart = getChart(system.gui.getParentWindow(event).getComponentForPath('Root Container.Box and Whisker Chart')) #Jfree Get Chart
boxPlotComponent = system.gui.getParentWindow(event).getComponentForPath('Root Container.Box and Whisker Chart') #Boxplot component
boxPlot = JFreechart.getCategoryPlot() #As Boxplot is a category plot type, Get Category Plot from chart
lightBlue = Color(150,205,255,255)
red = Color(248, 141, 173,255)
threshold_Hi = system.gui.getParentWindow(event).getComponentForPath('Root Container').threshold_Hi
threshold_HiHi = system.gui.getParentWindow(event).getComponentForPath('Root Container').threshold_HiHi
threshold_Lo = system.gui.getParentWindow(event).getComponentForPath('Root Container').threshold_Lo
threshold_LoLo = system.gui.getParentWindow(event).getComponentForPath('Root Container').threshold_LoLo
class MyRenderer(BoxAndWhiskerRenderer):
def getItemPaint(self,series,row):
Q1 = boxPlot.getDataset(0).getQ1Value(series, row)
Q3 = boxPlot.getDataset(0).getQ3Value(series, row)
if series == 0 and Q1 < threshold_Lo or Q3 > threshold_HiHi:
return red
else:
return lightBlue
renderer = MyRenderer()
boxPlot.setRenderer(renderer)