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

NumericalScale.MajorStep question - How to set MajorGridLines at every 5 mm?

4 Answers 68 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mandar
Top achievements
Rank 1
Mandar asked on 16 Apr 2014, 07:41 PM
Hi All,

Does anyone know how NumericalScale.MajorStep works in Graph? I have a Graph with X and Y axis and each axis has a numerical scale with only MajorStep. The width and height of Graph are set to 250mm and 120mm respectively and my requirement is that each axis should always have MajorGridLines at every 5mm. Is there a way I can use MajorStep property for this purpose or is there any other way I can satisfy this requirement?

Thanks,
Mandar

4 Answers, 1 is accepted

Sort by
0
KS
Top achievements
Rank 1
answered on 18 Apr 2014, 06:03 PM
Hi,

The step of the Major Gridlines is determined by the range of the scale and the data. Gridlines on each 5mm means there is a step that wide. 

-KS
0
Mandar
Top achievements
Rank 1
answered on 18 Apr 2014, 06:24 PM
Yeah I understand that and I tried to set MajorStep on the scale to 5 but that didn't work. Following is the snippet of code I had to end up using. You can see that in the code I do numericalScale1.MajorStep = 15D and only then the MajorGridLines in the report are actually 5mm apart. So my question is why can't I just set numericalScale1.MajorStep = 5D in this case? The total width of my Graph(Report) is set to 250mm?
 

this.cartesianCoordinateSystem1.XAxis = this.graphAxis2;
            this.cartesianCoordinateSystem1.YAxis = this.graphAxis1;
            // 
            // graphAxis2
            // 
            this.graphAxis2.MajorGridLineStyle.LineColor = System.Drawing.Color.LightGray;
            this.graphAxis2.MajorGridLineStyle.LineStyle = Telerik.Reporting.Drawing.LineStyle.Dotted;
            this.graphAxis2.MajorGridLineStyle.LineWidth = Telerik.Reporting.Drawing.Unit.Pixel(0.5D);
            this.graphAxis2.MajorGridLineStyle.Visible = true;
            this.graphAxis2.MajorTickMarkDisplayType = Telerik.Reporting.GraphAxisTickMarkDisplayType.None;
            this.graphAxis2.MinorGridLineStyle.LineColor = System.Drawing.Color.LightGray;
            this.graphAxis2.MinorGridLineStyle.LineStyle = Telerik.Reporting.Drawing.LineStyle.Dotted;
            this.graphAxis2.MinorGridLineStyle.LineWidth = Telerik.Reporting.Drawing.Unit.Pixel(0.5D);
            this.graphAxis2.MinorGridLineStyle.Visible = false;
            this.graphAxis2.Name = "graphAxis2";
            numericalScale1.MajorStep = 15D;




0
Mandar
Top achievements
Rank 1
answered on 18 Apr 2014, 06:26 PM
Here's the snippet of code that shows how I am setting MajorStep

          this.cartesianCoordinateSystem1.XAxis = this.graphAxis2;
            this.cartesianCoordinateSystem1.YAxis = this.graphAxis1;
            // 
            // graphAxis2
            // 
            this.graphAxis2.MajorGridLineStyle.LineColor = System.Drawing.Color.LightGray;
            this.graphAxis2.MajorGridLineStyle.LineStyle = Telerik.Reporting.Drawing.LineStyle.Dotted;
            this.graphAxis2.MajorGridLineStyle.LineWidth = Telerik.Reporting.Drawing.Unit.Pixel(0.5D);
            this.graphAxis2.MajorGridLineStyle.Visible = true;
            this.graphAxis2.MajorTickMarkDisplayType = Telerik.Reporting.GraphAxisTickMarkDisplayType.None;
            this.graphAxis2.MinorGridLineStyle.LineColor = System.Drawing.Color.LightGray;
            this.graphAxis2.MinorGridLineStyle.LineStyle = Telerik.Reporting.Drawing.LineStyle.Dotted;
            this.graphAxis2.MinorGridLineStyle.LineWidth = Telerik.Reporting.Drawing.Unit.Pixel(0.5D);
            this.graphAxis2.MinorGridLineStyle.Visible = false;
            this.graphAxis2.Name = "graphAxis2";
            numericalScale1.MajorStep = 15D;           
            this.graphAxis2.Scale = numericalScale1;
            this.graphAxis2.Style.Color = System.Drawing.Color.Black;
            this.graphAxis2.Style.Visible = false;
            this.graphAxis2.TitlePlacement = Telerik.Reporting.GraphAxisTitlePlacement.None;
            // 
            // graphAxis1
            // 
            this.graphAxis1.MajorGridLineStyle.LineColor = System.Drawing.Color.LightGray;
            this.graphAxis1.MajorGridLineStyle.LineStyle = Telerik.Reporting.Drawing.LineStyle.Dotted;
            this.graphAxis1.MajorGridLineStyle.LineWidth = Telerik.Reporting.Drawing.Unit.Pixel(0.5D);
            this.graphAxis1.MajorGridLineStyle.Visible = true;
            this.graphAxis1.MajorTickMarkDisplayType = Telerik.Reporting.GraphAxisTickMarkDisplayType.None;
            this.graphAxis1.MinorGridLineStyle.LineColor = System.Drawing.Color.LightGray;
            this.graphAxis1.MinorGridLineStyle.LineStyle = Telerik.Reporting.Drawing.LineStyle.Dotted;
            this.graphAxis1.MinorGridLineStyle.LineWidth = Telerik.Reporting.Drawing.Unit.Pixel(0.5D);
            this.graphAxis1.MinorGridLineStyle.Visible = false;
            this.graphAxis1.Name = "graphAxis1";
            numericalScale2.MajorStep = 19D;           
            this.graphAxis1.Scale = numericalScale2;
            this.graphAxis1.Style.Visible = false;
            this.graphAxis1.TitlePlacement = Telerik.Reporting.GraphAxisTitlePlacement.None;
0
Hinata
Top achievements
Rank 1
answered on 23 Apr 2014, 03:58 PM
Hi Mandar,

I think it is not possible to set the MajorStep to 5 mm, since it is dependent on your data. The MajorStep actually defines the step/interval for the major ticks/grid lines. It is not a static width of the space between two ticks/gridlines, since the ticks are based on the data coming from the data source.
Tags
General Discussions
Asked by
Mandar
Top achievements
Rank 1
Answers by
KS
Top achievements
Rank 1
Mandar
Top achievements
Rank 1
Hinata
Top achievements
Rank 1
Share this question
or