我正在使用 Razor Components,对non-static values在list of objects.
我有以下代码:
@page "/CircularGauge/DefaultFunctionalities"
@using Syncfusion.EJ2.RazorComponents.CircularGauge
<div class="control-section">
<EjsCircularGauge ID="gauge" Axes="axes"></EjsCircularGauge>
</div>
@functions {
int myInteger = 21;
public List<Object> axes { get; set; } = new List<Object>
{
new
{
radius = "80%",
startAngle = 230,
endAngle = 130,
majorTicks = new { width = "0px" },
minorTicks = new { width = "0px" },
lineStyle = new { width = 8, color = "#E0E0E0" },
labelStyle = new { font = new { fontFamily = "Roboto", size = "12px", fontWeight = "Regular" }, offset = -5 },
pointers = new List<Object>
{
new
{
value = 60,
radius = "60%",
color = "#757575",
pointerWidth = 7,
cap = new { radius = 8, color = "#757575", border = new { width = 0 } },
needleTail = new { color = "#757575", length = "25%" }
}
}
}
};
}
来源:https ://ej2.syncfusion.com/aspnet-core-blazor/CircularGauge/DefaultFunctionalities
我在我的代码中使用了一个整数,例如:
int myInteger = 21;
我想做的是在上面的代码中:
pointers = new List<Object>
{
new
{
****value = 60,****
radius = "60%",
color = "#757575",
pointerWidth = 7,
cap = new { radius = 8, color = "#757575", border = new { width = 0 } }
}
正在将 的值更改value为我的本地整数,但这是不可能的。
这就是为什么
我一直在寻找解决方案。有没有人对此有所了解?
墨色风雨
相关分类