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

Dynamically change the Step/Min/Max value

3 Answers 259 Views
Chart (obsolete as of Q1 2013)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
chandra
Top achievements
Rank 1
chandra asked on 28 May 2008, 05:58 AM
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.

3 Answers, 1 is accepted

Sort by
0
Dwight
Telerik team
answered on 29 May 2008, 06:29 AM
Hello Chandra,

Here is a sample code that changes the Min/Max/Step values on click:
public Form1() 
    InitializeComponent(); 
 
    this.radChart1.PlotArea.YAxis.AutoScale = false
    this.radChart1.PlotArea.YAxis.IsZeroBased = false
    this.radChart1.PlotArea.YAxis.AddRange(0, 30, 5); 
 
    this.radChart1.Click += new RadChart.ChartClickEventHandler(radChart1_Click); 
 
private void radChart1_Click(object sender, ChartClickEventArgs args) 
    this.radChart1.PlotArea.YAxis.AddRange(20, 30, 2); 
    this.radChart1.Refresh(); 

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
0
chandra
Top achievements
Rank 1
answered on 29 May 2008, 12:25 PM
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
0
Dwight
Telerik team
answered on 30 May 2008, 12:45 PM
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
Tags
Chart (obsolete as of Q1 2013)
Asked by
chandra
Top achievements
Rank 1
Answers by
Dwight
Telerik team
chandra
Top achievements
Rank 1
Share this question
or