Group: Forum Members
Last Active: 12 Years Ago
Posts: 1,
Visits: 1
|
Hi,
I am new to nevron charts I am trying to plot a graph with x-axis values starting from 1 to 53 and y-axis values starting from some min value to max value based on the business logic with custom step set to 50, but it always starts with 0. Also the x-axis is not able to accommodate all values from 1 to 53 , it pics randomly from 5, 10,15 and so on.., I have posted the code below. Any help would be highly appreciated.
NchartCtrl.Clear(); this.ColorDef(); string[] menuvalues = Getmenuselectedvalue();
this.CustomDivisionId = int.Parse(menuvalues[0]); this.RegionId = int.Parse(menuvalues[3]); this.AccountId = int.Parse(menuvalues[2]);
DataSet ds = this.LoadDS(this.CustomDivisionId, this.RegionId, this.AccountId);
// set a chart title NLabel title = NchartCtrl.Labels.AddHeader("PAP -Initial View"); title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 14, FontStyle.Italic); title.TextStyle.ShadowStyle.Type = ShadowType.LinearBlur;
NchartCtrl.BackgroundStyle.FrameStyle.Visible = false; NChart chart = NchartCtrl.Charts[0]; chart.BoundsMode = BoundsMode.Stretch; NchartCtrl.Legends.Clear();
NAxis axis = chart.Axis(StandardAxis.PrimaryY); NLinearScaleConfigurator scale = axis.ScaleConfigurator as NLinearScaleConfigurator;
int cnt = 50; axis.View = new NRangeAxisView(new NRange1DD(0, 200), true, true); scale.RoundToTickMax = false; scale.RoundToTickMin = false; scale.MajorTickMode = MajorTickMode.CustomStep; scale.CustomStep = cnt;
NAxis axis1 = chart.Axis(StandardAxis.PrimaryX); NLinearScaleConfigurator scale1 = axis.ScaleConfigurator as NLinearScaleConfigurator;
axis1.View = new NRangeAxisView(new NRange1DD(1, 52), true, true); scale1.RoundToTickMax = false; scale1.RoundToTickMin = false; scale1.MajorTickMode = MajorTickMode.CustomStep; scale1.CustomStep = 1;
chart.Axis(StandardAxis.PrimaryX).ScrollBar.Visible = true; chart.Axis(StandardAxis.PrimaryY).ScrollBar.Visible = true;
|