Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

After looking at the JFreeReport flow engine's DOM, there is a nice pattern we can reuse in the chart DOM regarding how style are applied to chart structure. This my first quick attempt at putting out an example XML structure with a few styles defined so that we can begin to visualize the ideas that we are talking about.

PRPT:Chart Dom Example

Code Block
<chart xmlns="http://www.pentaho.org/namespaces/chart">
  
  <inline-stylesheet>
    axis { 			
        color: #FFF000; 			
        font-family: sans-serif; 		
    }
    axis label { 			
        font-weight: bold; 		
    }
    axis[type="numeric"] { 			
        format: "#.00%";						 		}

    }
    axis[type="datetime"] { 			
        format: "MM/dd  hh:mm a"; 
    		}
    axis.myAxis { 			
        color: blue; 			
        font-family: "Comic Sans MS"; 		
    }
  </inline-stylesheet>
  
  <plot><<plot/plot>>
  <axis type="numeric" id="y1" position="left">
    <\!-\- This label represents the title for the axis \-->
<label></label>    <label/>
  </axis>
  
  <axis class="myAxis" type="numeric" id="y2" position="right">
    <\!-\- This label represents the title for the axis \-->
    <label><<label/label>>
  </axis>
  <axis type="datetime" id="x1" position="bottom">
    <\!-\- This label represents the title for the axis \-->
    <label><<label/label>>
  </axis>
  
 <legend></legend> <legend/>
  
  <title></title><title/>

  <subtitles>
  <subtitles></subtitles>
<subtitles></subtitles>  <subtitle></subtitle>
    <subtitle></subtitle>
  </subtitles>

  <chart-series>
    <series id="" position="0" axis="y1"></series>
    <series id="" position="1" axis="y2"></series>
  </chart-series>
  
  <annotations>
    <annotation></annotation>
  </annotations>

  <intervals>
    <interval></interval>
  </intervals>

</chart>

I would like to work toward either a schema or a DTD that all projects can work from in tandem to realize the chart API, pillar integration and editors.

...

Code Block
interface Element 
{
   Object getAttribute(String namespace, String attributeName);
   String getNamespace();
   String getTagName();
   StyleSheet getStyle();
}

This is enough to allow a full style-resolution and to code renderers for the model. The Beans should sit on top of this interface providing programmers with getters and setters. The resulting DOM-model will be able to provide extra attributes for specific renderers without extra coding and reduces the number of conflicts caused by the limitations of the bean interfaces. The strict-typing of beans actually backfires once you try to implement the "chart-type-switching".

...