Group: Forum Members
Last Active: 11 Years Ago
Posts: 18,
Visits: 1
|
Hi experts When i tries to use the following code to do the transformation from model to client, i found the x value is always wrong. could anybody give any hints? Thanks a lot. public NVector3DF TransformScaleToClient(float scaleX, float scaleY, bool clampToRuler){ var xAxis = _chart.Axes[(int)StandardAxis.PrimaryX] as NAxis;float modelX = xAxis.TransformScaleToModel(clampToRuler, scaleX);var yAxis = _chart.Axes[(int)StandardAxis.PrimaryY] as NAxis;float modelY = yAxis.TransformScaleToModel(clampToRuler, scaleY);var clientVector = new NVector3DF();_chart.TransformModelToClient(_chartCtrl.View.Context, new NVector3DF(modelX, modelY, 0), ref clientVector);return clientVector;} This is the code to configure x axis : NAxis axisX = _chart.Axes[(int)StandardAxis.PrimaryX] as NAxis;var dateTimeScale = new NValueTimelineScaleConfigurator();dateTimeScale.MaxTickCount = 15; dateTimeScale.Name = "Time";dateTimeScale.Title.Text = "Time";dateTimeScale.ViewRangeInflateMode = ScaleViewRangeInflateMode.Absolute;dateTimeScale.AbsoluteInflate = new NRange1DL(10, 10);AttachMajorGridToAxis(dateTimeScale); axisX.ScaleConfigurator = dateTimeScale;
|