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


TransformModelToClient sometimes is incorrect when the xaxis scale is...
Author
Message
Xiaolong Zhu
Xiaolong Zhu
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
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;


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search