Tuesday, March 4, 2008

The Infragistics’ user controls library review

All my late .NET projects had a mandatory, common requirement: the Infragistics NetAdvantage control library. I have been using it since the 6.1 version came out, over one year of development period, on six different .NET projects. Considering this, I believe I have enough experience with this user control library to highlight all the goods and the beds that come out from it. Infragistics provides different versions of the NetAdvantage library for both the web (NetAdvantage for ASP.NET) and desktop (NetAdvantage for Windows Forms) platforms. I didn’t work with ASP.NET version so I will limit this analysis for the Windows Forms version only. I will not describe here every control from this collection because I consider only two of them to be noticeable: the UltraGrid and the UltraChartcontrols.

The Infragistics' UltraChart control review

I used this user control in almost all my projects during the last year. Infragistics is presenting us the following features for this component:
  • Over 50 2D and 3D Chart Types.
  • Design-time Convenience – Custom wizard for designing single-layer or multi-layer charts, with optimized default presets to ensure you will make the best presentation of the chart type you have chosen to display.
  • Composite Charting – Build complex charts with Series Collections, Chart Area Collections and Chart Layers Collections.
  • Advanced Graphics – Use Anti-Aliasing, Alpha-Blending, Solid 3D, 2D or our custom Paint Elements to design the highest quality visual appearance.
  • Multiple Rendering – Choose from multiple image types for rendering.
Sounds good, isn’t it? Now let’s see what lies behind of them.

Indeed. This charting control comes with a rich collection of predefined chart types for both the 2D and 3D rendering mode. It also includes the composite mode which can blend different chart type to work as one entity. For example it allows combining a line chart, a column chart and an area chart on the same charting area. Each used chart type has to be defined on a separate charting layer. It provides printing support and allows saving the rendered charts as images by specifying the image type.

Now let’s present the bad things that are coming with this user control. So I will start with the composite chart which is a feature available for 2D charts only. But maybe this is not a dramatic issue because a chart combining a pyramid and a cone, for example, wouldn’t provide a good overview of the represented data.

The wizard that comes with this charting control seems to handle its job pretty good but sometimes it messes up the code it generates in the form’s design file and this can end up with an invalid form, that the Visual Studio designer can’t open, or even a Visual Studio crash.
WinChart designer error
The ZeroAlignData property should ensure that the Y axis starts always with value zero, no matter what data is loaded. This is an old feature of this control, not sure if it was there from the first release of the collection, but in the version 7.3 it doesn’t work. It is completely ignored at run-time even if it seems to work in the wizard’s preview. In my opinion, it is not acceptable for such a bug to survive thru that many releases.
WinChart's ZeroAlign property is ignored
The FillSceneGraph event is a new feature presented for the first time in the 7.3 release. It is meant to help the programmer to recognize and manipulate all the chart primitives are about to be rendered. This is very useful because it helped me to render composite charts that are not supported by default. Please read How to: Create new chart types with Infragistics Ultrachart for more information,

The problem occurs when the SaveTo(MemoryStream, ImageForma.BMP) method is used. It seems that this method starts rendering the entire chart one more time, without triggering the FillSceneGraph event. So, the printed chart from the memory stream (which can be transformed very easily into an image file) will not have the same look as the one rendered by the control. In this case, the FillSceneGraph event becomes useless. This event was presented as a highlighted feature of the 7.3 release. They don’t spend to much time testing the new releases?
WinChart's FillSceneGraph event is fired WinChart's FillSceneGraph event is NOT fired
Using the column chart with a series of equal values will end up with an empty chart. So, if we want a chart with 5 columns, each with a hight value of 20, we will get only the axes and theirs names. Transforming this into a composite chart (for example, by adding a line chart layer) will fix the problem. I discovered this issue in the 7.x versions. For the NetAdvantage 7.3 you find a workaround here.

Here is my C# code sample to reproduce this issue:


private void Form1_Load(object sender, EventArgs e)



    this.ultraChart1.Data.ZeroAligned = true;

    NumericSeries ns = new NumericSeries();

    ns.Points.Add(new NumericDataPoint(20, "1", false));

    ns.Points.Add(new NumericDataPoint(20, "2", false));

    ns.Points.Add(new NumericDataPoint(20, "3", false));

    ns.Points.Add(new NumericDataPoint(20, "4", false));



If all the columns have the same height the chart is not rendered
One version of the SaveTo method, accepts a size for the outputted chart image. This is not working properly because the resulted image will be big as the specified size but the chart itself will have the same size as the one rendered by the control. Only the chart’s borders are resized and the axis names replaced correctly regarding the specified size.

The scrolling bar is not working. The only way to scroll a scaled chart is to use the scrolling arrows. This is pretty annoying mostly for the user. Please read How to: Enable zooming on Infragistics composite charts for more informations about this feature.
Infragistics UltraChart scrolling bar is not working
Hidden properties. The zooming and scaling seams to be not supported by the UltraChart's composite mode, but this is not true. The properties that enable that are in the right place but they are invisible for the IntelliSense. Please read How to: Enable zooming on Infragistics composite charts for more informations about zooming and scaling on composite charts.

kick it on DotNetKicks.com

No comments: