Fusioncube

The online journey of a technophile, by Steve Brownlee

Archive for December, 2005

Customizing Your CFCHART Results

Sunday
Dec 18,2005

I’ve done simple line charts with ColdFusion in the past with the CFCHART tag, but a recent project had me doing more complex charting and having to use the flash chart type which I’d never used before. When making bar charts, the default behavior for Flash type graphs is a basic grow animation that looks neat when you first see it, but it gets annoying if you are constantly refreshing the chart. This also becomes problematic if the refresh rate is faster than the animation time because you never see the final data.

Ray Camden and Dan Switzer pointed me to a couple of blog posting about WebCharts3D which is included in ColdFusion 7. So I launched the application – simply executing the webcharts.bat file in the WEB-INF\cfusion\charting directory. You’re first presented with a screen where you choose the type of chart you want to build/customize.

webchart1-747317.jpg

When you select the type – and sub-type – that you want, you are taken directly to the main editor screen.

webchart2-731124.jpg

It takes some playing around to learn how to access and change the properties of any given chart style (as the interface is not incredibly intuitive) and as soon as you change any property, the example on the left is updated with a preview.

Once you have it looking the way you like, you go to the XML Style tab and click the save button. You need to save it in the WEB-INF\cfusion\charting\styles directory.

webchart3-739210.jpg

Then you simple take the name of xml file you just saved and put it in the style attribute of the CFCHART tag.

<cfchart title="My Chart" scaleFrom="0" scaleTo="100"
   format="flash" chartheight="300" chartwidth="650"
   markersize="1" style="my_new_chart_style">
      <cfchartseries type="line" colorlist="1E90FF">
          <cfchartdata value="50">
      </cfchartseries>
</cfchart>

If you are unhappy with any aspect of the way your ColdFusion charts are being displayed or want to add/remove information from them, then definitely play around with WebCharts3D.

JVM Memory Monitoring

  • Filed under: java, jboss
Thursday
Dec 8,2005

My life as a JBoss application developer just became a whole lot easier. I discovered the jconsole.exe tool provide in the 1.5 JDK. This tool provides exactly the real-time memory reporting that I need.

The best part is that it provides a breakdown of each memory space so that I can tweak the settings when I watch the application perform under load. Notice in the screenshot below the five green bars in the lower-right hand corner. That is each memory space (Eden Space, Survivor Space, Tenured Gen, Code Cache, and Permanent Gen) updated real time with how much allocated memory is being used.

JConsole Memory

To get your app enabled to be monitored by jconsole, though, is very arduous and time consuming. Here are the steps.

1. Add the following system properties to your JVM startup command.

-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port={any unused port}
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false

2. Restart your instance.

See how hard that was? You broken a sweat yet? No? Ok well there’s more work involved. Now you have to open up a command prompt and type the command ‘jconsole’. If your JDK’s bin directory is not on your path, either add it or open your command prompt in that path.

When the console fires up, go to the remote tab and fill in your IP address and the port number that you specified above, and then click Connect. You’ll then see the summary screen shown here.

JConsole Main

If you have broken a sweat by now, then you either need to turn the heat down or stop typing so hard. I couldn’t believe how easy it was to finally get a tool to monitor an application!

For an exhaustive review of jconsole’s features, visit Sun’s reference page

Latest Tweets

  • Watch video on this page to see a quick shot my family's biz and a heapin' helpin' of Pittsburghese - http://bit.ly/aMxuLN
  • Ever wonder how insignifcant the Earth is on a cosmic scale? http://bit.ly/PV4o
  • How did I miss this highlight??? Hasek takes out Gaborik http://su.pr/1KZtN2
  • Rooted & upgraded my HTC Hero w/#Froyo. Holy shit is it faster and have improved features. Painless, too. http://bit.ly/cBjvuH #fusprint
  • @Antipimp You will do what Father Jobs tell you to do, peon.