Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
485
FillSceneGraph vs Custom layer
posted

I have around 7300 points to be plotted on a chart (Polar Chart to be precide). User requirement is that the Symbol size, color and shape should be options he choose.

I ended up using the FIllScenegraph event to draw custom symbols on the chart. The chart seems to be slow to render, and often has to wait for one minute or more. On top of that I need to add the options to display /hide these points which makes the control useless to the user.

Can I get better performance with a custom layer?

What is the best way to render primitives on a chart? If all I have to do once the primitive is on the chart is to change its color, is there a better way to handle this?

Appreciate some help.

Anil

Parents
  • 26458
    Offline posted

    Using FillSceneGraph yields better performance than implementing a custom layer. I'm not sure why you're having such performance problems. When I try a polar chart with 10000 points and a custom symbol over each point, the chart takes about 2 seconds to render. Here's my sample:

    private void Form1_Load(object sender, EventArgs e)
    {
     DataTable dt = new DataTable();
     dt.Columns.Add("col1", typeof(double));
     dt.Columns.Add("col2", typeof(double));

     for (int i = 0; i < 10000; i++)
     {
      dt.Rows.Add(new object[] { i, i });
     }

     ultraChart1.ChartType = ChartType.PolarChart;
     ultraChart1.PolarChart.ColumnX = 0;
     ultraChart1.PolarChart.ColumnY = 1;
     ultraChart1.PolarChart.ConnectWithLines = true;
     ultraChart1.PolarChart.Icon = SymbolIcon.None;
      
     ultraChart1.DataSource = dt;
    }

    private void ultraChart1_FillSceneGraph_1(object sender, Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs e)
    {
     PointSet pointset = null;

     foreach (Primitive p in e.SceneGraph)
     {
      if (p is PointSet) pointset = p as PointSet;
     }

     if (pointset != null)
     {
      foreach (DataPoint point in pointset.points)
      {
       Symbol symbol = new Symbol();
       symbol.icon = SymbolIcon.Circle;
       symbol.iconSize = SymbolIconSize.Small;
       symbol.point = point.point;
       e.SceneGraph.Add(symbol);
      }
     }
    }

Reply Children