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: number, trendline: { enabled: boolean, mode: 'string', equationLabel: { visible: boolean, font: 'string', color: 'string', mode: 'string' } } } ]
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:
Defines the properties of the equation label for the trendline.
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 generates a scatter chart with a linear trendline for series 2:
GRAPH FILE WF_RETAIL_LITE SUM DISCOUNT_US GROSS_PROFIT_US REVENUE_US BY BRAND 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 ENDSTYLE END
The output is:
The following version of the request adds a purple equation label:
GRAPH FILE WF_RETAIL_LITE SUM DISCOUNT_US GROSS_PROFIT_US REVENUE_US BY BRAND 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 ENDSTYLE END
The output is:
WebFOCUS |