Configurable Charts in SystemWeaver are comprehensible and compact ways to present information about a particular item element such as an attribute, part or property. They are visualized in color, include a legend and interact with the structure tree to allow you to easily trace back and view the items included in the chart. This article introduces basic chart configuration in the swExplorer client. 


Prerequisites


Types of Charts

There are three types of charts:

  • Pie chart
  • Area chart
  • Column chart


Pie Chart


Area Chart


Column Chart


Configuring the View

A configurable chart is a Config item and is created using the config item Sandbox mode as described in Creating Config Item Views. By default, the Sandbox will include the basic elements of a configuration to get you started, as shown below. 



Tip: A quick way to create a new chart is to copy a similar one that is already defined as described in Creating a New Config Item by Copying an Existing.


Example Configuration

An example of a chart showing the Priority (PRIO) attribute for requirements. It utilizes <ForEachPart>, <ApplyItemTemplates>, and <Choose> elements.

<Charts>
	<PieChart>
		<Slices>
			<Slice name="test" caption="Test" color="blue"/>
			<Slice name="analysis" caption="Analysis" color="red"/>
			<Slice name="inspection" caption="Inspection" color="yellow"/>      
			<Slice name="unknown" caption="Unknown" color="green"/>
		</Slices>
		<Counter>             
			<ApplyItemTemplates/>      
		</Counter>
	</PieChart>    
	<ItemTemplate type="3PTA">
		<ForEachPart type="XESX">
			<DefObj> 
				<ApplyItemTemplates/>        
			</DefObj>
		</ForEachPart>  
	</ItemTemplate>
	<ItemTemplate type="EXSW">
		<ForEachPart type="EXAC">
			<DefObj> 
				<ApplyItemTemplates/>        
			</DefObj>
		</ForEachPart>  
	</ItemTemplate>           
	<ItemTemplate type="BIAC">
		<ForEachPart type="IBAR">
			<DefObj> 
				<ApplyItemTemplates/>        
			</DefObj>
		</ForEachPart>  
	</ItemTemplate>          
	<ItemTemplate type="RQ">
		<Choose> 
			<When test="@ABVM = 'Test'">
				<AddToSlice name="test"/>
			</When>
			<When test="@ABVM = 'Analysis'">
				<AddToSlice name="analysis"/>
			</When>                
			<When test="@ABVM = 'Inspection'">
				<AddToSlice name="inspection"/>
			</When>   
			<Otherwise>               
				<AddToSlice name="unknown"/>
			</Otherwise>         
		</Choose>  
	</ItemTemplate>
</Charts>


Example Data


Example Result

Note that the Part SID has been added to the structure tree grid for your reference to the above configuration.



Explanation of the Configuration Elements

As with all configurable features, charts consist of one definition part and one data collection part.


Definition

<Charts> defines a chart view. It can include one or more individual charts.



<AreaChart> defines one Area Chart.


<ColumnChart> defines one Column Chart or Bar Chart. It has the following two optional attributes: 

  • caption sets the label for the column/bar in the chart.
  • multiBar defines the behavior of the chart. A "side" value results in multiple bars, side-by-side, in groups. A "stacked" value [default] results in bars stacked on top of each other. 

The definition of the columns/bars is based on AddToSlice just like with the other chart types.


<PieChart> defines a Pie Chart.


<Slices> describes the available chart slices.


<Slice> defines a set of objects that can be visualized in a chart, e.g., labels and colors. It has the following attributes: 

  • name is used to assign items to the <Slice>. It is used within the <AddToSlice> element. Required.
  • caption sets the label for the slice in the chart. If no caption is set, a unique number will be used.
  • color sets the color of the <Slice>.  See Defining Color in Configurations. If no color is specified, a (unique) color will be selected automatically.

This tag can be omitted, but it is the only way to assign captions and specific colors to the slices.


Data Collection

<Counter> keeps track of the data sets to be displayed in the chart. Pie charts have a single counter, while Area charts have a counter for each separate series of the Area Chart.


<AddToSlice> is used to add data (as defined in <Counter>) to the slices. It has the following attributes: 

  • name indicates which slice to assign it to.
  • color is an alternative to defining the color in the <Slice> tag. This option is useful when the color is defined by a property of the object (item or issue) that is added to the slide, e.g., a status color of an issue.


Tip: Need help finding SIDs? See Finding SystemWeaver Type Identifiers (SIDs).


Note: Nothing is preventing an item from being included, i.e., counted, in multiple slices. For example, if your chart shows attributes, it's possible that one item may have more than one attribute.

What's Next?

Interested in SystemWeaver Script Language training? You can also learn about the numerous scripting options in the SystemWeaver Script Language Reference Manual in the Help.