How to: |
The trendline properties draw a trendline and equation label for individual series in bubble and scatter charts.
Note: You can also draw a trendline for all series using the global trendline property. For information, see Drawing Trendlines in Bubble and Scatter Charts (trendline).
series: [ { series: snumber, trendline: { enabled: boolean1, mode: 'tmodestring', equationLabel: { visible: boolean2, font: 'fstring', color: 'ecstring', mode: 'emodestring' } } } ]
where:
Is a zero-based series number. If the series does not exist in the chart, the property is ignored.
Enables or disables the trendline. Valid values are:
Is string that defines the trendline mode (the type of equation used to generate the trendline). Valid values are:
Controls the visibility of the equation label. Valid values are:
Is a string that defines the size, style, and, typeface of the equation label. The default value is '8pt Sans-Serif'.
Is a color defined by a color name or numeric specification string. The default value is 'black'.
Is a string that defines the equation label mode. Valid values are;
The following request against the GGSALES data source generates a scatter chart with a linear trendline for series 2:
GRAPH FILE GGSALES
SUM BUDDOLLARS BUDUNITS DOLLARS
BY PRODUCT
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET LOOKGRAPH SCATTERS
ON GRAPH SET STYLE *
*GRAPH_JS
series: [
{series: 0, color: 'red'},
{series: 1, color: 'green'},
{series: 2, color: 'blue', trendline: {enabled:true,mode: 'linear'}}
]
*END
INCLUDE=ENIADefault_combine.sty,$
ENDSTYLE
END
The output is:
The following version of the request adds a purple equation label:
GRAPH FILE GGSALES
SUM BUDDOLLARS BUDUNITS DOLLARS
BY PRODUCT
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET LOOKGRAPH SCATTERS
ON GRAPH SET STYLE *
*GRAPH_JS
series: [
{series: 0, color: 'red'},
{series: 1, color: 'green'},
{series: 2, color: 'blue',
trendline: {
enabled:true,
mode: 'linear',
equationLabel:{visible:true, color:'purple'}}}
]
*END
INCLUDE=ENIADefault_combine.sty,$
ENDSTYLE
END
The output is:
WebFOCUS |