ant-design-charts-blazor
ant-design-charts-blazor copied to clipboard
Chart Title and Description is not Displayed
Hi, I have got an issue when displaying the title and description of the cart. Here is a simple code snippet. Please let me know what is missing in my code. I did everything as described in the documentation.
`@page "/"
<Line Data="@data" Config="@config"></Line>
@code{ LineConfig config;
object[] data;
protected override void OnInitialized()
{
SetChartConfigurations();
data = new object[] {
new { year= "1991", value= 3 },
new { year= "1992", value= 4 },
new { year= "1993", value= 3.5 },
new { year= "1994", value= 5 },
new { year= "1995", value= 4.9 },
new { year= "1996", value= 6 },
new { year= "1997", value= 7 },
new { year= "1998", value= 9 },
new { year= "1999", value= 13 },
};
}
private void SetChartConfigurations()
{
config = new LineConfig()
{
IsStack=true,
Title = new AntDesign.Charts.Title()
{
Visible = true,
Text = "Test1",
Style = new TextStyle()
{
FontFamily = "arial",
FontSize = 16
}
},
Description = new AntDesign.Charts.Description()
{
Visible = true,
Text = "Test1",
Style = new TextStyle()
{
FontFamily = "arial",
FontSize = 8
}
},
Padding = "auto",
ForceFit = true,
XField = "year",
YField = "value",
Smooth = true
};
}
} `
@12sameera , per the upgrade guide from G2Plot, Title and Description is no longer supported. Do note that ForceFit is also no longer supported and has been renamed to AutoFit.