Dynamically change the Step/Min/Max value

4 posts, 0 answers
  1. chandra
    chandra avatar
    21 posts
    Member since:
    Apr 2008

    Posted 28 May 2008 Link to this post

    Hi,

    I have drawn a chart with some values. I want to change the Step/Min/Max values whenever i clicked/drag the mouse on the chart.

    Is there any way to change the step of the chart when the mouse click/drag on the chart.

  2. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 29 May 2008 Link to this post

    Hello Chandra,

    Here is a sample code that changes the Min/Max/Step values on click:
    1 public Form1() 
    2
    3     InitializeComponent(); 
    4  
    5     this.radChart1.PlotArea.YAxis.AutoScale = false
    6     this.radChart1.PlotArea.YAxis.IsZeroBased = false
    7     this.radChart1.PlotArea.YAxis.AddRange(0, 30, 5); 
    8  
    9     this.radChart1.Click += new RadChart.ChartClickEventHandler(radChart1_Click); 
    10
    11  
    12 private void radChart1_Click(object sender, ChartClickEventArgs args) 
    13
    14     this.radChart1.PlotArea.YAxis.AddRange(20, 30, 2); 
    15     this.radChart1.Refresh(); 
    16

    If you have further questions, just drop us a line.

    All the best,
    Evtim
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
  4. chandra
    chandra avatar
    21 posts
    Member since:
    Apr 2008

    Posted 29 May 2008 Link to this post

    hi Evtim,

        Very very thanks to your quick reply.
       
        The chart it self taking the maximum item value and displaying the chart with maximum value as nearer maximum item value.

    Is there any way to increase the distance between the major ticks?
    or
    Is there any way to increase the number of minor ticks between the majorticks.

    Thanks and Regards,
    chandra
  5. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 30 May 2008 Link to this post

    Hi chandra,

    The distance between the major ticks is controlled by the Step propertyof the YAxis, but again you should use AutoScale = false mode. You can also use the AddRange( Min, Max, Step ) method of the YAxis (see the example in my previous answer).

    To control the minor ticks count, refer to the following line of code:
    this.radChart1.PlotArea.YAxis.Appearance.MinorTick.MinorTickCount = Telerik.Charting.Styles.MinorTickCount.One; 

    If you have further questions, do not hestitate to write us back.

    Regards,
    Evtim
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top