Following the answers on my previous question in June, I would like to use the icCube HSL() formula to define the colors of the chart members in the amChart widget.
In the standard schema Sales I use the following MDX:
with
member [measures].[hue] as 16
member [measures].[saturation] as 1-indexof([Rubriek].[Rubriek].currentmember.siblings,[Rubriek].[Rubriek].currentmember)/30
member [measures].[lightness] as 0.2+ordinal(level([Rubriek].[Rubriek].currentmember))/10
member [measures].[color-hsl] as hsl([hue],[saturation],[lightness])
member [measures].[color-fixed] as "#FF0000"
SELECT
{ {[Measures].[Amount],[measures].[color-hsl],[measures].[color-fixed]} } ON COLUMNS,
{ [Product].[Product].firstNotAllLevel().allmembers } ON ROWS
FROM [Sales]
I have added 2 color fields:
color-hsl = the HSL defined color based on level depth of the product hierarchy and the position of the member among its siblings
color-fixed = just a hexadecimal color, for testing purposes
Now when I define a combo chart, I can set the color field in the 'Advanced properties':
- [{"colorField":"color-hsl"}]
Except, this does not give me the calculated colors. But, if I change the colorField to color-fixed it gives me the red color as defined.
Questions:
- How can I achieve that the color-hsl is working. Do I have to convert it to a hexadeximal string? How can I achieve that?
- How can I get rid of the data value for color-hsl. I only want to use this as a field to define the color, not the value (that is the "Amount") field in my mdx?