Group: Forum Members
Last Active: 11 Years Ago
Posts: 43,
Visits: 1
|
Thank you very much, I will wait for new SP.
|
Group: Forum Members
Last Active: Last Week
Posts: 3,054,
Visits: 4,009
|
Hi Ereona, We have deliberately modified the control behaviour when zoomed to apply the exact zoom range instead of the inflated range. To workaround this you'll need to dowload the SP we're going to launch by the end of week that allows you to switch the control behaviour in zoomed mode to the pre 2012 behaviour using the following code: chart.Axis(StandardAxis.PrimaryX).UseRangeInflateWhenZoomed = true; Hope this helps - let us know if you meet any problems or have any questions.
Best Regards, Nevron Support Team
|
Group: Forum Members
Last Active: 11 Years Ago
Posts: 43,
Visits: 1
|
Hello. I configure the chart axis so it has autoscale with absolute inflate:
NLinearScaleConfigurator linearConfigurator = new NLinearScaleConfigurator(); linearConfigurator.MajorTickMode = MajorTickMode.AutoMinDistance; linearConfigurator.AutoMinorTicks = true; linearConfigurator.ViewRangeInflateMode = ScaleViewRangeInflateMode.Absolute; linearConfigurator.AbsoluteInflate = new NRange1DL(10, 10); axis.ScaleConfigurator = linearConfigurator;
And I have the tools for data zooming:
_chartControl.Controller.Tools.Add(new NSelectorTool()); _chartControl.Controller.Tools.Add(new NAxisScrollTool()); _chartControl.Controller.Tools.Add(new NDataPanTool()); _chartControl.Controller.Tools.Add(new NDataZoomTool());
I met the problem that when the scrollbars are visible, absolute inflates seems to be zero (data points display close to chart bounds).
I have this problem only with Nevron version 2012. If I run the same code with the 2010 year version everything is correct (inflates persist).
Here is the full code that demonstrates the problem: public partial class Form1 : Form { public Form1() { InitializeComponent();
InitChartControl(); }
private void InitChartControl() { _chartControl = new NChartControl(); this._chartControl.Dock = System.Windows.Forms.DockStyle.Fill; this.Controls.Add(_chartControl);
_cartesianChart = (NCartesianChart)_chartControl.Charts[0];
NRangeSelection rangeSelection = new NRangeSelection(); rangeSelection.VerticalValueSnapper = new NAxisRulerClampSnapper(); rangeSelection.HorizontalValueSnapper = new NAxisRulerClampSnapper(); _cartesianChart.RangeSelections.Add(rangeSelection);
InitAxis(_cartesianChart.Axis(StandardAxis.PrimaryX)); InitAxis(_cartesianChart.Axis(StandardAxis.PrimaryY));
_chartControl.Controller.Tools.Add(new NSelectorTool()); _chartControl.Controller.Tools.Add(new NAxisScrollTool()); _chartControl.Controller.Tools.Add(new NDataPanTool()); _chartControl.Controller.Tools.Add(new NDataZoomTool());
generateData();
_chartControl.Refresh(); }
private void InitAxis(NAxis axis) { axis.ScrollBar.Visible = true; axis.ScrollBar.ShowSliders = true; axis.ScrollBar.ViewRangeChanged += new EventHandler(OnScrollBarViewRangeChanged);
axis.PagingView = new NNumericAxisPagingView(); axis.PagingView.ResetMode = PagingViewResetMode.View;
NLinearScaleConfigurator linearConfigurator = new NLinearScaleConfigurator(); linearConfigurator.MajorTickMode = MajorTickMode.AutoMinDistance; linearConfigurator.AutoMinorTicks = true; linearConfigurator.ViewRangeInflateMode = ScaleViewRangeInflateMode.Absolute; linearConfigurator.AbsoluteInflate = new NRange1DL(10, 10); axis.ScaleConfigurator = linearConfigurator; }
private void OnScrollBarViewRangeChanged(object sender, EventArgs e) { _chartControl.Refresh(); }
private void generateData() { NLineSeries line = (NLineSeries)_cartesianChart.Series.Add(SeriesType.Line); line.Name = "Line Series"; line.DataLabelStyle.Visible = false; line.UseXValues = true; line.FillStyle = new NColorFillStyle(Color.Black);
double measureXValue = 1; double measureValue = 82; int pointsNumber = 20; for (int i = 0; i < pointsNumber; i++) { line.AddDataPoint(new NDataPoint(measureXValue, measureValue)); measureValue -= 4; measureXValue += 3; } }
private NChartControl _chartControl;
private NCartesianChart _cartesianChart; }
|