Rendered smooth line is different with tracker data
This discussion was imported from CodePlex
ryoujr wrote at 2013-06-10 20:44:
Dears,
I tried to draw some smooth line (with log scale axies) in the example code as below, and found that the actual rendered line is slightly different from the tracker data line. so, if I tried to add hit test on the line and add a point on the clicked point, it is not possible to add on the actual line but only on the tracker line. I would really appreciate it if someone can explain the reason for this difference and could share any idea to make this perfectly aligned.
[Example("LineSeries and PlotModel MouseDown event")]
I tried to draw some smooth line (with log scale axies) in the example code as below, and found that the actual rendered line is slightly different from the tracker data line. so, if I tried to add hit test on the line and add a point on the clicked point, it is not possible to add on the actual line but only on the tracker line. I would really appreciate it if someone can explain the reason for this difference and could share any idea to make this perfectly aligned.
[Example("LineSeries and PlotModel MouseDown event")]
public static PlotModel MouseDownEvent()
{
var model = new PlotModel("MouseDown", "Left click to edit or add points.") { LegendSymbolLength = 40 };
var logarithmicAxis1 = new LogarithmicAxis();
logarithmicAxis1.Title = "X";
logarithmicAxis1.Position = AxisPosition.Bottom;
model.Axes.Add(logarithmicAxis1);
// Add a line series
var s1 = new LineSeries("LineSeries1")
{
Color = OxyColors.SkyBlue,
MarkerType = MarkerType.Circle,
MarkerSize = 6,
MarkerStroke = OxyColors.White,
MarkerFill = OxyColors.SkyBlue,
MarkerStrokeThickness = 1.5,
Smooth = true
};
s1.Points.Add(new DataPoint(100, 100));
s1.Points.Add(new DataPoint(400, 200));
s1.Points.Add(new DataPoint(600, -300));
s1.Points.Add(new DataPoint(1000, 400));
s1.Points.Add(new DataPoint(1500, 500));
s1.Points.Add(new DataPoint(2500, 600));
s1.Points.Add(new DataPoint(3000, 700));
model.Series.Add(s1);
//model.RefreshPlot(false);
model.Update(true);
int indexOfPointToMove = -1;
int indexOfPointToInsert = -1;
ryoujr wrote at 2013-06-10 22:31:
It seems to happen when Log Axies are applied.
objo wrote at 2013-06-12 13:46:
Thanks for the code! I think the problem is that hit testing is interpolating then transforming the input points, while the rendering is transforming, then interpolating. I think the hit testing should be changed! Issue
https://oxyplot.codeplex.com/workitem/10055 has been added.
Customer support service by UserEcho