Customized Yaxis range

2 posts, 0 answers
  1. Kurt Kluth
    Kurt Kluth avatar
    144 posts
    Member since:
    Oct 2009

    Posted 30 Jul 2015 Link to this post

    Is it possible to customize the range that is displayed on my Yaxis?  If the recordset populating the chart has numbers from 75,000,000 - 85,000,000, I don't want to start at 0 but say have my range be 65,000,000 - 95,000,000.  But the range can change based upon the data being returned.  It would be nice to have my range be 10% of the minimum value and maximum value.  Something else is that my values returned may also be a percentage. 

     Also on my Xaxis I will be displaying dates.  How do I only show the labels where the month is a quarter end (3, 6, 9, 12)?

     Thanks

  2. Kurt Kluth
    Kurt Kluth avatar
    144 posts
    Member since:
    Oct 2009

    Posted 31 Jul 2015 in reply to Kurt Kluth Link to this post

    I have solved my own problem.  Within SQL returned Min & Max values

    MIN(' + cast(@field as nvarchar(50)) + ') OVER (PARTITION BY acct_Num) AS MinValue,
    Max(' + cast(@field as nvarchar(50)) + ') OVER (PARTITION BY acct_Num) AS MaxValue

    Dim percentage As Double = 0.1D    '10%
    Dim currentValue As Double                   
    RadHtmlChart1.PlotArea.YAxis.LabelsAppearance.DataFormatString = "{0:p2}"
                        RadHtmlChart1.PlotArea.CommonTooltipsAppearance.DataFormatString = "{0:p2}"
                        If Double.TryParse(dr("Minvalue"), Globalization.NumberStyles.Number, Nothing, currentValue) Then
                            If dr("MinValue") < 0 Then
                                percentage = 1.5D
                                currentValue -= dr("Minvalue") * percentage
                            Else
                                'Add 10% of the value to it
                                currentValue -= dr("Minvalue") * percentage
                            End If
                            RadHtmlChart1.PlotArea.YAxis.MinValue = currentValue.ToString
                        End If
     
                        If Double.TryParse(dr("MaxValue"), Globalization.NumberStyles.Number, Nothing, currentValue) Then
                            'Add 10% of the value to it
                            currentValue += dr("MaxValue") * percentage
                            RadHtmlChart1.PlotArea.YAxis.MaxValue = currentValue.ToString
                        End If

    Solved Xaxis problem by setting BaseUnits to "Years"

     

     

     

     

     

  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top