Area Charts in Iceberg Charts

It is now possible to create area charts in Iceberg Charts that look something like this :


This area chart behaves pretty much like a linear XY-chart with the area to the X-axis filled in.

The code looks something like this :

It is pretty much the same as any standard XYCharts. All you have to do is is to set an Area object with a transparancy color onto the XYDataSeries like this :

xyDataSeries.setArea(new Area(new Color(12, 233, 3, 80)));

That’s all there is to it! It is important to add transparancy to the color or the chart will lose its effectiveness. You can checkout out the code in the com.frontangle.ichart.main.test.area package.

Also, by adding the area type ‘STACKED’ to your area object like this :

xyDataSeries.setArea(new Area(new Color(12, 233, 3, 80),Area.AreaType.STACKED));

..your area chart will become a ‘stacked’ area chart (provided all the xy data series are also ‘stacked’ ). A stacked area chart is where the area between the series are filled in. A series cannot criss cross with another series as that would defeat the stacked nature. Here is an example I created which uses immigration by different regions to Australia.


Iceberg charts version 1.2.0 is out now!

For all your Swing, Java, Java2D charting needs, simply add this to your maven file and start using it straight away!

Posted in Iceberg Charts | Tagged , , | Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">