Profile Picture

TransformModelToClient sometimes is incorrect when the xaxis scale is...

Posted By Xiaolong Zhu 11 Years Ago

TransformModelToClient sometimes is incorrect when the xaxis scale is...

Author
Message
Xiaolong Zhu
Posted 11 Years Ago
View Quick Profile
Junior Member

Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)

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;






Similar Topics


Reading This Topic