Use of JfreeChart

Hi everyone,

I realise that the charting object is based on jfreechart.org. Is there a way to use the full range of charting features of the jfreechart package?

I was hoping to do some contour plot, or similar, which according to the jfreechart website is achieved through an XYPlot with XYBlockRenderer.

I assume I first create a classic chart and then use ‘configureChart’ extension function to manipulate its properties?

Would anyone have some suggestions as to how to start this? I am assuming that within the extension function I’ll have to create a new renderer, as well as an XYZDataset and then somehow write these into the chart’s properties. The renderer, I think I may be able to manage :open_mouth: , but how do I create the XYZDataset? Will I automatically have an XYZDataset if my ClassicChart’s data is a table with 3 columns?

Cheers
Koen

Hello Koen,

I realize this is a bit old, but I am just starting to investigate something very similar to your post.
If you had made any progress and are willing to share some code snippets with me I would greatly appreciate it.

Thanks,

Jake

It is also possible to create a new Ignition module and create a new Chart component.

Best,

[quote=“nmudge”]It is also possible to create a new Ignition module and create a new Chart component.[/quote]Yes, this is definitely the way to go. There’s a whole host of pitfalls if you end up accidentally serializing any jython classes you create in your implementation. Been there, done that. /-:
You can safely subclass the existing chart components in a java module to minimize the new code you’ll need. My NoteChart module is less than 3000 LOC.

How can we get Annoted Text from Jfree Annoted Chart. When I tried “getAnnotations()” syntax I am getting output something in this form "org.jfree.chart.annotations.CategoryTextAnnotation@a0943fdc"
How can we get the output in readable format?

It looks like you should be able to call .getText() on the CategoryTextAnnotation in order to get the text value.

https://www.jfree.org/jfreechart/javadoc/org/jfree/chart/annotations/CategoryTextAnnotation.html

2 Likes

Appreciative. Thank you!