Jump to content

 

Photo

Slow performance with too many data points - Latest Visifire v4.5.x is 2x faster now


  • Please log in to reply
33 replies to this topic

#1 Mike Lu

Mike Lu

    Member

  • Members
  • PipPip
  • 15 posts

Posted 30 November 2011 - 10:27 PM

Hi,

I works on the Visifire Chart under Silverlight. In my work, I need to chart 3 data series and each series contains about 1 year X 24 hours data (8760 data points). I generated a data.xml to contains those data in file. However, it is very slow to load the chart.
1. How can I improve the loading speed?
2. I don't want to display the entire data in chart plot area (8760 data points in chart window) instead that I only want to display 168 data points in current chart area. How can I do it in my chart settings?

Regards,
Mike Lu

#2 vivek

vivek

    Advanced Member

  • Team Visifire
  • PipPipPip
  • 3,586 posts
  • Gender:Male
  • Location:Bangalore

Posted 01 December 2011 - 03:59 AM

Mike,

Which version of Visifire are you using? Can you please try using Visifire 4.5.0-2 and see.

Regards,
Vivek
Team Visifire


#3 Mike Lu

Mike Lu

    Member

  • Members
  • PipPip
  • 15 posts

Posted 01 December 2011 - 04:47 PM

Mike,

Which version of Visifire are you using? Can you please try using Visifire 4.5.0-2 and see.

I just bought the license and it is version v4.1.4.0. I test the beta version 4.5.0-2 and it is much better. By the way, how can I set the initial chart to display only 144 points with horizon scroll bar instead of displaying all 8760 points in plot area.

#4 Mike Lu

Mike Lu

    Member

  • Members
  • PipPip
  • 15 posts

Posted 01 December 2011 - 08:21 PM

I hust found the Zoom() function can resolve my problem. However, I can only zoom up to about 200 data points even though I set the Zoom(0, 143). How can I zoom into one day (24 data points) or even more less? Is it a bug in that beta version?

#5 vivek

vivek

    Advanced Member

  • Team Visifire
  • PipPipPip
  • 3,586 posts
  • Gender:Male
  • Location:Bangalore

Posted 02 December 2011 - 04:09 AM

Mike,

Zoom() method is working fine here. Can you please provide the test case for the issue you are facing?

Regards,
Vivek
Team Visifire


#6 Mike Lu

Mike Lu

    Member

  • Members
  • PipPip
  • 15 posts

Posted 02 December 2011 - 07:52 PM

Attached is the screenshot & my test example. In the SilverlightApp001.html, I set the Zoom(0,23) but it still shows around 200 data points. I tried the mouse to select one day to zoom in but it still did not change.

Attached Files



#7 vivek

vivek

    Advanced Member

  • Team Visifire
  • PipPipPip
  • 3,586 posts
  • Gender:Male
  • Location:Bangalore

Posted 05 December 2011 - 04:33 AM

Mike,

If you want to zoom at initial render, you have to do it inside Rendered event of chart.

Example:

vChart.loaded = function(args)
{
    chart = args[0];

    // Attach an event handler with the chart for Rendered event.
    chart.Rendered = function(sender, eventArgs)
    {
        setTimeout("Zoom()", 150); 
    };
};

Regards,
Vivek
Team Visifire


#8 Mike Lu

Mike Lu

    Member

  • Members
  • PipPip
  • 15 posts

Posted 05 December 2011 - 10:52 PM

I do not have any problem to set the initial render in zooming. However, I had problem to zoom in for only one or two days' data (initial zooming displays 8 days). I used mouse to select one or two days but it did not zoom in. Is there anything wrong in my coding?

#9 vivek

vivek

    Advanced Member

  • Team Visifire
  • PipPipPip
  • 3,586 posts
  • Gender:Male
  • Location:Bangalore

Posted 06 December 2011 - 03:52 AM

How are you zooming the chart using mouse?

Regards,
Vivek
Team Visifire


#10 Mike Lu

Mike Lu

    Member

  • Members
  • PipPip
  • 15 posts

Posted 06 December 2011 - 12:17 PM

I used left-button of mouse to highlight the portion I want to zoom in. It worked while I started to zoom in with all the data in plot area but did not work while only 200 data points in plot area.

#11 vivek

vivek

    Advanced Member

  • Team Visifire
  • PipPipPip
  • 3,586 posts
  • Gender:Male
  • Location:Bangalore

Posted 06 December 2011 - 01:35 PM

For better understanding of your requirement, it would be helpful if you can share the sample application for the same.

Regards,
Vivek
Team Visifire


#12 Mike Lu

Mike Lu

    Member

  • Members
  • PipPip
  • 15 posts

Posted 06 December 2011 - 03:33 PM

The sample application & data was attached in #6 post. Here I attached the screenshots for your reference and marked with 01 to 05. You can see that I tried to zoom in for only two days in 04 screenshot but the result still showed 8 days (05 screenshot).

