The Last blog post about creating line charts with the BI Publisher Plug-In for Microsoft Word described how it is possible to create graphs which are not usable in the standart graph wizard. Based on a normal horizontal line chart a vertical line chart diagram has been created. This was possible through the help of the graph.dtd, the Document Type Definition. This file contains all properties, attributes and parameters that are feasible with the BI Publisher to create charts. Now the appearance of the vertical line chart in the last blog post was not very nice and appealing. Therefore, this blog post explains how to customize the look of diagram specific requirements.
As a starting point, the XML of the diagram and the accompanying illustration is presented here:
There are now many possibilities to improve this graph, but here are the following improvements as examples:
- Removing the 3D effect
- Change line color
- Change the background color
1.) The lines have in this chart an unpleasant 3D effect that makes the diagram appear very confusing and may irritate the viewer. The attribute seriesEffect defines this effect. So that the effect disappears, this attribute should be set to SE_NONE.
<Graph seriesEffect=”SE_NONE” graphType=”BAR_HORIZ_STACK_2Y” markerDisplayed=”true”>
2.) Furthermore, the lines have the default colors from BI Publisher. Although those can be selected by a predefined color palette or changed directly in the diagram wizard but the direct intervention in the XML may contain other properties that affect the appearance of the lines. For example, by changing the attribute color, the color, with the attribute markerShape, the marker shape and with the attribute linewidth, the line thickness can be determined.
3.) The background color is very important in a chart, since it determines the contrast and hence determines the perception of the viewer. The better the contrast, the more comfortable feels the viewer. In BI Publisher the attribute PlotArea with property fillColor determines the background color of the chart. The PlotArea attribute has other properties that are configurable, for example, can be determined by the property transparentBorder whether the edge of the plot area is displayed or not.
Moreover, there are many more attributes that can be manipulated in a chart than presented here. However, if a particular attribute has to be changed and there is a lack of knowledge which properties are available, the graph.dtd should be checked, which was presented in the last blog post. For example, if the legend has to be changed in a diagram this can be found under the legendArea attribute:
<!ATTLIST LegendArea visible (true | false) #IMPLIED alongGraphEdge (true | false) #IMPLIED automaticPlacement (AP_NEVER | AP_ALWAYS) #IMPLIED position (LAP_TOP | LAP_BOTTOM | LAP_RIGHT | LAP_LEFT) #IMPLIED positionHint (ALIGN_TO_CENTER | ALIGN_TO_EDGE) #IMPLIED maxWidth CDATA #IMPLIED threeDSurfacePosition (LAP_TOP | LAP_BOTTOM | LAP_RIGHT | LAP_LEFT) #IMPLIED borderColor CDATA #IMPLIED fillColor CDATA #IMPLIED borderTransparent (true | false) #IMPLIED fillTransparent (true | false) #IMPLIED markersPerRowAutomatic (true | false) #IMPLIED legendMarkersPerRow CDATA #IMPLIED legendTextPosition (LTP_ON_RIGHT | LTP_ON_LEFT | LTP_BELOW | LTP_ABOVE | LTP_ON_MARKER) #IMPLIED legendOrientation (LO_AUTOMATIC | LO_HORIZONTAL | LO_VERTICAL) #IMPLIED itemSpacing (AUTO | SHRINK_TO_FIT) #IMPLIED >
This examples provides a small overview about the options how the legend in a chart can be changed. This is corresponding to all the other attributes of the output chart. This structure of the available properties is also given for all others attributes:
BOOM! This looks considerably better then the first attempt. 🙂
Of course, this is only an example of how a chart can be improved in BI Publisher.