使用 icCube HSL 颜色公式设置 amChart 值的颜色

using icCube HSL color formula to set the color for the amChart values

按照 my previous question in June, I would like to use the icCube HSL() formula 上的答案定义 amChart 小部件中图表成员的颜色。

在标准模式销售中,我使用以下 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]

我添加了2个色域:

现在当我定义组合图表时,我可以在 'Advanced properties':

中设置颜色字段

除此之外,这没有给我计算出的颜色。但是,如果我将 colorField 更改为颜色固定,它会给我定义的红色。

问题:

  1. 我怎样才能使 color-hsl 正常工作。我必须将它转换为十六进制字符串吗?我怎样才能做到这一点?
  2. 如何去掉 color-hsl 的数据值。我只想将其用作定义颜色的字段,而不是我的 mdx?
  3. 中的值(即 "Amount")字段

MDX 中的颜色函数 returns 一个整数值,例如2334. 如果你想在浏览器中使用它,你必须将它转换为十六进制字符串表示形式:

ToHexColor( colorAsInteger ) 即 returns