SfChart - Force chart to show the name of y-axes

Hi there,

how can we force the component to show the name of the y-axis?

e.g. https://blazor.syncfusion.com/demos/chart/multi-colored-line?theme=bootstrap4



In this example it just magically shows up.
In my chart, it is hidden, and I have no idea why, and I cannot force the chart to show it. Any idea?

Haven't found anything in your documentation.

Cheers,
Volker

3 Replies 1 reply marked as answer

DG Durga Gopalakrishnan Syncfusion Team January 19, 2021 02:18 PM UTC

Hi Volker,

Greetings from Syncfusion.

You can specify title for X and Y axis using axis Title property. We have also documented this topic in UG. Please check with below link.

<SfChart>
    <ChartPrimaryYAxis Title="Profit($)">
    </ChartPrimaryYAxis>
</SfChart>


Please revert us if you have any concerns.

Regards,
Durga G




VO Volker January 19, 2021 03:56 PM UTC

Hi Durga,

thank you for the quick response.

It doesn't work in my test-chart:

<SfChart Title="Test" Theme="Syncfusion.Blazor.Theme.Bootstrap4" UseGroupingSeparator="true" Height="500">
    
    <ChartArea>
        <ChartAreaBorder Width="0">ChartAreaBorder>
    ChartArea>
 
    <ChartPrimaryXAxis EdgeLabelPlacement="EdgeLabelPlacement.Shift" ValueType="Syncfusion.Blazor.Charts.ValueType.DateTime">
        <ChartAxisCrosshairTooltip Enable="true">ChartAxisCrosshairTooltip>
        <ChartAxisMajorGridLines Width="0">ChartAxisMajorGridLines>
    ChartPrimaryXAxis>
 
    <ChartPrimaryYAxis Title="Row 1"
                       OpposedPosition="false"
                       LabelFormat="n0"
                       RowIndex="1"
                       ValueType="Syncfusion.Blazor.Charts.ValueType.Double"
                       MinorTicksPerInterval="0"
                       Minimum="0"
                       PlotOffset="30">
        <ChartAxisLineStyle Width="0">ChartAxisLineStyle>
        <ChartAxisMajorGridLines Width="1">ChartAxisMajorGridLines>
        <ChartAxisMajorTickLines Width="1">ChartAxisMajorTickLines>
        <ChartAxisMinorTickLines Width=".5">ChartAxisMinorTickLines>
    ChartPrimaryYAxis>
 
    <ChartAxes>
        <ChartAxis Title="Row 2"
                   OpposedPosition="false"                    LabelFormat="n0"                    Name="secondary"                    RowIndex="0"                    RangePadding="ChartRangePadding.Round">             <ChartAxisLineStyle Width="1">ChartAxisLineStyle>             <ChartAxisMajorGridLines Width="1">ChartAxisMajorGridLines>         ChartAxis>     ChartAxes>     <ChartLegendSettings Visible="false">ChartLegendSettings>     <ChartTooltipSettings Enable="true" Shared="true">ChartTooltipSettings>     <ChartCrosshairSettings Enable="true" LineType="LineType.Vertical">         <ChartCrosshairLine Width="1">ChartCrosshairLine>     ChartCrosshairSettings>     <ChartRows>         <ChartRow Height="10%">ChartRow>         <ChartRow Height="90%">ChartRow>     ChartRows>     <ChartSeriesCollection>         <ChartSeries DataSource="@DataSource1"                      Name="Series 1"                      XName="iDate"                      YName="iSum"                      Width="2"                      Opacity="1"                      Type="ChartSeriesType.Area">         ChartSeries>         <ChartSeries DataSource="@DataSource2"                      Name="Series 2"                      XName="iDate"                      YName="iCount"                      YAxisName="secondary"                      Width="0"                      Opacity=".5"                      Type="ChartSeriesType.StepArea">         ChartSeries>     ChartSeriesCollection> SfChart> No titles on y-axes:


DG Durga Gopalakrishnan Syncfusion Team January 20, 2021 04:20 PM UTC

Hi Volker,

We have ensured your scenario with attached code snippet. Currently we are facing this problem in Bootstrap theme, since Y axis title text color is white and background color is also white, text is not visible. We suggest you use some other theme to resolve this issue meanwhile or you can specify color for title using TitleStyle property.


Please revert us if you have any concerns.

Regards,
Durga G


Marked as answer
Loader.
Up arrow icon