YOUR FEEDBACK
John Portnov wrote: This code does not work for me. I created a new website and a C# console applic...
AJAXWorld RIA Conference
$300 Savings Expire August 22
Register Today and SAVE!


2008 East
DIAMOND SPONSOR:
Data Direct
Frontiers in Data Access: The Coming Wave in Data Services
PLATINUM SPONSORS:
Red Hat
The Opening of Virtualization
Intel
Virtualization – Path to Predictive Enterprise
Green Hills
IT Security in a Hostile World
JBoss / freedom oss
Practical SOA Approach
GOLD SPONSORS:
Software AG
The Art & Science of SOA: How Governance Enables Adoption
PlateSpin
Effective Planning for Virtual Infrastructure Growth
Fujitsu
Automated Business Process Discovery & Virtualization Service
Ceedo
Workspace Virtualization
Click For 2007 West
Event Webcasts

2008 East
PLATINUM SPONSORS:
Appcelerator
Think Fast: Accelerate AJAX Development with Appcelerator
GOLD SPONSORS:
DreamFace Interactive
The Ultimate Framework for Creating Personalized Web 2.0 Mashups
ICEsoft
AJAX and Social Computing for the Enterprise
Kaazing
Enterprise Comet: Real–Time, Real–Time, or Real–Time Web 2.0?
Nexaweb
Now Playing: Desktop Apps in the Browser!
Sun
jMaki as an AJAX Mashup Framework
POWER PANELS:
The Business Value
of RIAs
What Lies Beyond AJAX?
KEYNOTES:
Douglas Crockford
Can We Fix the Web?
Anthony Franco
2008: The Year of the RIA
Click For 2007 Event Webcasts
SYS-CON.TV
TOP COLDFUSION LINKS


Not Your Father's Charting
A guide to the revamped ColdFusion MX 7 charting feature

Since charting was first added to ColdFusion back in version 5, it has consistently provided a lot of customer feedback - both positive and negative. We listened to all of the comments and studied the long enhancement list. Developers are sure to be pleased with the number of charting wishes that have been fulfilled in ColdFusion MX 7. Charting isn't a new feature, but we've definitely given it an "extreme makeover" for this release!

Charts with Style
Did you know that there are more than 45 attributes used to define charts with CFCHART and its subtags? This makes for messy code and a big challenge to get all of your site's charts to share a consistent look and feel. In ColdFusion MX 7, we've added the idea of chart "styles." These are external definitions of all information to specify a chart's look and behavior. All you need to do in your CFM pages now is specify the data and which style to use. Of course, you can still use the old, familiar attributes as well. It's your choice.

ColdFusion MX 7 ships with a number of chart styles pre-defined and named for the color scheme that they use: beige, blue, red, silver, yellow, and a default style. They are stored in an XML file, and you can see them in your cfusion\charting\styles directory. Any of these styles can be used by name in any ColdFusion template. For example:


<cfchart style="silver">
...
</cfchart>

These styles look pretty nice, but there are many ways that you can customize them beyond the colors they use. The simplest way is to modify one of these built-in styles. In addition, you can use the WebCharts 3D Desinger tool, included in ColdFusion MX 7, to create your own from scratch.

If you want to modify one of the basic styles, open it in any text editor, make your changes, and save it with a new name. If you keep it in the cfusion\charting\styles directory, ColdFusion pages can call it with the new name (myChart.xml = <cfchart style="myChart">) or you can save it elsewhere and call it in the same way you use cfinclude (e.g. a web directory or mapping). So, c:\inetpub\wwwroot\charts\myChart.xml = <cfchart style="\charts\myChart.xml">).

The WebCharts3D Designer, created by GreenPoint, Inc., is a tool with advanced style creation and editing that you can use to create far more customized charts. You can use the tool by following these steps:

  1. Start WebCharts3D by running the webcharts.bat file in the CFusionMX7\charting directory.
  2. Select the type of chart you'd like to use.
  3. On the design tab, make the changes you want to the chart's appearance. (There is a help tab with a chapter called "Designer" that also contains information on using the tool.)
  4. Click on the XML Style tab.
  5. Click the save button.
  6. Name the style with a .xml extension (myChartStyle.xml).
You can then use the style above by either saving it to cfusion\charting\styles or another directory.

With custom chart styles, we should be able to finally say goodbye to the days of users needing to ask Macromedia, "Can you add an attribute to let me configure such and such?" Now you can control every small detail of your chart's look from colors and fonts to axis scales and number formatting and save it in an external file for easy reuse.

