BarSeries skips categories by possible interval in CategoryAxis
I am creating a BarSeries that contains a lot of data for the CategoryAxis. It looks like that the BarSeries is skipping some categories to create a barseries in the chart. Is there a default interval that BarSeries may have skipped due to large data? What properties of the BarSeries affects this rendering of the data?
Hi Eric,
Upon reviewing your query, it appears that the CategoryAxis labels may be skipping due to the large amount of data present in the BarSeries. When there are a large number of data points, the axis labels might be skipped to ensure optimal rendering performance. Currently, we displays around 3 labels per 100 pixels on the screen, which can result in some labels being skipped.
To address this and ensure that all axis labels are displayed, we recommend adjusting the LabelsIntersectAction property in the axis. By setting it to MultipleRows and Wrap, you can display a more number of labels by allowing them to wrap onto multiple rows. Additionally, consider using the Label rotation angle. It displays the axis label based on the desired angle. Here we provided Knowledge Base (KB) Link for your reference.
KB Link: Axis Labels in WPF SfChart
If you have any further questions or need additional assistance, please feel free to let us know.
Regards,
Dhanaraj Rajendran.
Hi Dhanaraj,
I adjusted the LabelsIntersectAction property in the axis with MultipleRows and Wrap and it did not make any effect on the chart. I also attempted to adjust the interval property to 1 but it would still skip categories and the corresponding BarSeries.
When I adjust the height property value of the chart to 500, all of the category labels are displayed. My understanding is that when the set height value is large enough, it fits all of the category axis labels. If I adjust the height to a value less than 500, then the chart automatically skips data to fit inside the set height.
Is there a way to force the chart to make all labels visible for all series according to the data size?
Hi Eric,
After validating your query, adjusting the LabelsIntersectAction property to MultipleRows and Wrap may not have had the desired effect due to the default behavior of the chart. As mentioned earlier, the chart typically displays around 3 labels per 100 pixels on the screen to optimize user experience, resulting in some labels being skipped.
To ensure that all labels are visible for all series according to the data size, we recommend utilizing the AutoScrollingMode and AutoScrollingDelta properties of the axis in conjunction with the ZoomPanBehavior. By configuring these properties, you can control the amount of data displayed on the screen and enable panning functionality to navigate through the available data.
Furthermore, if all labels are not shown even after adjusting these properties, you may consider reducing the FontSize of the axis labels. Below is an example code snippet for reference:
|
<syncfusion:SfChart> . . . <syncfusion:SfChart.Behaviors> <syncfusion:ChartZoomPanBehavior EnablePanning="True"/> </syncfusion:SfChart.Behaviors>
<syncfusion:SfChart.PrimaryAxis> <syncfusion:CategoryAxis AutoScrollingMode="Start" AutoScrollingDelta="20" FontSize="10"/> </syncfusion:SfChart.PrimaryAxis> . . . </syncfusion:SfChart> |
Output:
Please feel free to reach out if you have any further questions or concerns.
Regards,
Dhanaraj Rajendran.
- 3 Replies
- 2 Participants
-
EN Eric Nguyen
- Apr 16, 2024 12:56 PM UTC
- Apr 25, 2024 02:03 PM UTC