简体   繁体   English

AnyChart-图例未与旭日形图一起显示(树数据)

[英]AnyChart - legend not shown with sunburst chart (tree data)

I want a legend to appear in my sunburst chart (to be able to hide data on click). 我希望图例出现在我的森伯斯特图表中(以便能够在单击时隐藏数据)。

Here is an official example of a sunburst chart: https://playground.anychart.com/gallery/Sunburst_Charts/Employee_Count_by_Country 这是朝阳图的官方示例: https : //playground.anychart.com/gallery/Sunburst_Charts/Employee_Count_by_Country

I tried to add: 我尝试添加:

chart.legend().enabled(true);

But I do not see any legend nor any error messages in the console. 但是我在控制台中看不到任何图例或错误消息。 The website says: 该网站说:

In AnyChart, the legend can be used with Basic Charts, Stock Charts, Maps, and every other chart type. 在AnyChart中,图例可与基本图表,股票图表,地图以及所有其他图表类型一起使用。

So i expected the legend to show up, but it doesn't. 所以我希望传说会出现,但事实并非如此。

1) If you remove the custom coloring (like chart.fill() and palette), you'll see the default anychart palette. 1)如果删除自定义颜色(如chart.fill()和调色板),则会看到默认的anychart调色板。

2) Sunburst chart uses tree-data. 2)森伯斯特图表使用树状数据。 It is not the series separation by category or value. 这不是按类别或值进行的序列分离。

It means that is not clear how to provide legend data. 这意味着不清楚如何提供图例数据。 Separation by root data? 通过根数据分离? By values? 通过价值观? By any additional conditions? 还有其他条件吗? That's why legend is not included in sunburst by default. 这就是为什么图例默认情况下不包含图例。 In this case customer is able to use standalone legend to provide any data. 在这种情况下,客户可以使用独立的图例提供任何数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM