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

Sort Horizontal Axis

1 Answer 203 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Dfgsdfg
Top achievements
Rank 1
Dfgsdfg asked on 26 Mar 2012, 02:56 PM
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>

1 Answer, 1 is accepted

Sort by
0
Petar Marchev
Telerik team
answered on 29 Mar 2012, 09:04 AM
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 >>
Tags
ChartView
Asked by
Dfgsdfg
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
Share this question
or