Positive Negative Sorted Bars Chart
Example
Summary of settings
- Type of chart: Bars
- Mapping of
y
attribute: City - Mapping of
x
attribute: Profit - Cities are sorted by profit
- Color is mapped to a measure, in this case profit
- The Positive/Negative color profile is selected
Step-by-step instruction
Add new Chart Widget.
Select Bars.
If there are multiple cubes connected to your application, you must select the cube you want for the chart.
To map the
y
attribute, select members of a dimension you would like to see on the vertical axis, in this case City.To map the
x
attribute, select the value (measure) corresponding to the horizontal axis, in this case Profit.The chart displays with axes mapped.
To sort the chart by Profit, click the Sort icon next to the axis label:
Assign colors to bars. In the Options popup (from Legend) find the field Color, click its link icon, and map it to the correct axis's measure.
Apply the Positive/Negative color profile. In the Options popup (from Legend), click the measure name in the Color field. Select Options. In the Color profile field, select Positive/Negative.
The example is complete:
Back to Legacy Chart Gallery
Appendix
The appendix contains code snippets for advanced users.
MDX:
SELECT
NON EMPTY Order(
[Geography].[City].[City].Members,
[Measures].[Profit],
BASC
) ON ROWS,
[Measures].[Profit] ON COLUMNS
FROM [EquityDerivativesCube]
JSON:
{
"configuration": {
"elementStylers": ["selection-highlight"],
"type": "combo-horizontal-histogram",
"mapping": {
"y": {
"from": ["[Geography].[City].[City]"]
},
"x": {
"from": "[Measures].[Profit]"
},
"color": {
"from": "[Measures].[Profit]",
"profile": "positive-or-negative"
}
}
}
}