JFree Chart Custom Tag up on RiaForge

I finally managed to get around and upload Version 1 of my JFree Chart custom tag onto riaforge.

I typically use the import statement when using custom tags in the below examples I have imported the custom tag line so:

<cfimport taglib="jfreeChart" prefix="jf">
Here are a few screen shots and some example code

Bar Chart


<jf:jfreechart chartType="bar" height="650" width="450" showmarkers="true" showlabels="true" title="Bar Chart Example" categoryAxisLabel="Tasks" categoryValueLabel="Date" createImageMap="true">
   <jf:jfSeries seriesLabel="Series 1" serieslinethickness="3" query="#s1#" itemColumn="column" valueColumn="value" seriesColorHEX='cc0000' colorlist="cc0000,F5A529,999999">
   <jf:jfSeries seriesLabel="Series 2" serieslinethickness="3" query="#s2#" itemColumn="column" valueColumn="value" seriesColorHEX='F5A529' colorlist="cc0000,F5A529,999999">
   <jf:jfSeries seriesLabel="Series 3" serieslinethickness="3" query="#s3#" itemColumn="column" valueColumn="value" seriesColorHEX='999999' colorlist="cc0000,F5A529,999999">
</jf:jfreechart>

Pie Chart


<jf:jfreechart chartType="pie" height="650" width="450" showmarkers="true" showlabels="true" title="Pie Chart Example" categoryAxisLabel="Tasks" categoryValueLabel="Date" createImageMap="true">
   <jf:jfSeries seriesLabel="Pie Series" serieslinethickness="3" query="#s3#" itemColumn="column" valueColumn="value" colorlist="cc0000,F5A529,999999">
</jf:jfreechart>

Scatter Chart


<jf:jfreechart chartType="scatter" height="550" width="450" showmarkers="true" showlabels="true" title="Scatter Chart Example" categoryAxisLabel="Random" categoryValueLabel="values" createImageMap="true">
   <jf:jfSeries seriesLabel="Scatter Series 1" serieslinethickness="3" query="#scatter1#" itemColumn="column" valueColumn="value" colorlist="cc0000,F5A529,999999">
   <jf:jfSeries seriesLabel="Scatter Series 2" serieslinethickness="3" query="#scatter2#" itemColumn="column" valueColumn="value" seriesColorHEX='F5A529' colorlist="cc0000,F5A529,999999">
   <jf:jfSeries seriesLabel="Scatter Series 3" serieslinethickness="3" query="#scatter3#" itemColumn="column" valueColumn="value" seriesColorHEX='F5A529' colorlist="cc0000,F5A529,999999">

</jf:jfreechart>

Gantt Chart


<jf:jfreechart chartType="gantt" height="650" width="450" showmarkers="true" showlabels="true" title="Gantt Chart Example   " categoryAxisLabel="Tasks" categoryValueLabel="Date" createImageMap="true">
   <jf:jfTaskSeries seriesLabel="Project Time Line" serieslinethickness="3" query="#gantt#" startdatecolumn="start" enddatecolumn="end" taskNameColumn="task" PercentCompleteColumn="complete" seriesColorHEX='cc0000' >
</jf:jfreechart>

Related Blog Entries

Comments
PaulH's Gravatar does jfree have high-low stock chart types? what exactly does it buy you over cfchart?
# Posted By PaulH | 2/16/08 8:07 AM
Gary's Gravatar Jfree indeed has high low stock chart types as well. The number of chart
options is really quite good.

What it buys you is an alternative charting option over cfchart. You can of course
access webcharts directly but using cfchart alone you are limited to 11 chart types.

I also decided to build this as a custom component because we are doing a project where we are integrating a Pentaho Reporting solution which, I believe, uses JFree chart as its charting engine.
# Posted By Gary | 2/16/08 4:53 PM
msj's Gravatar Hi,
can jfreechart create time line charts like this:
http://www.timelinemaker.com/product-samplecharts-...

thanks,
MsJ
# Posted By msj | 2/22/08 11:21 PM
PaulH's Gravatar gary,

i think i found a need for jfree chart, though mind if i ask if you've ever mixed graph types (say line & scatter) in the same chart? if so ever used sparse & dense data series? i need to plot a line chart w/2-3k worth of points as well as a scatter plot with only 2 or 3 points. cfchart interpolates the sparse series to match the dense one & borks the graph completely. a job for jfree chart?

thanks.
# Posted By PaulH | 3/31/08 4:07 AM
Gary's Gravatar @ Paul,

Jfree allows you to do overlaid charts which sounds like what you are trying to do.

You can also do multi-axis charts where the 2-3k datapoints can be on one axis, and your 2-3 points on another axis if they have at least one thing in common, if not
then overlaid sounds like the solution.
# Posted By Gary | 3/31/08 4:19 AM
PaulH's Gravatar this example takes a "clever" approach that might do the trick:

http://www.java2s.com/Code/Java/Chart/JFreeChartLi...

turns the lines off to create a "scatter" plot ;-)

btw i'm looking at your code & see "returnChartAsImage" attribute but don't see it used anywhere, am i missing something?

thanks.
# Posted By PaulH | 3/31/08 10:55 AM
Gary Gilbert's Gravatar Paul,

yeah that, well you see the thing is...erm...It's depreciated yeah thats it!

I decided to go with single attribute createImageMap (true/false) if it's false it returns just the
image if its true it returns an image map.

The next update will have that removed as well as provide for a spider chart.
# Posted By Gary Gilbert | 3/31/08 12:16 PM