Profile Picture

Zooming problem

Posted By Kevin Harrison 14 Years Ago
Author
Message
Kevin Harrison
Posted 14 Years Ago
View Quick Profile
Forum Guru

Forum Guru (52 reputation)Forum Guru (52 reputation)Forum Guru (52 reputation)Forum Guru (52 reputation)Forum Guru (52 reputation)Forum Guru (52 reputation)Forum Guru (52 reputation)Forum Guru (52 reputation)Forum Guru (52 reputation)

Group: Forum Members
Last Active: 12 Years Ago
Posts: 52, Visits: 1
We are having a problem with zooming when we have simple line charts with a few thousand points (otr multiple lines with less points).  We can zoom in three of four times with no noticeable lag.  However, we then reach a point where any subsequent zoom (in or out) takes a very long time, and, in some cases, the chart control just becomes completely unresponsive and we have to crash out of it.  Trying to zoom out (which is set to a complete reset of the chart) is the most common way we can get the control to hang. Is this a known issue?

Nevron Support
Posted 14 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,009

Hi Kevin,

Is there any code that is performed in the chart in response to say mouse down / move events? We just tested with the following code:

   NCartesianChart chart = (NCartesianChart)nChartControl1.Charts[0];
   chart.RangeSelections.Add(new NRangeSelection());

   Random rand = new Random();

   NLineSeries line = new NLineSeries();
   line.DataLabelStyle.Visible = false;
   line.UseXValues = true;
   line.SamplingMode = SeriesSamplingMode.Enabled;

   for (int i = 0; i < 1000; i++)
   {
    line.Values.Add(rand.Next(100));
    line.XValues.Add(rand.Next(100));
   }

   chart.Series.Add(line);
   chart.Axis(StandardAxis.PrimaryX).ScrollBar.Visible = true;
   chart.Axis(StandardAxis.PrimaryY).ScrollBar.Visible = true;

   nChartControl1.Controller.Tools.Add(new NSelectorTool());
   nChartControl1.Controller.Tools.Add(new NAxisScrollTool());
   nChartControl1.Controller.Tools.Add(new NDataZoomTool());

and the control was working properly - can you post the relevant code you tested with?



Best Regards,
Nevron Support Team



Fredrik Östlund
Posted 14 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: Forum Members
Last Active: 13 Years Ago
Posts: 4, Visits: 1
Hi,

I have just downloaded the newest evaluation version of Nevron and I'm running the evaluation version of visual studio 2010 on windows Vista.

The sample code you provided produces the error Kevin reported, i.e. I can zoom in a couple (usually one time), then any zooming action produces a long (tens of seconds to minutes) long full cpu usage pause.

The error is linked to the line:

line.SamplingMode = SeriesSamplingMode.Enabled;

Setting this to Disabled, removes the problem.

For me however, that is not an option, I do need the downsampling. Any chance of getting this fixed before I decide on which charting lib I go with?

best regards

Fredrik Östlund

Kevin Harrison
Posted 14 Years Ago
View Quick Profile
Forum Guru

Forum Guru (52 reputation)Forum Guru (52 reputation)Forum Guru (52 reputation)Forum Guru (52 reputation)Forum Guru (52 reputation)Forum Guru (52 reputation)Forum Guru (52 reputation)Forum Guru (52 reputation)Forum Guru (52 reputation)

Group: Forum Members
Last Active: 12 Years Ago
Posts: 52, Visits: 1

Fredrik

Well spotted!  I also would like the sampling, but if I take it off as you suggest on a plot with 100,000 points, zooming and scrolling work fine.  The first zoom is not surprisingly a little slow, but there's no hanging.

I am using Windows 7 64-bit if this is of any relevance.

Kevin

PS In answer to the initial Nevron reply, yes I do have mouse down events, but it seems SamplingMode is the culprit.



Nevron Support
Posted 14 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,009

Hi Kevin, Hi Frederick,

Thank you for reporting this problem - we've investigated the issue and its internally caused by the sampling factor, which is not adjusted when zooming occurs (the test code above this post cannot replicate the problem as it only contains one thousand data points, however testing with one million data points showed that there is indeed a problem). This leads the sampler to "think" that it's sampling for a much bigger picture, which in turn slows down the rendering due to the increased number of rendered line segments. We've started implementing this adjustment and the fix will probably be avaialble next week (or shortly after New Year - greetings everyone ).

On a different note currently we're reorganizing the painting code of the component to clip data that falls outside the zoomed / programatically set range and this will appear in the upcoming major release.



Best Regards,
Nevron Support Team



Fredrik Östlund
Posted 14 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: Forum Members
Last Active: 13 Years Ago
Posts: 4, Visits: 1
Thank you for the rapid answer. When do you expect this release?

best regards

Fredrik Östlund

edit: I didn't read your last post carefully. Please disregard this question.

Nevron Support
Posted 14 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,009

Hi Fredrik,

Just a short note that the zoom in optimization has been implemented - we'll launch a SP fixing this in behaviour next week...



Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic