Portlet XML Formatting

From MT Marvelit
Jump to: navigation, search

Chart XML Tags

Chartxmlschema.jpg

On the Chart Portlet - there is a field to enter XML. The format of the XML is as follows:

marvelitchart [Attributes:

  • percentvalues=‚true|false‚ (pie charts only)]

value-axis [Attributes:

  • low={number}
  • high={number}
  • ticks={number}
  • label=text
  • include0=true|false

category-axis [Attributes:

  • low={number}
  • high={number}
  • ticks={number}
  • label=text
  • angle=true|false

section [Attributes:

  • number={number}
  • color=#000000
  • explode={percent}]

alt-section [Attributes:

  • number={number}
  • color=#000000]

columnlist (See Report XML)

Notes

  • section.explode only applies to pie charts (2d and 3d)
  • alt-section is for combination charts (two sql queries in the sql field seperated by ;). This is used to format the chart in the second query.
  • The number field for section and alt-section are integers starting with 0
  • include0 = false allows the base of the chart to be a high number. This is useful when all values are of a similarly high value.
  • color = allows specification of colors for charts. Use hex values as defined in Web Colors













Chart XML Examples

Chartxmlexample1.jpg

Example #1 - Offset Pie Chart

<marvelitchart percentvalues="true">
<section number="0" color="#0000FF" explode=".50" />
<section number="1" color="#00FF00" explode=".05" />
<section number="2" color="#FF0000" explode=".05"/>
<section number="3" color="#FFFF00" explode=".05"/>
<section number="4" color="#FF00FF" explode=".05" />
</marvelitchart>












Example #2 - Line Chart - Vary line Width,Color,Dashed or Solid

Linechart.jpg


<marvelitchart>
<section number="0" color="#000000" strokesize="6" dashpattern="10,10"/>
<section number="1" color="#FFD700" strokesize="6" />
<section number="2" color="#228B22" strokesize="6" />
<section number="3" color="#800080" strokesize="6" />
<section number="4" color="#32CD32" strokesize="2" />
<section number="5" color="#000080" strokesize="2" />
<section number="6" color="#FF4500" strokesize="2" />
<section number="7" color="#008B8B" strokesize="2" />
<value-axis label="Results" include0="false"/>
<category-axis label="Periods" angle="90" direction="up"/>
</marvelitchart>

Example #3 - Chart and Report XML Combination

Chartxmlexample2.jpg



<marvelitchart>
<category-axis label="Months" angle="45" direction="up"/>

<columnlist>
<column name='*'>
<lever name='default'>
<threshold>
<style><![CDATA[color: green;font-weight: bold;]]></style>
</threshold>
</lever>
</column>
</columnlist>

</marvelitchart>








Example #4 - Other Chart Examples

Barchartrichcolor.jpg
Make chart colors rich - no transparency

<marvelitchart foregroundalpha="255">

<value-axis include0="false"/>
<category-axis angle="45" direction="up"/>
<section number="0" color="#FFD700" />
<section number="1" color="#000080" />
</marvelitchart>





Barchartbackcolor.jpg
Alter chart background colors

<marvelitchart foregroundalpha="255" backgroundcolor="#F0E68C" imagebackgroundcolor="#FFA500">

<value-axis include0="false"/>
<category-axis angle="45" direction="up"/>
<section number="0" color="#FFD700" />
<section number="1" color="#000080" />
</marvelitchart>





Report XML Tags

Reportxmlschema.jpg

On the Report and Meter Portlet - there is a field to enter XML. The format of the XML is
as follows:

columnformatlist column [Attributes:

  • name=columnname|number

lever [Attributes:

  • name=‚columnname|default
  • value=‚lever value

threshold [Attributes:

  • field=columnname|number
  • value=value
  • type=string|date|number
  • format (ex: $ ###.00)
  • link (ex: http://www.marvelit.com/)
  • style (css style name)
  • imageurl [Attributes:
  • alt=alternate


Notes

  • Columns can be listed by name or by number. Use ‚'*' to signify all columns.
  • The lever tag allows specific settings when certain levers are used.
  • Use default to signify all levers. The default lever tag will be used when no specific levers are found.
  • The threshold tag is used to test conditions.
  • String values are triggered when the specified column = the value of the threshold.
  • Dates and Numbers are triggered when the specified column >= the value of the threshold.
  • Use value= to signify all values
  • <style> colors = allows specification of colors for report columns. Use hex values as defined in Web Colors







Report XML Examples

Reportxmlexample1.jpg

Example #1 - Colors with Thresholds

<columnlist>
<column name='*'>
<lever name='default'>

<threshold field="Percent" value='0' type='double'> <style><![CDATA[color: white;font-weight: bold;background-color: #00CC00;border-bottom-width: thin;border-bottom-style: solid;]]></style> </threshold>

<threshold field="Percent" value='50' type='double'> <style><![CDATA[;font-weight: bold;background-color: #CC0000;border-bottom-width: thin;border-bottom-style: solid;]]></style> </threshold>

<threshold field="Percent" value='40' type='double'> <style><![CDATA[color: white;font-weight: bold;background-color: #FF9900;border-bottom-width: thin;border-bottom-style: solid;]]></style> </threshold>

<threshold field="Percent" value='25' type='double'> <style><![CDATA[font-weight: bold;background-color: yellow;border-bottom-width: thin;border-bottom-style: solid;]]></style> </threshold>

</lever> </column> </columnlist>







Example #2 - Icons with Links

Reportxmlexample2.jpg

<columnlist>
<column name='*'>

<lever name='default'>

<threshold field="Status" value='UP' type='string'> <style><![CDATA[color: #00CC00;font-weight: bold;]]></style> </threshold>

<threshold field="Status" value='DOWN' type='string'> <style><![CDATA[color: #CC0000;font-weight: bold;]]></style> </threshold>

<threshold field="Status" value='UNREACHABLE' type='string'>
<style><![CDATA[color: orange;font-weight: bold;]]></style>
</threshold>

</lever>
</column>
<column name='Status'>
<lever name='default'>

<threshold field="Status" value='UP' type='string'> <imageurl><![CDATA[/marvelit/images/arrow-0.gif]]></imageurl> <link><![CDATA[http://www.marvelit.com]]></link> </threshold>

<threshold value='DOWN' type='string'> <imageurl><![CDATA[/marvelit/images/arrow-2.gif]]></imageurl> <link><![CDATA[http://www.marvelit.com]]></link> </threshold>

<threshold value='UNREACHABLE' type='string'> <imageurl><![CDATA[/marvelit/images/arrow-1.gif]]></imageurl> <link><![CDATA[http://www.marvelit.com]]></link> </threshold>

</lever>
</column>
</columnlist>