Sort Horizontal Axis

2 posts, 0 answers
  1. Dfgsdfg
    Dfgsdfg avatar
    1 posts
    Member since:
    Dec 2011

    Posted 26 Mar 2012 Link to this post

    I just download telerik for WPF.

    I use ChartView and i would like to bind String on Horizontal Axis and sort it on an other binding.

    Is it possible ?

                <chart:RadCartesianChart Name="BarChart" Palette="Metro" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
                    <chart:RadCartesianChart.HorizontalAxis>
                        <chartView:CategoricalAxis Title="HorizontalAxis" LabelFitMode="MultiLine" LabelStyle="{StaticResource AxisLabelStyle}" >
                            <chartView:CategoricalAxis.TitleTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding StepPosition}" Margin="0,6,0,10" Style="{StaticResource AxisTitleStyle}" />
                                </DataTemplate>
                            </chartView:CategoricalAxis.TitleTemplate>
                        </chartView:CategoricalAxis>
                    </chart:RadCartesianChart.HorizontalAxis>
     
                    <chart:RadCartesianChart.VerticalAxis>
                        <chartView:LinearAxis  Title="VerticalAxis" LabelStyle="{StaticResource AxisLabelStyle}" >
                            <chartView:LinearAxis.TitleTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding}" Margin="0,6,0,10" Style="{StaticResource AxisTitleStyle}" />
                                </DataTemplate>
                            </chartView:LinearAxis.TitleTemplate>
                        </chartView:LinearAxis>
                    </chart:RadCartesianChart.VerticalAxis>
     
                    <chartView:BarSeries ItemsSource="{Binding Inventory.View}" ValueBinding="CountBatch" CategoryBinding="StepPosition" 
    StringBinding="Step"
    />                                           </chart:RadCartesianChart>
  2. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 29 Mar 2012 Link to this post

    Hello,

    The chart view does not sort categories. If you want to see the categories in some order - you will need to sort the data prior to setting the chart view's items source.

    I do not recognize this StringBinding property of the BarSeries. What would you expect that such a property will do?

    Regards,
    Petar Marchev
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top