Jump to content

 

Photo

Performance of Visifire Chart


  • Please log in to reply
13 replies to this topic

#1 Xelom

Xelom

    Advanced Member

  • Members
  • PipPipPip
  • 39 posts

Posted 23 February 2012 - 08:47 AM

Hi,

I have 10 to 20 dataseries in my chart. I'm fetching all the data from a live database and updating my chart every 3 minutes. At the end of the day or with a full day request chart has lets say: 20 dataseries each have 480 datapoint 480 x 20 = 9600 and sometimes more datapoints. When I load this much of data to the chart my whole program's performance goes down and including excluding dimensions, adding new refractions take like 15-20 seconds and freezes the program. I tried it with 4.5.1-0 stable trial yesterday too and I didn't see a major change.

Any suggestions for improving performance?

Edit: I wrote 4.5.2-0 stable instead 4.5.1-0

#2 Eva

Eva

    Advanced Member

  • Members
  • PipPipPip
  • 365 posts
  • Gender:Female

Posted 23 February 2012 - 01:56 PM

Any suggestions for improving performance?

Hi,

I have few queries regarding this matter.

1) Which chart type you are working with?
2) Whether you are working with WPF or Silverlight?
Regards,
Eva

#3 Xelom

Xelom

    Advanced Member

  • Members
  • PipPipPip
  • 39 posts

Posted 23 February 2012 - 02:01 PM

Hi Eva,

Thanks for your response. I'm working with Silverlight and using line chart generally.

#4 Eva

Eva

    Advanced Member

  • Members
  • PipPipPip
  • 365 posts
  • Gender:Female

Posted 23 February 2012 - 02:25 PM

Hi Xelom,

Have you tried QuickLine chart?
Regards,
Eva

#5 Xelom

Xelom

    Advanced Member

  • Members
  • PipPipPip
  • 39 posts

Posted 23 February 2012 - 03:00 PM

Sorry, I gave missing information I was in a hurry. So I've used MultiChart example found in here MultiChart and modified it with Vivek in this post MultiChart Binding. I don't know if QuickLine chart can provide me this kind of feature.

Edit: Link name

#6 Xelom

Xelom

    Advanced Member

  • Members
  • PipPipPip
  • 39 posts

Posted 23 February 2012 - 03:46 PM

Okay I tried QuickLine chart. It seems faster but I need the datapoint details and tooltips. It is really important for my monitoring. Another thing is rendering chart gets slower and slower with consequent changes.

#7 mac

mac

    Advanced Member

  • Members
  • PipPipPip
  • 171 posts
  • Gender:Male

Posted 24 February 2012 - 06:27 AM

Hello Xelom,

I need the datapoint details and ToolTips.

Well then the Line Chart would fit well for your requirement. I'm creating a sample demo app for you. I will tell you the tips to improve your application performance.

#8 mac

mac

    Advanced Member

  • Members
  • PipPipPip
  • 171 posts
  • Gender:Male

Posted 24 February 2012 - 06:44 AM

Also, can you please tell me whether you are working with DateTime axis (binding XValue property as DateTime) or using normal numeric axis (binding AxisXLabel in DataSeries)?

According to your requirement is it fixed that you need to work with 20 line graphs only for now?

Edited by mac, 24 February 2012 - 07:00 AM.


#9 Xelom

Xelom

    Advanced Member

  • Members
  • PipPipPip
  • 39 posts

Posted 24 February 2012 - 06:58 AM

Hi Mac,

The information you have requested can be found here : MultiChart Binding Post

I am not using DateTime axis my AxisXLabel values are also strings. I have a render as converter in a combobox which user can select graph type like column, stacked column etc. But line chart is the important one, the other charts performance are not crucial.

Edit: I saw you changed your post after my post.

#10 mac

mac

    Advanced Member

  • Members
  • PipPipPip
  • 171 posts
  • Gender:Male

Posted 24 February 2012 - 03:12 PM

Xelom,

Well you might have noticed that we made few major changes in v4.5.x for better performance. Well previously DataPoints collection of a DataSeries was not a DependencyProperty. Now DataPoints collection in DataSeries is a DependencyProperty of type DataPointCollection.

Few important tips

#1: Performance will improve if you update a DataSeries as below.

/*  Create new set of DataPoints */
DataPointCollection collection = new DataPointCollection();

for (int index = 0; index < MAX_NUMBER_OF_SERIES; index++)
   collection.Add(new DataPoint() { YValue = value, AxisXLabel = "AxisXLabel”});

/* Directly set the new collection as DataPoints */
Chart.Series[0].DataPoints = collection;

#2: When working with huge number of DataPoints, performance will decrease if you perform the following operation directly in DataPoints list of a DataSeries. So always follow Tip #1.

Chart.Series[0].DataPoints.Add( new DataPoint() { YValue =value, AxisXLabel = "AxisXLabel”});
// Or 
Chart.Series[0].DataPoints.Remove(dataPoint); 
// Or
Chart.Series[0].DataPoints.Clear();

#3: Also note that setting LightWeight="true" in DataSeries will improve the performance drastically.

#4: Disable shadow by setting ShadowEnabled in PlotArea, Chart, Legend and DataSeries/DataPoints etc.

You are updating the chart data in every 3 minutes. I think Chart is taking time to render as you are trying to update all the DataSeries at once. I suggest you to update each DataSeries one by one with interval of 1 to 2 seconds under a DispatcherTimer.

Please checkout the attached example application along with this post. Here I’m working with 20 DataSeries having 480 DataPoints in each. On click of a button I’m refreshing the data present in ViewModel to update the chart.

Also please download the latest version of Visifire from the link below and try this application.
http://www.visifire.com/download_silverlight_wpf_controls.php


Regards,
Mac

Attached Files



#11 Xelom

Xelom

    Advanced Member

  • Members
  • PipPipPip
  • 39 posts

Posted 24 February 2012 - 03:19 PM

Thanks for your tips and example Mac. I will apply them to my project and give feedback to you as soon as possible :)

#12 Xelom

Xelom

    Advanced Member

  • Members
  • PipPipPip
  • 39 posts

Posted 27 February 2012 - 11:37 AM

Hi mac,

I have a quick question. In your example app you are defining 20 dataseries in xaml code. My series differentiates between chart data. Therefore, I need to create and bind dataseries dynamically too. While I was trying to achieve this I have considered the information you gave me:

Well you might have noticed that we made few major changes in v4.5.x for better performance. Well previously DataPoints collection of a DataSeries was not a DependencyProperty. Now DataPoints collection in DataSeries is a DependencyProperty of type DataPointCollection.


But when I was binding dataseries' datapoints from code behind I couldn't find DataPointsProperty while I was trying
ds.SetBinding(Visifire.Charts.DataSeries.DataPointsProperty, <img src='http://www.visifire.com/forums/public/style_emoticons/<#EMO_DIR#>/cool.gif' class='bbc_emoticon' alt='B)' />;

Anything about how to bind dataseries datapoints programatically?

#13 shoaib

shoaib

    Advanced Member

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

Posted 28 February 2012 - 02:26 PM

Hi Xelom,

There was some problem with DataPointsProperty. Please download this internal release build and try.

Regards,
Shoaib

#14 Xelom

Xelom

    Advanced Member

  • Members
  • PipPipPip
  • 39 posts

Posted 28 February 2012 - 02:53 PM

Thanks Shoaib. I will try and give feedback as soon as possible.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users