From Monochrome to Multicolor
Another item that was near the top of our CFCHART wish list is the ability to create bar charts in which each bar is a different color. With ColdFusion MX 7, it's not only possible, it's downright easy, thanks to the new colorList attribute of the chartseries tag.

Let's say you're creating a bar chart that shows sales for the previous four quarters. To remind your audience which quarter is which, you decide to color code the data by season with icy blue for winter, pink for spring, green for summer, and orange for fall. Your code would look something like this:


<cfchart>

 <cfchartseries type="bar" colorlist="3366FF,FF3399,green,FF6600">
  <cfchartdata item="winter" value="30">
  <cfchartdata item="spring" value="36">
  <cfchartdata item="summer" value="40">
  <cfchartdata item="autumn" value="33">
 </cfchartseries>

</cfchart>

ColdFusion will use each color in the color list for each successive individual bar. If you have more data items than colors in the list, it will start back at the beginning. Of course, you could also create a custom chart style as explained above with the colors you'd like, but this is a fast and easy way to override the colors in an individual series.

En-Title-ment
Support for specifying a chart title came in ColdFusion 5...and went in ColdFusion MX. But now it's back. For example,


	<cfchart title="Our Best Year Ever!"><cfchart>

proclaims the success of the past four quarters (which are neatly color coded by season!) And, by using a custom style, you can also have full control over the title placement, color, font, size, and more.

Charts in Reports...
As you know, ColdFusion MX 7 introduces the ability to deliver high-quality, structured reports. These reports can be fully integrated into web applications and provide users with well-formatted data that is easy to understand, print, and e-mail. It's structured business reporting power, otherwise only possible by using expensive, third-party reporting products.

Charts and graphs are very common in reports, so we wanted to bring to you the same superior charts that you can create with CFML in ColdFusion reporting. With the ColdFusion Report Builder, this is a simple task. ColdFusion Report Builder is a free, easy-to-use tool with a familiar, banded report writer interface that enables you to design structured, repeating-region reports for ColdFusion MX 7 applications.

If you want to insert a chart into your report, simply click Insert->Chart. This will bring up the Chart wizard, a full-featured visual chart builder which allows you to edit all of the attributes of the CFCHART tag. You can also use the built-in styles or any of the custom styles you have created for reuse. This way the charts in your report will have a consistent look and feel with the other charts on your site.

Summary
In figuring out what to improve in its charting makeover, Macromedia listened to its customers. With custom chart styles, there are virtually no limits to how finely you can control the look and feel of charts in your web applications. And it's simple to re-use them in all of your web pages or in new ColdFusion reports. Our CFCHART wish list may not be quite empty, but it's a lot shorter than it was before ColdFusion MX 7

About Tim Buntel
Tim Buntel is product manager for ColdFusion at Macromedia. His Web site is at www.buntel.com.

CFDJ LATEST STORIES . . .
Red Hat CTO Brian Stevens, Citrix CTO Simon Crosby, Egenera CTO Pete Manca, Allen Stewart, Group Manager, Windows Virtualization at Microsoft, and Brian Duckering, Sr. Director of Products and Alliances at Symantec were the top industry executives who joined Jeremy Geelan in the 4th Fl...
Mike Neil is general manager for virtualization strategy in the Windows Server Division at Microsoft. Mike is focused on the delivery of the Windows virtualization technology, including Windows Server 2008 Hyper-V, Microsoft Hyper-V Server and Virtual PC 2007. Mike also directs the tec...
Two of the biggest launches in Rich Internet Application history took place in 2007/2008 when Adobe launched AIR 1.0 in February '08 and Microsoft launched Silverlight (September '07). At the 6th International AJAXWorld RIA Conference & Expo in October SYS-CON Events is delighted to be...
SQL Injection attacks are one of the easiest ways to hack into a website. One recent hack, using a script from verynx.cn, involves injecting sql into a web form that then appends some JavaScript code into fields in a database that then gets executed on the client side when a user views...
Recursion Software released a private beta version of their Voyager mobile platform, with powerful interoperability for Android, Microsoft .NET and Compact Framework (CF), all Java editions (JME CDC, JSE and JEE), and more than 15 embedded operating systems. The Voyager platform is a p...
2008 is going to be an important year for Rich Internet Applications. Most organizations are delivering or planning to deliver Rich Internet Applications; however, at the same time, most IT managers are facing a dilemma: which Rich Internet Application technology and platform to use? T...
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021


SYS-CON FEATURED WHITEPAPERS

ADS BY GOOGLE