<?xml version="1.0"?>
<rss version="2.0">
<channel>
  <title>Reporting Tales - chart tag</title>
  <link>http://www.sherito.org/tags/chart/</link>
  <description>.. if it is not printed, it can&#039;t be real</description>
  <language>en</language>
  <copyright>Thomas Morgner</copyright>
  <lastBuildDate>Tue, 26 Aug 2008 11:33:00 GMT</lastBuildDate>
  <generator>Pebble (http://pebble.sourceforge.net)</generator>
  <docs>http://backend.userland.com/rss</docs>
  
  
  <item>
    <title>Free the Slaves: Pentaho Charting Expressions are now a independent project</title>
    <link>http://www.sherito.org/2008/05/11/1210498500000.html</link>
    
      
        <description>
          Charting in the Classic-Engine is currently implemented as a set of report functions and expressions. A chart-collector function produces the data-set and a chart-expression then uses the dataset and produces a &lt;a href=&#034;http://www.jfree.org/jfreechart/&#034;&gt;JFreeChart&lt;/a&gt; object for it. The &lt;a href=&#034;http://www.jfree.org/jfreechart/&#034;&gt;JFreeChart&lt;/a&gt; object is then directly renderable by the reporting-engine and produces some nice Vector-graphics output.&lt;br /&gt;
&lt;br /&gt;
For historical reasons, these charting expressions have been held captive by the Pentaho-Platform. In the early days, when the land was rough and largely unsettled, a important project required to include charts. As some of the demos in the old JFreeReport-extensions project showed how to integrate &lt;a href=&#034;http://www.jfree.org/jfreechart/&#034;&gt;JFreeChart&lt;/a&gt; into the reporting engine, it was the most obvious way to head into that direction. And so the first chart expression was born.&lt;br /&gt;
&lt;br /&gt;
Over the years, more and more chart types were added and whenever a new feature was needed, it was added as well. At some point, the chart expressions started to depend on some core classes of the Pentaho-Platform, and thus what started as &amp;quot;strange packaging strategy&amp;quot; suddenly became a severe dependency issue, as now the chart-expressions were unable to run without a configured platform in the back. This rendered these expressions unusable outside of the platform and thus unusable for anyone who used the reporting-engine as embedded component.&lt;br /&gt;
&lt;br /&gt;
Fast forward. Some months/years later, the trouble-maker dependency has been removed. But sitting in the same project as the platform code, there are only policies and documentation notes that protect us from having such a rouge dependency again. And in the real world, policies and documentation hints do not actively protect the code - they just make the reasoning for having to fix the newly introduced flaw easier. &lt;br /&gt;
&lt;br /&gt;
But the new found peace was still an uneasy one: Changes in the way the reporting engine handled functions and generated content propagated slowly into these expressions (as the release cycles of the Engine and Platform do not (and cannot) match). At the same time, new properties of the expressions were added, which somehow appeared to work (well, they did not crash :) ) with the older engine but due to stricter validity checks on the existing contracts were bluntly rejected in the later engine and report-designer. And there the release cycle hit again: We did not see the troublesome contribution until the first &lt;a href=&#034;http://jira.pentaho.org/browse/PRD-488&#034;&gt;bug-report&lt;/a&gt; came in. At that particular point, a fix would have either broken the engine&#039;s or the platform&#039;s backward compatibility promise. &lt;br /&gt;
&lt;br /&gt;
And of course: Adding code to a large monolithic project is a lot more cumbersome than adding code to a small and &lt;strike&gt;simple&lt;/strike&gt; (the Chart-Expressions are not simple. Although they have not yet reached the gnomish-threshold, the massive amount of knobs and levers and other properties in them makes them a complex system) focused project. &lt;br /&gt;
&lt;br /&gt;
So let&#039;s see what we have:&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt; The chart-expressions share no code with the platform and do not depend on the mere existence of the platform &lt;/li&gt;
    &lt;li&gt; The shifted release cycle gives me headaches &lt;/li&gt;
    &lt;li&gt;Adding code to a heavyweight project is no fun&lt;/li&gt;
