ant-design-charts-blazor icon indicating copy to clipboard operation
ant-design-charts-blazor copied to clipboard

Chart Title and Description is not Displayed

Open 12sameera opened this issue 3 years ago • 1 comments

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 avatar May 20 '22 04:05 12sameera

@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.

MaggiGorengAyam avatar Jan 12 '23 04:01 MaggiGorengAyam