英文:
IcCube reporting V8 : How to display amchart's widget's legend in an external DIV?
问题
使用 IcCube V7,我们能够在外部 DIV 中显示 AmChart 部件的图例。例如,对于显示具有相同图例项的多个图表的公共图例非常有用。
我们需要创建一个 HTML 部件来创建这个 DIV:
<div style="height: 100%; position: absolute; width: 100%; overflow-y: auto!important; overflow-x: hidden;">
<div id="MyLegend"><br /></div>
</div>
然后在部件中引用此 DIV:
数据呈现 > 图例 > 通用设置 > DIV ID
是否有办法在新的报告 V8 中实现这一功能?
英文:
Using IcCube V7, we were able to display the legend of an AmChart widget in an external DIV. Very useful for example to show only one common legend for multiple charts with same legend items.
We had to create a html widget to create the div :
<div style="height: 100%; position: absolute; width: 100%; overflow-y: auto!important; overflow-x: hidden;">
<div id="MyLegend"><br /></div>
</div>
Then refer to this DIV in the widget in :
Data render > Legend > General settings > Div Id
Is there a way to do this using new reporting V8?
答案1
得分: 2
不可能在外部div中显示图例。但是,您可以添加复选框小部件,并在图表 > 项目 > 颜色和选择颜色中设置其颜色。这样,它看起来就像一个图例。
为了确保图表中的颜色和复选框小部件中的颜色始终相同,您可以在成员的等级上使用分类颜色转换。为此,请使用以下MDX,并在分类颜色转换中选择 rank 列:
with
MEMBER [Measures].[rank] as rank([Geography].[Geography].currentMember,[Geography].[Geography].[Continent].allMembers)
SELECT
[Measures].[rank] on 0
[Geography].[Geography].[Continent].allMembers ON "MdxBuilderFilterItems"
FROM [Sales]
-- 对于环形图
// 生成的构建器
WITH
MEMBER [Measures].[rank] as rank([Geography].[Geography].currentMember,[Geography].[Geography].[Continent].allMembers)
SELECT
{[Measures].[#Articles],[Measures].[rank]} ON "value"
[Geography].[Geography].[Continent].allMembers ON "category"
FROM [Sales]
FILTERBY @{continent!∅}
英文:
It's not possible to show the chart's legend in an external div. However, you can add a checkbox widget and set its colors in chart > item > color & selection color. This way, it looks like a legend.
To make sure that the colors in the chart and in the checkbox widget are always the same, you can use a categorical color transformation on the rank of the member. For that, use the following MDX and select the rank column in the categorical color transformation:
-- For the checkbox widget
with
MEMBER [Measures].[rank] as rank([Geography].[Geography].currentMember,[Geography].[Geography].[Continent].allMembers)
SELECT
[Measures].[rank] on 0
[Geography].[Geography].[Continent].allMembers ON "MdxBuilderFilterItems"
FROM [Sales]
-- For the donut chart
// BUILDER GENERATED
WITH
MEMBER [Measures].[rank] as rank([Geography].[Geography].currentMember,[Geography].[Geography].[Continent].allMembers)
SELECT
{[Measures].[#Articles],[Measures].[rank]} ON "value"
[Geography].[Geography].[Continent].allMembers ON "category"
FROM [Sales]
FILTERBY @{continent!∅}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论