Which event for Zooming


Author
Message
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K

Hi Frank,

Yes - you should use FromOADate:

DateTime dt = DateTime.FromOADate(someDoubleValue);



Best Regards,
Nevron Support Team


Frank Thiesing
Frank Thiesing
Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)
Group: Forum Members
Posts: 5, Visits: 1
Hello,

thanks for your help, it works.
Now i get the begin and the end of my range selection. I configure my xaxis in a datetime format.
Is there a way to convert the double value i get from selection to a DateTime-Value?

best regards
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K

Hi Frank,

You can intercept the data zoom end drag event and get the axis ruler range from there - for example:

  private void Form1_Load(object sender, EventArgs e)
  {
   NCartesianChart chart = (NCartesianChart)nChartControl1.Charts[0];

   NBarSeries bar = new NBarSeries();

   bar.Values.Add(10);
   bar.Values.Add(20);
   bar.Values.Add(30);

   chart.Series.Add(bar);

   chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = new NLinearScaleConfigurator();

   NRangeSelection rs = new NRangeSelection();
   chart.RangeSelections.Add(rs);

   nChartControl1.Controller.Tools.Add(new NSelectorTool());
   NDataZoomTool dzt = new NDataZoomTool();
   dzt.EndDrag += new EventHandler(dzt_EndDrag);
   nChartControl1.Controller.Tools.Add(dzt);
  }

  void dzt_EndDrag(object sender, EventArgs e)
  {
   NCartesianChart chart = (NCartesianChart)nChartControl1.Charts[0];

   nChartControl1.Document.Calculate();
   nChartControl1.Document.RecalcLayout(nChartControl1.View.Context);

   NRange1DD xAxisRange = chart.Axis(StandardAxis.PrimaryX).Scale.RulerRange;
   textBox1.Text = "X: " + xAxisRange.Begin.ToString() + " Y: " + xAxisRange.End.ToString();
  }

Hope this helps - let us know if you meet any problems.



Best Regards,
Nevron Support Team


Frank Thiesing
Frank Thiesing
Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)
Group: Forum Members
Posts: 5, Visits: 1
Hello,

i use a Nevron-Chart, their i use zoom. Now i need the range from my X-Axis after zoom. I tried it with HorizontalAxisRangeChanged-Event. But this event is fired the hole time i am select the part in my chart.


void rangeSelection_HorizontalAxisRangeChanged(object sender, EventArgs e)
{
NRangeSelection nrs = (NRangeSelection)sender;
Console.WriteLine(nrs.HorizontalAxisRange.Begin + " " + nrs.HorizontalAxisRange.End);
Console.WriteLine(cartesianChart.Axis(StandardAxis.PrimaryX).PageRange.Begin + " | " + cartesianChart.Axis(StandardAxis.PrimaryX).PageRange.End);
}
After zoom i will call a method, but it would be hard to call this method more than once.
Can you help please.

best regards
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