Modifying the Chart Style
To modify the style of a chart in script (e.g., line, bar, pie, etc.), use the 'singleStyle' or 'separatedStyle' attributes:
You can switch between 'Single Graph' and 'Separate Graph' in the 'Data Binding' dialog box. See Chart Data Binding in the Report Designer for more information.
• Use 'singleStyle' when the chart is in 'Single Graph' mode. In 'Single Graph' mode, you can assign a different style to each individual dataset.
• Use 'separatedStyle' when the chart is in 'Separate Graph' mode. In 'Separate Graph' mode, you can assign a single style to all datasets.
For example, if you want to parameterize the style of a chart ('Separate Graph'), you could prompt the user for a parameter called 'Chart Style'. Then access this parameter in the chart script and modify the chart style accordingly.
if (parameter['Chart Style'] == 'bar') {
Graph1.separatedStyle=Chart.CHART_BAR;
}
else if (parameter['Chart Style'] == 'line') {
Graph1.separatedStyle=Chart.CHART_LINE;
}
Modifying Axis Title Text
To modify axis title text, use xTitle.text (x2Title.text) and yTitle.text, (y2Title.text).
Graph1['xTitle.text'] = 'Text to go below bottom X-axis'
Graph1['x2Title.text'] = 'Text to go above top X-axis'
Modifying Axis Properties
To modify axis properties, including labels, visibility, tick marks, etc., use the “axis” properties (axis.font, axis.minimum, axis.labelColor, etc.). Use auto-complete for correct syntax. Type “.” after “axis” to see prompt.
Graph1.axis.Employee.font='Comic Sans MS-BOLD-12'
Graph1.axis.Employee.ticksVisible=false
Graph1.axis.Employee.labelColor=[0,0,255]
Graph1.axis['Sum(Total)'].logarithmic=true
Graph1.axis['Sum(Total)'].minimum=10000
To modify the format of a label, define a new format object, and assign it to the axis.format property.
var fmt = new inetsoft.uql.XFormatInfo;
fmt.setFormat(Chart.DECIMAL_FORMAT);
fmt.setFormatSpec("#,###.00")
Graph1.axis['Sum(Total)'].format = fmt;