File Exchange

image thumbnail

Dialplot Demo 4, Multiple needle

version (71 KB) by Sven Koerner
Dialplot Demo with multiple needles. Uses JFreeChart and MAtlab.


Updated 16 Feb 2011

View License

Dialdemo alá JFreeGraph-Demo

The code behind is just a demo of what is possible with JFreeChart using it in Matlab. I played a little
with codesnippets I found on the web and the API-Documentation.
( When you want to explore the whole functionality,
I think it is better to buy the JFreeChart Developer Guide (

This function shows a Dial as an example of JFreeChart ( The Idea
to this code is based on the UndocumentedMatlab-Blog of Yair Altman, who shows a sample Code of JFreeChart
for creating a PieChart (

Within the plot you can modify the values for the needles by using the sliders.

Before this demo works, you need to download JFreeChart and make matlab get to know with it. There are 2
ways you can do this:

1. Add the jcommon and jfreechart jar to the dynamic matlab JavaClassPath (uncommented lines in the first
cell an change path to your local installation path)
2. Add the jcommon and jfreechart jar to the static matlab JavaClassPath (see Matlab Help, modify
classpath.txt on matlabroot\toolbox\local)

Finally you must donwload jcontrol from Malcom Lidierth

Bugs and suggestions:
Please send to Sven Koerner: koerner(underline)sven(add)

You need to download and install first:

Cite As

Sven Koerner (2019). Dialplot Demo 4, Multiple needle (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (3)


Thanks Sven. Instead of using the slider callback, can you advise how you would pass a value for the needle into this function?

Sven Koerner

Of course it is possible to generate more than one Dialplot-object. You can control it with the jcontrol-line. Therefore you need to create a second Dialplot and than arrange it with jcontrol.


Works beautifully, but I can't seem to be able to create more than one DialPlot object. Repeated calls to the constructor just return the original reference. Any advice?

MATLAB Release Compatibility
Created with R2010a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired by: Using Java Swing components in MATLAB