【问题标题】:using icCube HSL color formula to set the color for the amChart values使用 icCube HSL 颜色公式为 amChart 值设置颜色
【发布时间】:2015-09-28 09:45:17
【问题描述】:

根据my previous question in June 上的答案,我想使用icCube HSL() formula 来定义amChart 小部件中图表成员的颜色。

在标准模式 Sales 中,我使用以下 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 个颜色字段:

  • color-hsl = HSL 定义的颜色,基于产品层次结构的层级深度和成员在其兄弟姐妹中的位置

  • color-fixed = 只是一个十六进制颜色,用于测试目的

现在当我定义一个组合图表时,我可以在“高级属性”中设置颜色字段:

  • [{"colorField":"color-hsl"}]

除了,这不会给我计算出的颜色。但是,如果我将 colorField 更改为颜色固定,它会给我定义的红色。

问题:

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

【问题讨论】:

  • 1.回答,2. 不清楚...

标签: amcharts iccube-reporting


【解决方案1】:

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

ToHexColor(colorAsInteger) 返回

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-08-31
    • 1970-01-01
    • 2015-12-28
    • 1970-01-01
    • 2011-05-04
    • 2014-10-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多