Vision XY Chart Dot Renderer Size and Fill

Hello.

I've been fighting the vision XY plot for a bit, and realized it's likely an issue someone else has had before.

I don't like how the shape renderer looks, and want to use dots instead.

The default dot renderer only renders 1x1 pixel dots. I want to use 3x3 dots instead (ideally I could use circles rather than squares, but beggars cant be choosers).

Looking at some past forum posts, it seems like you can do something like

def configureChart(self, chart):
  from org.jfree.chart.renderer.xy import XYDotRenderer
  from java.awt import Color
  dotRenderer = XYDotRenderer()
  dotRenderer.setDotWidth(4)
  dotRenderer.setDotHeight(4)	
  chart.getXYPlot().setRenderer(dotRenderer)

However, this sets it to render with a selected set of colours. Is there a way to change this set of colours?

I feel like I should be able to use something like "setSeriesFillPaint" from XYItemRenderer (JFreeChart 1.5.0 API) for each series, but I get an error saying that method does not exist. Possibly the JFreeChart used is not the same version as the one in the API I am looking at.

2 Likes