|
<SfChart Theme="@Theme">
<ChartEvents OnAxisLabelRender="AxisLabelRender" Loaded="Loaded"></ChartEvents>
// add your additional code here
<ChartPrimaryYAxis LabelFormat="{value}%" RangePadding="ChartRangePadding.None" Minimum="0" Maximum="100" Interval="20">
</ChartPrimaryYAxis>
<ChartSeriesCollection>
<ChartSeries DataSource="@ChartData" Name="Germany" XName="Period" Width="2"
Opacity="1" YName="ENG_InflationRate" Type="ChartSeriesType.Line">
<ChartMarker Shape="ChartShape.Diamond" Fill="#ffffd9" Visible="true" Width="10" Height="10">
<ChartMarkerBorder Color="black" Width="2"></ChartMarkerBorder>
</ChartMarker>
</ChartSeries>
<ChartSeries DataSource="@ChartData" Name="England" XName="Period" Width="2"
Opacity="1" YName="GER_InflationRate" Type="ChartSeriesType.Line">
<ChartMarker Shape="ChartShape.Diamond" Fill="#1d8cbe" Visible="true" Width="10" Height="10">
<ChartMarkerBorder Color="black" Width="2"></ChartMarkerBorder>
</ChartMarker>
</ChartSeries>
</ChartSeriesCollection>
</SfChart>
// add your additional code here
public string[] Labels = new string[] { "Label1", "Label2", "Label3", "Label4", "Label5", "Label6" };
public void AxisLabelRender(AxisLabelRenderEventArgs args)
{
if (args.Axis.Name == "PrimaryYAxis")
{
args.Text = Labels[Count];
Count++;
Count = (Count < 6) ? Count : 0;
}
}
// add your additional code here |