区别与其他框架封装的echarts,我看都是只有最顶层一层标签,然后完全套用echarts的配置,我是把所有echarts的配置转换成了标签加属性,像下面这样:
<ECharts Style="width: 800px; height: 400px;">
<Title text="ECharts 入门示例"></Title>
<Legend data="@(new[] { "销量" })"></Legend>
<Tooltip></Tooltip>
<XAxis>
@foreach (var item in new[] { "衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子" })
{
<Data value="@item">
<TextStyle color="red"></TextStyle>
</Data>
}
</XAxis>
<YAxis>
<AxisLabel formatter="(value, index) => {return value +
':';}"></AxisLabel>
</YAxis>
<Series name="销量" type="bar" data="@(new[] { 5, 20, 36, 10, 10, 20 })">
</Series>
</ECharts>
目前我也不是太清楚这种方案和传统的属性方案哪种好,只是多一个技术方案的尝试,而且还有很大改造空间,下面是github的地址:
https://github.com/draculakkk/TagEChartsBlazor
从 Windows 版邮件<https://go.microsoft.com/fwlink/?LinkId=550986>发送