ant-design-blazor / ant-design-blazor/ant-design-charts-blazor

Create chart-config at runtime does not work!

未关闭
#52 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
C#
星标
186
派生
44
PR 合并指标
30 天内没有已合并 PR

描述

Hi Ant-Community,

_**Background**:
I use the same page for the display of charts, but pass a parameter that processes the data per department. To make it visible on the report which department it is, the title of the chart has to be set dynamically after loading the page.
However, I cannot do this the way it is indicated in Ant examples, but I have to define the config at a later time (preferably in a method) and compose titles dynamically there._

**1 .**
So, to set chart titles dynamically, I define first the config:

Definition
![image](https://user-images.githubusercontent.com/45635963/118956185-ab2fcb80-b95f-11eb-8086-8e9e11489bb0.png)
.
.
.
**2 .**
Then I create config at runtime in a function:

![image](https://user-images.githubusercontent.com/45635963/118955531-10cf8800-b95f-11eb-8352-122736bf8815.png)

Title is then displayed, but its content remains unchanged (so chart is not updated when a date range changes)!

If I define configutration statically again (like in your examples), everything works fine.

![image](https://user-images.githubusercontent.com/45635963/118955908-6d32a780-b95f-11eb-9c1c-e1c69f25c4eb.png)

The problem here is that I can only define titles once and it always stays the same for the whole time!

Is this an error in the chart component or is there another way to set the title dynamically?

Thanks

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。