21 HChart class. Making various charts

The class is very similar to the HPlot one. The HChart canvas allows the user to create various charts (pie chart, bar char, histogram chart, line chart, area chart). All charts are based on the jFreeChart packagehttp://www.jfree.org/ library. This is a simple example of how to create a Pie chart:

>>> c1 = HChart("Canvas")
>>> c1.setGTitle("Chart examples")
>>> c1.visible()

>>> c1.setChartPie()
>>> c1.setName("Pie example")
>>> c1.valuePie("Hamburg",1.0)
>>> c1.valuePie("London",2.0)
>>> c1.valuePie("Paris",1.0)
>>> c1.valuePie("Bern",1.0)
>>> c1.update()

More complicated examples can be found in the "example" directory.

When HChar canvas is created, one can set the following charts:

Then you can add values using "value"+"ChartName"() method. For example, to add a values to Bar chart use "valueBar()" method. Check HChart API for details. Finally, to display a chart, execute "c1.update()" method.

You can access many jFreeChart components via several "get" methods. For example, "c1.getChar()" will return JFreeChart class for further manipulations.