Regression Line
Example
Summary of settings
- Type of chart: Scatter
- Mapping of "y" attribute: Profit
- Mapping of "x" attribute: Size
- Cardinality: City
- Overlays: polynomial 2 order regression line
Step-by-step instruction
Add new Chart Widget
Select "Scatter"
If there are multiple cubes connected to your application, you must select the cube you want for the chart.
To map the "x" attribute, select a measure or a formula for horizontal axes
Map the "y" attribute the same way as the "x" attribute.
The chart displays with one point, the total for measure selected on "x" axes plotted against total for measure selected on "y" axes.
To select Members you would like to plot, for example, members of the dimension City, click Options in the Legend area of the chart:
In the Options popup you can change various attributes, in this case map Cardinality to City:
Now, six points display on the scatter plot, since there are six members in the City dimension with Size and Profit linked to them:
Use filters to limit the scope of data in the view Filters
Now go back to Options (in the Legend) and switch to the Overlays tab to add a new overlay, in this case, a regression line:
On mouse hover, you can see the estimated parameters:
The chart is complete:
Back to Chart Gallery
Appendix
The appendix contains code snippets for advanced users.
MDX:
SELECT
{
[Measures].[Profit],
[Measures].[Size]
} ON COLUMNS,
NON EMPTY [Geography].[City].[City].Members ON ROWS
FROM [EquityDerivativesCube]
JSON:
{
"configurations": [
{
"handlers": {
/* ... */
},
"type": "scatter",
"mapping": {
"x": {
"from": "[Measures].[Size]"
},
"y": {
"from": "[Measures].[Profit]"
},
"cardinality": {
"from": ["[Geography].[City].[City]"]
}
},
"overlays": [
{
"key": "regression",
"args": {
"type": "polynomial"
}
}
]
}
]
}