&lt;/ul&gt;
So let&#039;s fix these problems. &lt;br /&gt;
&lt;br /&gt;
There is now a new project in the reporting-engine Subversion-Repository under svn://&lt;a title=&#034;Linkification: http://source.pentaho.org/pentaho-reporting/engines/classic/legacy-charts&#034; href=&#034;http://source.pentaho.org/pentaho-reporting/engines/classic/legacy-charts&#034; class=&#034;linkification-ext&#034;&gt;source.pentaho.org/pentaho-reporting/engines/classic/legacy-charts&lt;/a&gt;&lt;br /&gt;
The project contains a copy of the chart-expression formerly found in the platform. With Platform 1.8, the platform JAR will no longer contain the chart-expressions and the sources for them will be removed from the platform-project. The platform then switches to the expressions found here.&lt;br /&gt;
&lt;br /&gt;
The first official release of these expressions will be named version 0.8.10 (to be in sync with the reporting-engine).&lt;br /&gt;
&lt;br /&gt;
The freed chart-expressions take 72 KB (compared to ~450 KB of the pentaho-plugin.jar) and stick with JDK 1.4 (they _should_ even work with JDK 1.3), instead of requiring the bloatware JDK 1.5.&lt;br /&gt;
&lt;br /&gt;
As initial bonus for early adopters, all chart-expressions now can control the item-label&#039;s visibility and handle null-values and invalid datasets a lot more gracefully than before.
        </description>
      
      
    
    
    
    <comments>http://www.sherito.org/2008/05/11/1210498500000.html#comments</comments>
    <guid isPermaLink="true">http://www.sherito.org/2008/05/11/1210498500000.html</guid>
    <pubDate>Sun, 11 May 2008 09:35:00 GMT</pubDate>
  </item>
  
  <item>
    <title>Things that should never have existed in the first place</title>
    <link>http://www.sherito.org/2007/03/31/1175365320000.html</link>
    
      
        <description>
          &lt;p align=&#034;justify&#034;&gt; Pentaho Reporting never had real charting support. Although JFreeChart, &lt;strong&gt;the&lt;/strong&gt; reference project for Java-based charting, was developed next door, we never came to the point where users could have added charts to a report. &lt;/p&gt;
&lt;div align=&#034;justify&#034;&gt; &lt;/div&gt;
&lt;p align=&#034;justify&#034;&gt; The engine itself is able to render Drawable-objects. Drawables are objects that know how to render themselves to a Graphics2D context. This interface was defined by JFreeChart as simple abstraction layer for its components. So the only way to get charts into the report, was to print them as drawables. If you wanted charts based on the data from the report, you would have to create a function that collects the data and finally creates the JFreeChart instance, which then could be printed in the report. &lt;/p&gt;
&lt;div align=&#034;justify&#034;&gt; &lt;/div&gt;
&lt;p align=&#034;justify&#034;&gt; This story is sick, I know. But we haven&#039;t even reached the end yet.&lt;/p&gt;
&lt;div align=&#034;justify&#034;&gt; &lt;/div&gt;
&lt;p align=&#034;justify&#034;&gt; When Pentaho elected JFreeReport to be the primary Reporting Engine for their plattform, they also asked about charting. Naive as I was, I mentioned that sick way of getting charts into the report. Even worse, I&#039;ve created a working sample-report for them so that they can see it working.&lt;/p&gt;
&lt;div align=&#034;justify&#034;&gt; &lt;/div&gt;
&lt;p align=&#034;justify&#034;&gt;  Oh, I should have known better. Every sin gets punished sooner or later, and my punishment is called &#039;ChartExpression&#039;. The prototype actually evolved into a couple of function implementations. The Pentaho folks still think, that this was a natural evolution born out of the need for at least some charting capabilities. But I know better: The gods of good software architecture were really pissed of at me, just for creating that abnomination. If there were some deserts near by, you would now see me heading of for a 40 year tip to nowhere, just to end my life directly in front of the promised land.&lt;/p&gt;
&lt;div align=&#034;justify&#034;&gt; &lt;/div&gt;
&lt;p align=&#034;justify&#034;&gt;  So all you developers out there: If someone asks you for a quick solution for a problem, and all you could deliver is an architectural nighmare: turn them down. Tell&#039;em: &#039;No way! There is no possibility how this can be done right now.&#039;&lt;/p&gt;
&lt;div align=&#034;justify&#034;&gt; &lt;/div&gt;
&lt;p align=&#034;justify&#034;&gt; If you feel lucky, you might even ask them for a project budget to develop something sane.&lt;/p&gt;
&lt;div align=&#034;justify&#034;&gt; &lt;/div&gt;
&lt;p align=&#034;justify&#034;&gt; But never ever say the unholy sentence: &amp;quot;Sure, we can build something quick and dirty. We&#039;ll create a better solution as soon as we find more time for it.&amp;quot;&lt;/p&gt;
&lt;div align=&#034;justify&#034;&gt; &lt;/div&gt;
&lt;p align=&#034;justify&#034;&gt; That time will never come ... &lt;/p&gt;
        </description>
      
      
    
    
    
    <comments>http://www.sherito.org/2007/03/31/1175365320000.html#comments</comments>
    <guid isPermaLink="true">http://www.sherito.org/2007/03/31/1175365320000.html</guid>
    <pubDate>Sat, 31 Mar 2007 18:22:00 GMT</pubDate>
  </item>
  
  </channel>
</rss>