Attached Files



#13 shoaib

shoaib

    Advanced Member

  • Members
  • PipPipPip
  • 924 posts
  • Gender:Male
  • Location:Bangalore

Posted 07 December 2011 - 05:38 AM

Hi Mike,

We are not able to reproduce the issue with the above code that you have provided. Can you please provide us the exact test case to reproduce the issue?

Regards,
Shoaib

#14 Mike Lu

Mike Lu

    Member

  • Members
  • PipPip
  • 15 posts

Posted 07 December 2011 - 05:43 PM

I just open the WWW service from the firewall and you can test the link below,

http://69.199.86.170...ightApp001.html

The version of Visifire Chart I tested is visifire_v4.5.0-2_trial. I tested in version visifire_v4.1.4-0_ent and got the same problem.

#15 vivek

vivek

    Advanced Member

  • Team Visifire
  • PipPipPip
  • 3,586 posts
  • Gender:Male
  • Location:Bangalore

Posted 08 December 2011 - 04:17 AM

Mike,

I have found the problem you are facing. Actually this is happening due to the max PlotArea size set inside the chart. Whenever you zoom the chart, PlotArea size increases and render the DataPoints with the new size. In Silverlight, a Panel or any other UIElement doesn't behave properly when it's width or height increases to a particular limit. You can reproduce this by using a Canvas and putting a Line inside it. Then try to set the canvas Width above 32000, you will see the weird behavior. Due to this reason only, we have fixed a max PlotArea size in chart. So the PlotArea size will not increase beyond this limit while zooming.

Regards,
Vivek
Team Visifire


#16 Mike Lu

Mike Lu

    Member

  • Members
  • PipPip
  • 15 posts

Posted 08 December 2011 - 10:58 PM

vivek,

Is there any way to fix such issue?

#17 vivek

vivek

    Advanced Member

  • Team Visifire
  • PipPipPip
  • 3,586 posts
  • Gender:Male
  • Location:Bangalore

Posted 09 December 2011 - 07:02 AM

Mike,

In this case, I would suggest you a workaround. You can attach MouseLeftButtonDown and MouseLeftButtonUp events on PlotArea. Inside the event handler, you will get XValue and YValue as events arguments. So while zooming you can find out the min XValue (on mouse down) and max XValue (on mouse up) of the mouse position using which you can further find out the DataPoints lying under that XValue range. Once MouseLeftButtonUp event on PlotArea fires, you can render the chart with those new set of DataPoints.

In order to know how to attach mouse events on PlotArea and get the XValue as event argument, please check documentation sample here.

Regards,
Vivek
Team Visifire


#18 JTyler

JTyler

    Member

  • Members
  • PipPip
  • 10 posts
  • Gender:Male

Posted 27 January 2012 - 05:53 PM

I'm having a similar issue with the WPF library. Does WPF have the same limitations mentioned above? Also, what's really screwing me up is the axis zoom event still reports the zoom, so I setup label intervals based on those values. But then the chart doesn't actually do the zoom, so my application basically hangs because it's trying to render a ton of labels. Is there a safer place to determine labeling intervals?

#19 vivek

vivek

    Advanced Member

  • Team Visifire
  • PipPipPip
  • 3,586 posts
  • Gender:Male
  • Location:Bangalore

Posted 30 January 2012 - 04:59 AM

JTyler,

You can check the Axis's ScrollableLength property inside OnZoom event.


void Axis_OnZoom(object sender, AxisZoomEventArgs e)
        {
            if ((sender as Axis).ScrollableLength != oldScrollableLength)
            {
                // Axis Labeling code goes here

                oldScrollableLength = (sender as Axis).ScrollableLength;
            }
        }

        Double oldScrollableLength = 0;

If ScrollableLength is not equal to oldScrollableLength, then only execute Axis labeling code.

Regards,
Vivek
Team Visifire


#20 JTyler

JTyler

    Member

  • Members
  • PipPip
  • 10 posts
  • Gender:Male

Posted 30 January 2012 - 04:46 PM

JTyler,

You can check the Axis's ScrollableLength property inside OnZoom event.


void Axis_OnZoom(object sender, AxisZoomEventArgs e)
        {
            if ((sender as Axis).ScrollableLength != oldScrollableLength)
            {
                // Axis Labeling code goes here

                oldScrollableLength = (sender as Axis).ScrollableLength;
            }
        }

        Double oldScrollableLength = 0;

If ScrollableLength is not equal to oldScrollableLength, then only execute Axis labeling code.


Thank you for that, I'll try it out.

As for issue at hand, I have a scenario where I may be showing years of data, but at a resolution of minutes. So, the user should be able to zoom as close as looking at 5 minutes of data even though they may be plotting 5 years of data. Is this not possible with Visifire's WPF chart?

Thanks.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users