Profile Picture

Coordinate transformations in WPF app

Posted By Vladimir Zverev 5 Years Ago
Author
Message
Vladimir Zverev
Question Posted 5 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: Forum Members
Last Active: 4 Years Ago
Posts: 3, Visits: 16
Hello!
I use Nevron Chart for WPF. How I can transform mouse coordinates to chart axis coordinates?
This code is incorrect, because WPF ChartControl does not contain View method


private void _chartControl_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
      System.Windows.Point point = e.GetPosition(_chartControl);
      NCartesianChart chart = (NCartesianChart)(_chartControl.Charts[0]);
      NViewToScale2DTransformation transf = new NViewToScale2DTransformation(_chartControl.View.Context, chart, (int)StandardAxis.PrimaryX, (int)StandardAxis.PrimaryY);
      NVector2DD pointScale = default(NVector2DD);
      transf.Transform(new NPointF((float)point.X, (float)point.Y), ref pointScale);
 }

Thanks

Nevron Support
Posted 5 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,000
Hi Vladimir,

We just tested with a recent version (19.7.15.12) and the WPF control did have a View method - what is the version you're currently testing with?

Best Regards,
Nevron Support Team



Nevron Support
Posted 5 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,000
Hi Vladimir,
Also this code applies to Nevron Chart for .NET, not NOV Chart - do you want to perform coordinate transformation in the NOV Chart or the .NET Chart?

Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic