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

Horizontal Bar chart

1 Answer 108 Views
Chart
This is a migrated thread and some comments may be shown as answers.
nixon
Top achievements
Rank 1
nixon asked on 08 Apr 2010, 02:44 PM
Hi there, we are facing some problems with the horizontal bar chart, we cant get the x-axis (which in this case is the y-axis actually) display the numberformat as we wants. Our data collection contains only integers but the axis displays this as decimals. Please have a look on attached picture.

Further, do you have any examples in doing this in xaml, it seems that you on telerik is totally code behind oriented, all your examples are done that way which in my opinion is a little bit the opposite than the rest of the community are doing things, declartive.
Also i would like to give a somewhat negative comment about your examples, first you are mostly only showinng examples for codebehingd. Secondly, i dont think the examples are showing your feateures very well, take for instance the horizontal charts, here you are never showing to your customers how to display strings instead of integers both for x and y axis. At the moment it isnt very much RAD development for us.

Regards Niclas

 <telerikChart:RadChart x:Name="HorizontalChart" Height="300" Margin="40" 
                                Style="{StaticResource RadChartStyle1}" ItemsSource="{Binding ManufacturersCollection}">  
 
                            <telerikChart:RadChart.DefaultView> 
                                <telerikCharting:ChartDefaultView ChartLegendPosition="Right">  
 
                                    <telerikCharting:ChartDefaultView.ChartLegend> 
                                        <telerikCharting:ChartLegend x:Name="chartLegend" Header="" Background="White" 
                                                BorderBrush="{x:Null}" VerticalContentAlignment="Top" Padding="5" 
                                                HorizontalContentAlignment="Right" HorizontalAlignment="Center" /> 
                                    </telerikCharting:ChartDefaultView.ChartLegend> 
 
                                    <telerikCharting:ChartDefaultView.ChartArea> 
 
                                        <telerikCharting:ChartArea Background="White" ItemToolTipDelay="2">  
 
                                            <telerikCharting:ChartArea.AxisX> 
                                                <telerikCharting:AxisX /> 
                                            </telerikCharting:ChartArea.AxisX> 
 
                                            <!-- Transactions Y axis --> 
                                            <telerikCharting:ChartArea.AxisY> 
                                                <telerikCharting:AxisY MajorGridLinesVisibility="Visible" 
                                                        MinorTicksVisibility="Visible"   
                                                        DefaultLabelFormat="#VAL" StripLinesVisibility="Collapsed" /> 
                                            </telerikCharting:ChartArea.AxisY> 
 
                                        </telerikCharting:ChartArea> 
                                    </telerikCharting:ChartDefaultView.ChartArea> 
 
                                </telerikCharting:ChartDefaultView> 
                            </telerikChart:RadChart.DefaultView> 
 
                            <telerikChart:RadChart.DefaultSeriesDefinition> 
                                <telerikCharting:HorizontalBarSeriesDefinition /> 
                            </telerikChart:RadChart.DefaultSeriesDefinition> 
 
                            <telerikChart:RadChart.SeriesMappings> 
                                <telerikCharting:SeriesMapping> 
                                    <telerikCharting:SeriesMapping.SeriesDefinition> 
                                        <telerikCharting:HorizontalBarSeriesDefinition ShowItemLabels="False" 
                                                ShowItemToolTips="True" 
                                                ItemToolTipFormat="#DATAITEM.Key: #DATAITEM.Value{#}" 
                                                LegendDisplayMode="DataPointLabel" /> 
                                    </telerikCharting:SeriesMapping.SeriesDefinition> 
                                    <telerikCharting:SeriesMapping.ItemMappings> 
                                        <telerikCharting:ItemMapping DataPointMember="YValue" FieldName="Visits" /> 
                                        <telerikCharting:ItemMapping DataPointMember="LegendLabel" FieldName="Name" /> 
                                        <telerikCharting:ItemMapping DataPointMember="XCategory" FieldName="Name" /> 
 
                                    </telerikCharting:SeriesMapping.ItemMappings> 
                                </telerikCharting:SeriesMapping> 
                            </telerikChart:RadChart.SeriesMappings> 
 
                        </telerikChart:RadChart> 

1 Answer, 1 is accepted

Sort by
0
Giuseppe
Telerik team
answered on 13 Apr 2010, 11:53 AM
Hi nixon,

Thank you for your feedback.

Onto your questions:
  • If you would like to display integer step on the AxisY, you need to set AxisY.AutoRange to false and specify the AxisY.MinValue / MaxValue / Step properties manually (the AxisY does not support this feature automatically).
  • Indeed, currently the chart examples do contain lots of code behind code and we recognize the need to modify them so they become more declarative and xaml-friendly. We hope we will be able to address this task for the Q2 2010 release of the control (around July).
  • You can find a help article on creating categorical charts here (note that categories are supported only for the AxisX, and not for AxisY). The AxisX support for categories is universal (i.e. it does not depends on the specific series type) and that is why we decided not to add examples for each specific series type. Also, categories are featured on a number of examples in the demo application e.g. here, here, here, here, etc.


Best wishes,
Freddie
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Chart
Asked by
nixon
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Share this question
or