DMelt:Plots/7 Charts

From HandWiki
Limitted access. First login to DataMelt member area if you are a full DataMelt member.


Charts

A chart is a graphical representation of data. Charts can be shown as bars (in a bar chart), lines (in a line chart), slices (in a pie chart) etc. Read the Chart article.

In DataMelt, jhplot.HChart jhplot.HChart canvas is used for showing charts. container. This canvas is important since it is the main canvas for the Android version of DataMelt and is based on JFreeChart. Here we will show a simple example based on Jython:

No access. To show this code, login to DataMelt member area

The output shows pie charts and XY data as shown below:

DMelt example: Charts based on the HChart

Charts using jFreeChart

You can create plots using jFreeChart. One advantage of using jFreeChart is that it allows to build very custom plots (although less interactive than other canvases). When using with DataMelt, one can use the Dmelt methods for exporting JFreeChart images to EPS, PDF, SVG.0

Here is a small Jython/Python example that uses the jFreeChart API:

No access. Members can view this part after login to DataMelt member area

To learn about "chart" object, type "help.doc(chart")". The output of this code is a high-quality image :

DMelt example: A pie chart using jFreeChart

You can use jFreeChart for timeseries, charts, line plots, etc.