Few Questions

2 posts, 0 answers
  1. Erik
    Erik avatar
    314 posts
    Member since:
    Feb 2008

    Posted 23 Sep 2011 Link to this post


    I'm new to radChart, not to Telerik...

    I had a lot of issues, but could find out the most part on the site. I still have this issues:
    ** Please look at the attached image **

    1) The StackedBar radChart does not use it's full potentionally vertical space. It is always about 50% for the largest bar. Must i set somesort of scaling or something like that ?

    2) I have a sum on top of the bar. This is done by showing only the last/top stack label and hiding the rest (vb) I successfully changed it's font size (xaml resource), but want to change its back/fore ground also. (its now pink, like the last color of the last stack) but that has no effect. Please look at the XAML and code behind below. 

            <Style x:Key="TopItemLabelStyle" TargetType="telerik:SeriesItemLabel">
                <Setter Property="FontSize" Value="7" />
                <Setter Property="Background" Value="Black" />
                <Setter Property="Foreground" Value="White" />
            <telerik:AnimationSettings  />
                    <telerik:ChartTitle Visibility="Collapsed" />
                    <telerik:ChartArea Padding="5,0,6,0" IsTabStop="False" SmartLabelsEnabled="True" >
                        <telerik:ChartArea.Annotations >
                            <telerik:MarkedZone Background="Black" />
                            <telerik:AxisX Visibility="Collapsed" />
                            <telerik:AxisY Visibility="Collapsed" />
                    <telerik:ChartLegend Visibility="Collapsed" />

    VB code:

    Dim obj_Series As New SeriesMappingCollection
    rcAgeingAnalysis.ItemsSource = Nothing
    For i = 0 To 4
        Dim sm1 As New SeriesMapping()
        Dim d1 As New StackedBarSeriesDefinition()
        d1.ShowItemToolTips = True
        d1.ItemToolTipFormat = "#Y.Volume{#.00}" 
        d1.ShowItemLabels = (i = 4)
        If i = 4 Then
            d1.SeriesItemLabelStyle = TryCast(Me.rcAgeingAnalysis.Resources("TopItemLabelStyle"), Style)
            d1.ItemLabelFormat = "#STSUM"
            d1.LabelSettings.LabelDisplayMode = LabelDisplayMode.Outside
            d1.LabelSettings.Distance = 10
            d1.LabelSettings.ShowConnectors = True
        End If
        sm1.SeriesDefinition = d1
        sm1.SeriesDefinition.Appearance.Fill = New SolidColorBrush(Utils.StringToColor(mobj_AgeingColors(i)))
        sm1.LegendLabel = String.Empty
        sm1.CollectionIndex = i
        Dim im1 As ItemMapping = New ItemMapping
        im1.DataPointMember = DataPointMember.YValue
    Dim retVal As New List(Of Decimal())(5)
    retVal.Add(New Decimal(4) {1434, 254, 1654, 2534, 534})
    retVal.Add(New Decimal(4) {2123, 265, 1483, 1476, 432})
    retVal.Add(New Decimal(4) {1123, 2467, 245, 2476, 7653})
    retVal.Add(New Decimal(4) {235, 285, 1112, 298, 987})
    retVal.Add(New Decimal(4) {1345, 1754, 298, 1143, 1895})
    rcAgeingAnalysis.SeriesMappings = obj_Series
    rcAgeingAnalysis.ItemsSource = retVal


  2. Evgenia
    Evgenia avatar
    1396 posts

    Posted 28 Sep 2011 Link to this post

    Hi Erik,

    Onto your questions:
    1) You can control this by setting a manual Range for the YAxis (turn off the AutoRange property and provide your own MinValue, MaxValue and Step). On the other hand you may change the SeriesDefinition to StackBar100 . As it name says - the Bars will take 100% of the ChartArea Height.

    2) As to your issue with the style, could you please send us a runnable project where this reproduces? This way we'll be able to see all your Chart settings, investigate your project locally and get back to you with our findings/suggestions.

    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  3. DevCraft R3 2016 release webinar banner
Back to Top