X axis category lables are not showing correctly
I am trying to use line chats but when I pass x and y axis data as an array, X axis category labels are not showing except first one. I can't find the reason. For data, category names are coming correctly. Below is the code. Screenshot of the view attached to this as a zip
<SfChart UseGroupingSeparator="true">
<ChartArea><ChartAreaBorder Width="0" /></ChartArea>
<ChartPrimaryYAxis LabelFormat="@labelformat2" IntervalType="Syncfusion.Blazor.Charts.IntervalType.Auto" EdgeLabelPlacement="EdgeLabelPlacement.Shift">
<ChartAxisLineStyle Width="0" />
<ChartAxisMajorTickLines Width="0" />
</ChartPrimaryYAxis>
<ChartPrimaryXAxis
ValueType="Syncfusion.Blazor.Charts.ValueType.Category"
Interval="10"
LabelIntersectAction="LabelIntersectAction.Rotate90">
<ChartAxisMajorGridLines Width="0" />
</ChartPrimaryXAxis>
<ChartTooltipSettings Enable="true" />
<ChartSeriesCollection>
<ChartSeries DataSource="@hourlyWiseDashboardData"
XName="HourPeriod"
YName="Amount"
PointColorMapping="Color"
Type="ChartSeriesType.Line">
<ChartMarker Visible="true">
<ChartDataLabel Visible="true" />
</ChartMarker>
</ChartSeries>
</ChartSeriesCollection>
</SfChart>
Attachment: Screenshot_20241102_170912_a2808453.zip
Hi Lasitha,
Greetings from Syncfusion.
We have reviewed your reported scenario using the provided code snippet and screenshot. It appears that you have set the x-axis interval to 10, which results in only the first axis label being displayed, with the next label appearing after every 10 intervals. We recommend removing the interval setting, as it will be calculated automatically based on the provided data points. For your reference, we have attached the tested sample and a screenshot.
Sample : https://www.syncfusion.com/downloads/support/directtrac/general/ze/AxisLabel1600043019.zip
Please revert us if you have any concerns.
Regards,
Durga Gopalakrishnan.
Hi
Durga,
thank you for quick replay.
<SfChart UseGroupingSeparator="true" Palettes="@palettes">
<ChartArea><ChartAreaBorder Width="0" /></ChartArea>
<ChartPrimaryYAxis
LabelFormat="@labelformat2"
LabelIntersectAction="LabelIntersectAction.Rotate45"
>
<ChartAxisLineStyle Width="0" />
<ChartAxisMajorTickLines Width="1" />
</ChartPrimaryYAxis>
<ChartPrimaryXAxis
ValueType="Syncfusion.Blazor.Charts.ValueType.Category"
LabelIntersectAction="LabelIntersectAction.Rotate45">
<ChartAxisMajorGridLines Width="0" />
</ChartPrimaryXAxis>
<ChartTooltipSettings Enable="true" />
<ChartSeriesCollection>
<ChartSeries DataSource="@hourlyWiseDashboardData"
XName="HourPeriod"
YName="Amount"
PointColorMapping="Color"
Type="ChartSeriesType.Line">
<ChartMarker Visible="true">
<ChartDataLabel Visible="true" />
</ChartMarker>
</ChartSeries>
</ChartSeriesCollection>
</SfChart>
in this code, Y axis
LabelIntersectAction also not working. Can you check that as well?
Thank You.
Hi Lasitha,
We have analyzed your query, and LabelIntersectAction only supports "Hide" and "Trim" options in ChartPrimaryYAxis. We have attached a sample and a screenshot for your reference. Please find below the sample used for testing.
Sample: https://blazorplayground.syncfusion.com/BtVJMijHJITqCkip
Screenshot:
Regards,
Gopalakrishnan Veeraraghavan
- 3 Replies
- 3 Participants
- Marked answer
-
L- Lasitha - BLUE LOTUS X
- Nov 2, 2024 11:41 AM UTC
- Nov 6, 2024 04:02 PM UTC