MIsalignment of Primary and Secondary Y-Axis

2 posts, 0 answers
  1. Ralph
    Ralph avatar
    6 posts
    Member since:
    Aug 2007

    Posted 02 Sep 2010 Link to this post

    Good morning to all

    I am having a problem using a second Y Axis where I wish them both to start from zero and be labeled as such. I did this post this as a reply to this message:  http://www.telerik.com/community/forums/silverlight/chart/how-to-line-up-multi-y-axis-0-level.aspx  but I failed to note that it was answered already. I did attempt to follow the instructions there but to no avail with the chart that I am getting still looking like the attached image...

    Note that the tool tip for the line series is showing $0 which is the correct amount for that time point afetr the payment of $178.09 dollars has occurred as seen in the 'Payment Schedule' seen to the right in the picture.
    The chart is declared in the XAML as follows:

    <telerik:RadChart x:Name="myChart"
                      Margin="0 10 0 10"
        <Grid ShowGridLines="False">
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            <telerik:ChartTitle Content="Payments and Balances"
                                telerik:StyleManager.Theme="Windows7" />
            <telerik:ChartArea x:Name="ChartArea1"
                               Padding="2 2 2 2"
                               telerik:StyleManager.Theme="Windows7" />

    And populated by code as follows:
    Dim barSeries As DataSeries = GetPaymentSeriesForChart()
    barSeries.LegendLabel = "Payments"
    barSeries.Definition = New BarSeriesDefinition
    barSeries.Definition.ShowItemLabels = False
    barSeries.Definition.ShowItemToolTips = True
    barSeries.Definition.ItemToolTipFormat = "#Y{C0}"
    Dim lineSeries As DataSeries = GetBalanceSeriesForChart()
    lineSeries.LegendLabel = "Balance"
    lineSeries.Definition = New LineSeriesDefinition
    lineSeries.Definition.ShowItemLabels = False
    lineSeries.Definition.ShowItemToolTips = True
    lineSeries.Definition.ItemToolTipFormat = "#Y{C0}"
    lineSeries.Definition.AxisName = "Balance"
    ChartArea1.AxisX.AutoRange = True
    ChartArea1.AxisX.DefaultLabelFormat = "MMM-yy"
    ChartArea1.AxisX.LabelRotationAngle = -90
    ChartArea1.AxisY.AutoRange = False
    ChartArea1.AxisY.DefaultLabelFormat = "#VAL{C0}"
    ChartArea1.AxisY.LabelRotationAngle = -30
    ChartArea1.AxisY.AddRange(0, _paymentMax, GetYScale(_paymentMax, 5))
    ChartArea1.AdditionalYAxes.Add(New AxisY())
    ChartArea1.AdditionalYAxes(0).AxisName = "Balance"
    ChartArea1.AdditionalYAxes(0).DefaultLabelFormat = "#VAL{C0}"
    ChartArea1.AdditionalYAxes(0).LabelRotationAngle = 30
    ChartArea1.AdditionalYAxes(0).AutoRange = False
        ChartArea1.AdditionalYAxes(0).AddRange(0, CDbl(txtBxAmntOwing.Text) * 1.1, GetYScale(CDbl(txtBxAmntOwing.Text) * 1.1, 5))
    Catch ex As Exception
    End Try

    Note that I am trying to have both Y-Axes have $0 as their starting minimum value. It would seem that the values on the chart are correct when checked by showing the tooltips for the datapoints but the additional Y-Axis (on the right) ends up with the wrong values.

    Any thoughts on what I am doing wrong would be most appreciated.


    Ralph Price
  2. Ves
    Ves avatar
    2926 posts

    Posted 06 Sep 2010 Link to this post

    Hi Ralph,

    Please, find my answer in the other forum thread.

    Best regards,
    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
Back to Top