This is a migrated thread and some comments may be shown as answers.

How to limit number of categories in ChartView CategoricalAxis

2 Answers 144 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 05 Jun 2017, 01:18 AM

We are trying to use a ChartView with a LinearAxis for the vertical axis and a CategoricalAxis for the horizontal axis. Our issue is that we can't find a way to limit the number of category items in the horizontal view of the ChartView. We'd like to have a max of 14 items in the view before requiring the user to scroll to see more category items, but as it stands now, the more items that are added to the ChartView, the smaller and smaller the items get until their labels overlap.

Is there a way to limit the view of the ChartView to a max of 14 items so that the user can scroll to the right to see more items?

Thanks!

2 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 05 Jun 2017, 08:34 AM
Hello Chris,

The chart will plot a category slot for each distinct category in its data source. You cannot limit this without removing items from the data. Anyway, you can achieve your requirement using the chart's pan and zoom behavior. This way you can limit the visible area of the chart and scroll to see the rest of the data.

You can use the chart's HorizontalZoomRangeStart and HorizontalZoomRangeEnd to limit the viewport. Note that the properties work in relative units between 0 and 1.

Regards,
Martin Ivanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Pavel
Top achievements
Rank 1
answered on 12 May 2020, 12:21 PM
Check https://docs.telerik.com/devtools/wpf/controls/radchartview/axes/axis-smart-labels
Tags
ChartView
Asked by
Chris
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Pavel
Top achievements
Rank 1
Share this question
or