-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug Report] 1.72之后piechart点击图例隐藏图表数据的功能失效了 #2299
Labels
Comments
@bdon4000 https://github.com/masastack/MASA.Blazor/releases/tag/1.7.2 似乎没有改动echarts相关的代码,你是用了点击事件吗?你能提供复现代码吗? |
@page "/pages/others/500"
@inherits ProComponentBase
@layout MainLayout
<MCard Class="ma-4">
<MCardTitle>Test Pie Chart</MCardTitle>
<MCardText>
<div style="height: 400px">
<MECharts Style="height: 100%; width: 100%"
Option="@GetChartOption()">
</MECharts>
</div>
</MCardText>
</MCard>
@code {
private object GetChartOption()
{
var data = new[]
{
new { value = 1048, name = "Category A", itemStyle = new { color = "#FF4560" } },
new { value = 735, name = "Category B", itemStyle = new { color = "#FEB019" } },
new { value = 580, name = "Category C", itemStyle = new { color = "#775DD0" } },
new { value = 484, name = "Category D", itemStyle = new { color = "#00E396" } },
new { value = 300, name = "Category E", itemStyle = new { color = "#008FFB" } }
};
return new
{
tooltip = new
{
trigger = "item",
formatter = "{b}: {c} ({d}%)"
},
legend = new
{
type = "plain",
orient = "vertical",
right = "10%",
top = "middle"
},
series = new[]
{
new
{
name = "Test Data",
type = "pie",
radius = "70%",
center = new[] { "40%", "50%" },
data = data,
emphasis = new
{
itemStyle = new
{
shadowBlur = 10,
shadowOffsetX = 0,
shadowColor = "rgba(0, 0, 0, 0.5)"
}
}
}
}
};
}
}
<style>
/* 可选:添加一些自定义样式 */
::deep .echarts {
border-radius: 8px;
}
</style> |
@bdon4000 我觉得问题是 |
capdiem
added
status/resolved
The issue has been fixed
and removed
status/needs feedback
labels
Dec 27, 2024
@bdon4000 我测试过了,你原来的写法有问题,改成我说的那样就没问题了。 <MECharts Style="height: 100%; width: 100%"
Option="@_option">
</MECharts>
@code {
private object _option = null;
protected override void OnInitialized()
{
base.OnInitialized();
_option = GetChartOption();
}
} |
解决了 非常感谢帮助 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Masa.Blazor version
1.72
Hosting model
Blazor Server
Describe the bug
测试过最新的好用的版本是1.71。1.72之后点击图例只会让饼状图内对应区域重新刷新
Expected Behavior
No response
Steps To Reproduce
No response
Reproduction code
No response
.NET version
.net9
The text was updated successfully, but these errors were encountered: