1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- @using wispro.sp.web.Services
- <AntDesign.Charts.Radar @ref="_chart" TItem="RadarDataItem" Config="_chartConfig"/>
- @if (HasLegend)
- {
- <Row Class="legend">
- <AntDesign.Col>
- <div class="legendItem">
- <p>
- <span class="dot" style="background-color: #aaa"></span>
- <span></span>
- </p>
- <h6></h6>
- </div>
- </AntDesign.Col>
- </Row>
- }
- @inject IChartService ChartService
- @code
- {
- [Parameter]
- public bool HasLegend { get; set; } = false;
- [Parameter]
- public int Height { get; set; } = 343;
- private IChartComponent _chart;
- private readonly RadarConfig _chartConfig = new RadarConfig
- {
- Height = 400,
- ForceFit = true,
- AngleField = "label",
- RadiusField = "value",
- SeriesField = "name",
- RadiusAxis = new ValueAxis
- {
- Grid = new BaseAxisGrid
- {
- Line = new BaseAxisGridLine
- {
- Type = "line"
- }
- }
- },
- Area = new RadarViewConfigArea
- {
- Visible = false
- },
- Point = new RadarViewConfigPoint
- {
- Visible = true
- },
- Legend = new Legend
- {
- Visible = true,
- Position = "bottom-center"
- },
- };
- protected override async System.Threading.Tasks.Task OnInitializedAsync()
- {
- await base.OnInitializedAsync();
- var data = await ChartService.GetRadarDataAsync();
- await _chart.ChangeData(data);
- }
- }
|