Hi ,
When I plot my graph I have on the Yaxis numbers corresponding to the point's value( like -4.5 , -2.4, -1.2 .........). What I want is to have usual number with a step of 0.5 for example (-5 to 2).
How I can do that ?
Line : YAxis.TickmarkStyle = AxisTickStyle.DataInterval; did the work , thanks a lot for your help !
Hi,
I used our previous sample to illustrate our scenario with my customer settings. The code that I used is:
AxisItem axis1 = new AxisItem(); axis1.Extent = 20; axis1.DataType = AxisDataType.Numeric; axis1.Labels.ItemFormatString = "<DATA_VALUE:##.##>"; axis1.OrientationType = AxisNumber.Y_Axis; axis1.RangeType = AxisRangeType.Custom; axis1.RangeMin = -10; axis1.RangeMax = 100; axis1.TickmarkInterval = 20; axis1.TickmarkStyle = AxisTickStyle.DataInterval; area.Axes.Add(axis1);
AxisItem axis1 = new AxisItem();
axis1.Extent = 20;
axis1.DataType = AxisDataType.Numeric;
axis1.Labels.ItemFormatString = "<DATA_VALUE:##.##>";
axis1.OrientationType = AxisNumber.Y_Axis;
axis1.RangeType = AxisRangeType.Custom;
axis1.RangeMin = -10;
axis1.RangeMax = 100;
axis1.TickmarkInterval = 20;
axis1.TickmarkStyle = AxisTickStyle.DataInterval;
area.Axes.Add(axis1);
Please take a look at the attached sample and screenshot for more details and let me know if you have any questions.
Regards
I tried this :
//the layers can share the numeric y axis. AxisItem YAxis = new AxisItem(ChartAlphaRealized, AxisNumber.Y_Axis); //area.Axes.Clear(); YAxis.DataType = AxisDataType.Numeric; YAxis.OrientationType = AxisNumber.Y_Axis; YAxis.MajorGridLines.Visible = false; YAxis.RangeType = AxisRangeType.Custom; YAxis.RangeMax = 2; //if (MinAlphaCumulValue > 0) MinAlphaCumulValue = 0; YAxis.RangeMin = -10; YAxis.Labels.ItemFormatString = "<DATA_VALUE:##.##>"; area.Axes.Add(YAxis); //the layers can share the numeric y axis. AxisItem YAxis2 = new AxisItem(ChartAlphaRealized, AxisNumber.Y2_Axis); //area.Axes.Clear(); YAxis2.DataType = AxisDataType.Numeric; YAxis2.Labels.ItemFormat = AxisItemLabelFormat.DataValue; YAxis2.MajorGridLines.Visible = false; YAxis2.RangeType = AxisRangeType.Custom; YAxis2.RangeMax = 30; YAxis2.RangeMin = 0; YAxis2.LineColor = Color.LightGreen; YAxis2.Labels.ItemFormatString = "<DATA_VALUE:##.##>"; YAxis2.TickmarkInterval = 10; area.Axes.Add(YAxis2);
here is the result ( the tickmarinterval is not working for Y2 and it does not work for Y)
Maybe one possible approach could be if your are using Range properties. For example:
AxisItem axisY = new AxisItem(); axisY.DataType = AxisDataType.Numeric; axisY.OrientationType = AxisNumber.Y_Axis; axisY.Extent = 20; axisY.RangeType = AxisRangeType.Custom; axisY.RangeMin = -5; axisY.RangeMax = 2; axisY.Labels.ItemFormatString = "<DATA_VALUE:##.##>"; axisY.LineColor = Color.Blue; area.Axes.Add(axisY);
AxisItem axisY = new AxisItem();
axisY.DataType = AxisDataType.Numeric;
axisY.OrientationType = AxisNumber.Y_Axis;
axisY.Extent = 20;
axisY.RangeType = AxisRangeType.Custom;
axisY.RangeMin = -5;
axisY.RangeMax = 2;
axisY.Labels.ItemFormatString = "<DATA_VALUE:##.##>";
axisY.LineColor = Color.Blue;
area.Axes.Add(axisY);
Let me know if you have any questions.