Hitachi Vantara Pentaho Community Wiki
Child pages
  • Bar Chart

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Wiki Markup
{scrollbar}

Bar Chart

Anchor
barchart
barchart

The bar chart plots a set of values as bars for each series in the given dataset.

Dataset Guidelines

This chart expects its data as a categorical dataset.

Required Properties

The only property a bar chart requires is the appropriate chart-type.

Code Block
XML
XML
<chart-type>BarChart</chart-type>

The optional chart properties that are supported for this chart are listed in the Chart Properties Reference.

Example

The following chart definition will produce the chart in the example below.

Code Block
XML
XML
<chart>
	<chart-type>BarChart</chart-type>
	<title>Sample Bar Chart</title>
	<title-position>top</title-position>
	<title-font>
		<font-family>Serif</font-family>
		<size>36</size>
		<is-bold>false</is-bold>
		<is-italic>false</is-italic>
	</title-font>
	<subtitles>
		<subtitle>a simple sample</subtitle>
	</subtitles>
	<domain-title>This is the domain title</domain-title>
	<range-title>This is the range title</range-title>
	<chart-background type="gradient">
		<x1>0.0</x1>
		<y1>0.0</y1>
		<color1>#000000</color1>
		<x2>200.0</x2>
		<y2>200.0</y2>
		<color2>#FFFFFF</color2>
		<cyclic>true</cyclic>
	</chart-background>
	<plot-background type="image">test/charts/ChartBackground.jpg</plot-background>
	<orientation>vertical</orientation>
	<height>550</height>
	<width>650</width>
	<is-3D>true</is-3D>
	<is-stacked>false</is-stacked>
	<category-label-rotation>45.0</category-label-rotation>
	<border-visible>true</border-visible>
	<border-paint>#3399FF</border-paint>
        <url-template><![CDATA[/pentaho/Pivot?solution=samples&path=analysis&action=query1.xaction&department=.[{DEPARTMENT}]&measures=.[{MEASURES}]]]></url-template>
	<paramName>MEASURES</paramName>
	<series-name>DEPARTMENT</series-name>
	<color-palette>
		<color>#336699</color>
		<color>#99CCFF</color>
		<color>#999933</color>
		<color>#666699</color>
		<color>#CC9933</color>
		<color>#006666</color>
		<color>#3399FF</color>
		<color>#993300</color>
		<color>#CCCC99</color>
		<color>#666666</color>
	</color-palette>
        <include-legend>true</include-legend>
</chart>

On Pentaho Version 1.7 GA, a few tag have different names

For example, to rotate the label, use the following tag instead:

Code Block
xml
xml
<domain-label-rotation>45.0</domain-label-rotation>