Specifying charts

Unlike the variants for other types of image policies, chart variants are generated at runtime rather than being permanently stored on a file system. MCS gets the information required to draw the chart variant from chart data, a chart display attributes, and device data.

Unlike the variants for other types of image policies, chart variants are generated at runtime rather than being permanently stored on a file system. MCS gets the information required to draw the chart variant from chart data, a chart display attributes, and device data.

Chart display on a PC

Chart data

Chart policies are perhaps most effective when you need to display data that changes frequently, and that can be generated dynamically from a source like a database or a web service. However, it is also possible to use static chart values.

Chart data are the values and labels that are to be represented in the chart. MCS derives this data, which is common to all devices, by evaluating either JSP expressions or static values in the data and labels attributes of the XDIME chart element.

A basic static example takes space and comma separated data and label values direct from the attributes.

<canvas layoutName="/simple.mlyt">
  <chart
    pane="p22"
    name="/chart.mcht"
    data="10 15 50, 60 30 10"
    labels="Jan Feb Mar"
    class="kwd"/>
</canvas>

The URL to generated chart images is prefixed by the web-application base-url, the web-application page-base, and the chartimages base attributes concatenated together. Please note that the page-base attribute must be set to the context in which MCS is installed. Refer to MCS configuration elements for further information.

X server access

When MCS is running on a Unix application server it needs to connect to a host X-windows server to render a chart. There are a number of alternative methods depending on the server platform. For example, you need to add the application server user to the the X server access control list.

xhost + [local_ip]

Then specify an export display context.

export DISPLAY=[local_ip]:0.0 

Related topics