DynamicDataDisplay and other charting libraries for WPF apps - wpf

I am looking for a feature rich charting library, I've seen infragistics but it is not performant enough when there are many data points rendered, on the other hand I see DynamicDataDisplay is a pretty awesome library, but the project is not maintained anymore. Could you list other charting libraries that I should be aware of. I am looking from performance and customizability criteria.

You can try to download a trial version of LightningChart, the fastest and fully configurable Charting and Data visualization components for .Net. Examples are included in download package.
You also can read about benchmark and see for yourself.

I have plotted line charts with around a million data points using ChartDirector, and it can plot it well within 1 second. However, ChartDirector is a Windows Forms control, so it needs to be hosted in a WindowsFormsHost control when used in WPF. You can also just display the chart as an image in a WPF image control, but then you lose the user interaction features (track cursors, drag to zoom/scroll, ...).

Related

stacked bar chart in wpf toolkit

can someone guide me on developing stacked bar chart in WPF toolkit. i tried that but didn't find a ready to go solution for this.
or is there any reference for developing a custom control to server the purpose of a stacked bar chart.
thanks
David Anson had a nice blog series on the WPF tool kit and charts, this one discusses the stack bars and should provide a good starting point.
This was a confusing topic to me for a day or so.
David Anson created some cool stacking charts for the Silverlight Toolkit Data Visualization library. The confusing part to me (as a WPF newbie) was that they were not present in the WPF Toolkit Data Visualization library.
In general, the goal seems to be to align the Silverlight Toolkit and the WPF Toolkit. Unfortunately, the current official version of the WPF Toolkit is from early 2010. The stacking charts in the Silverlight Toolkit were released around the same time and so the toolkits have not yet been aligned..
Clear as mud? David Anson was nice enough to provide the WPF source and binaries for the developer version of this toolkit. So, while not officially released, you can still get stacking charts with little effort.
The second problem I had was that once I had this binary referenced, my code compiled correctly but XAML UI designer couldn't recognize any of the new controls and barfed constantly. I resolved this by re-building the developer version of the toolkit to generate .pdb files.
Seems to be that the latest published version of the WPF Toolkit is 3.5 or 3.5.5, depending on where you get it from.
The stacked charts are only available in version 4 of the toolkit, which is available for Silverlight, but not officially for WPF.
If you'll head to this post, you can download the examples he uses (direct link).
Now, here's the beauty: browse to the "Toolkit -> WPF4" folder, and take the dll you'll find there. This is the version 4 toolkit for WPF, which you can then reference in your project, and have access to the stacked barcharts.
Once you got that up and running, just have a look at the code for the stacked bars examples, and work from there.
(Warning: I'm rather unhappy with those examples, since they relay heavily on code behind, and are not MVVM friendly at all, so I had to work around this a bit. It can be done though)
For people still finding this thread: Stacked100 and Stacked Series for Area, Bar, Column, and Line are available in the 4.0 release of the WPF Toolkit.

Third Party WPF suites w/ Automated/Coded UI Testing

My team is diving headfirst into a new project and we are taking the opportunity to bring ourselves up to date with Scrum methodology, new technology etc. Part of this involves trying to automate our QA process, using both Microsoft Test Manager and VS2010 Coded UI tests.
However, we are having problems getting the automated test playback to work with our currently-selected WPF control library, the DevExpress XPF suite. We've been using DevExpress for their WinForms and ASP.NET controls for years now, but this is our first experience with their WPF controls, and with automated UI tests, and the two don't seem to work well together.
In particular, trying to play back a recorded test that interacts with a grid control never works right, and even on simple controls the playback seems to get confused over which editor it should be interacting with. In the action recordings our test lead is generating from MTM I see a lot of this:
Type '5236' in 'PART_Editor' text box
Type '253' in 'PART_Editor' text box
And even worse, inside of the grids:
Click 'FooterPanel' pane
Last action on list item was not recorded because the control does not have any good identification property.
Click 'FooterPanel' pane
Click 'Item: CashEntry, Column ...' custom control
Move 'Item: CashEntry, Column ...' custom control from (141, 10) to 'Item: CashEntry, Column ...' custom control (5, 11)
Type '{NumPad8}{Down}{NumPad5}{NumPad0}{Up}{Down}{Down}' in 'CashEntry' window
Now, I have seen plenty of chatter on DevX's forums about their WinForms controls not supporting MSAA well enough for coded UI tests to work, but I thought that WPF used a different mechanism for automated UI testing that was supposed to work better. So, my questions are:
Is there a way to get the DevX XPF controls to work better with coded/automated UI tests?
If not, is there an alternative XPF control suite that is known to work well with coded/automated UI tests?
I'm specifically interested in a grid-like component with sorting, grouping, etc., a navbar-like component, and custom editors (dates, numbers, etc), all which support a unified system-wide theming.
(Also, if this type of thing is easy enough to do using just native WPF controls and styles, that would be helpful to know as well.)
EDIT: Since there appears to be no WPF control suite that actually works with MTM, we're being forced to use two separate testing tools at the sam time. Per several of the answers here, we're strongly leaning towards TestComplete. Hopefully the situation improves soon.
Don't have much idea about control suite supporting this but We had analyzed a test suite in past which supports objects based automated testing for WPF. Have a look at TestComplete (although it's not free)
Here is an excerpt from there site mentioning control support they provide -
WPF Control Support TestComplete offers rich support for WPF (XAML)
controls and robust automated UI testing of WPF applications.
TestComplete’s high-level test actions, such as item selection or cell
data input, are object-aware rather than coordinate-aware and thus are
more stable and resistant to the UI changes when performing WPF
testing. Flexible object mapping schemes allow testers to map custom
or derived WPF controls to standard types to simplify UI
manipulations. Support for custom WPF controls can also be added
using the TestComplete SDK.
http://smartbear.com/products/qa-tools/automated-testing/testing-wpf-apps/
I've heard very good things about WiPFlash.
In one of our projects we've used Infragistics WPF controls and TestComplete works with it.
Our QS Team also use TestComplete
I found a free utility that is independent of UI libraries.
PROJECT SIKULI
Sikuli is a visual technology to automate and test graphical user
interfaces (GUI) using images (screenshots). Sikuli includes Sikuli
Script, a visual scripting API for Jython, and Sikuli IDE, an
integrated development environment for writing visual scripts with
screenshots easily. Sikuli Script automates anything you see on the
screen without internal API's support. You can programmatically
control a web page, a Windows/Linux/Mac OS X desktop application, or
even an iphone or android application running in a simulator or via
VNC.
You can also use the VS internal UI test framework: Create a Coded UI Test.
just found this thread...
we had the same problem using DevExpress components,
which weren't findable on playback of CUIT.
But especially with Sikuli script the problem is solveable...at least.
Record test with MS Test Manager
Playback test, to find unreproduceble step
Create Sikuli sequence to 'step over'
Include created Sikuli script at appropriate position in CUIT and start again at Step 2
It really takes time to create tests this way, but at least its possible.

Implementing UI for a stock charting application on Windows - what technology to use WPF or WinForms?

I want to implement UI for stock charting application. (I already have an engine working which will provide the data for the UI - the engine is in C#).
The app will update charts in real time as stock price change (candlestick charts, bar charts, line charts etc..).
I wanted to know what technology will suit best for my requirement: WinForms or WPF?
If you're doing greenfield application development I would probably suggest WPF to WinForms.
Pros:
Less code and better separation: with WPF supporting bindings instead of having to write the app following the MVC pattern with the Controller layer being thick, you can create it following the MVVM pattern, having a relatively lightweight ViewModel
Easy to reuse almost all of the code you write and port to Silverlight or Windows Phone 7 later down the way. Porting Windows Forms code to the web or mobile is much more painful
More charting libraries actively developed for WPF: there are a handful of vendors providing and constantly updating their charting libraries for WPF. Vendors include Visiblox Charts (see an example trading application in Silverlight - should be the same in WPF due to ease of porting of code), Telerik RadChart and Infragristics xamChart
Cons:
Speed might be an issue - with GDI you can render tens of thousands of points on screen and animate them seamlessly, this gets slower in WPF. (Though it seems WPF / Silverlight is getting better at this: see the zooming functionality of a Silverlight chart with 6000 points onscreen)
Without knowing more about your requirements, I'd say you'll be fine with either. However, it may be worth knowing that thirdparty control vendors appear to focus more on their xaml controls than their older Winforms ones nowadays.
For example, you might want to use Infragistics's XamDataChart which is quite a bit fancier and has more finance charting features than their older WinChart (I'm sure the same is true for Xceed's and Telerik's equivalents and am not pushing Infragistics in particular.)
The WPF toolkit (http://wpf.codeplex.com/) has charting already built into it, you just need to plug-in the data (which you already have). It has full support for all sorts of graphs, not to mention animations and custom styling.

Is there a document highlighting WPF and Silverlight controls available in the framework?

I'm looking for something like a pdf or anything else that would show a chart of available controls in SL and/or WPF.
Ideally, the chart should have a drawing of the control, some succinct description and the hierarchy if possible.
Has anyone seen such a thing? Freeware or Payware, can even be from a book I could buy.
The following MSDN link lists the controls within the Silverlight SDK:
http://msdn.microsoft.com/en-us/library/cc189048(VS.95).aspx
You can try the sdk controls live following this link:
http://samples.msdn.microsoft.com/Silverlight/SampleBrowser/#/?sref=HomePage
The controls within the Silverlight Toolkit can be found here:
http://silverlight.codeplex.com/
Also, there are plenty of third party controls for Silverlight. The following link contains a list to some of them (free or not):
http://timheuer.com/blog/archive/2009/01/28/comprehensive-list-of-silverlight-controls.aspx
The controls that are shipped with the platform are fairly straightforward, so I'm not sure that would even make sense - i.e. the basic buttons, input box, text block, etc.
As for the controls that are shipped with the Toolkit, which is the richer feature set released out of band in relation to the Silverlight trunk, you can preview everything you asked for here:
http://www.silverlight.net/content/samples/sl4/toolkitcontrolsamples/run/default.html
What's more, the source code for the preview is included with the tool kit so it's very easy to see how any of those controls were used.

Designing a WPF map control

I'm thinking about making a simple map control in WPF, and am thinking about the design of the basic map interface and am wondering if anyone has some good advice for this.
What I'm thinking of is using a ScrollViewer (sans scroll bars) as my "view port" and then stacking everything up on top of a canvas. From Z-Index=0 up, I'm thinking:
Base canvas for lat/long calculations, control positioning, Z-Index stacking.
Multiple Grid elements to represent the maps at different zoom levels. Using a grid to make tiling easier.
Map objects with positional data.
Map controls (zoom slider, overview, etc).
Scroll viewer with mouse move events for panning and zooming.
Any comments suggestions on how I should be building this?
If you're looking for a good start, you can use the foundation of code supplied by the SharpMap project and build out from there. If I recall there were a few people already working on a WPF renderer for SharpMap, so you may also have some code to begin with.
I've personally used SharpMap in a C# 2.0 application that combined GIS data with real time GPS data, and it was very successful. SharpMap provided me the transformation suite to handle GIS data, along with the mathematical foundation to work with altering GIS information. It should be relatively straightforward to use the non-rendering code with a WPF frontend, as they already have presentation separated from the data.
(EDIT: added more details about how I used SharpMap)
It is probably a roundabout way of going about it, but you might find some useful stuff in the javascript and XAML from SilverlightEarth.com which a Silverlight 1.0-based map-tile-client. It can load VE, Google, Yahoo (there is a DeepZoom version that can load OpenStreetMap, Moon and Mars too; but since it uses MSI it doesn't really help on the WPF 3/3.5 front).
Although the javascript is a little untidy, you can clearly see it is creating a Silverlight 1.0 Xaml (dynamically sized) Canvas, filling it with tiles (Image controls) and handling zoom in/out and pan requests. You would need to make sense of all the javascript and convert it to C# - the XAML should mostly come into WPF unaltered. I have tested this Silverlight 1.0 with a Deep Zoom tile pyramid (and here) so the concepts are applicable (ie. not just for maps).
I know this works because I have done it myself to build the map viewer in Geoquery2008.com (screenshot) which is WPF/c#. Unfortunately the Geoquery2008 assemblies are obfuscated, but you might still glean some ideas or useful code via DASM/Reflector. It is still a beta so I wouldn't claim it is 100% done. I hadn't really thought of factoring out the map code into a separate control but may I will look into that if another one doesn't appear...
Incidentally I also started off with the ScrollViewer, but am planning to ditch it and mimic the javascript more closely so it's easier to re-use Image objects when panning/zooming (by gaining more control over the process than ScrollViewer provides).
These MSDN pages on the Virtual Earth tile system and the Deep Zoom file format and related links is probably also a useful reference.
Finally - I guess you've seen since this post that DeepZoom/MultiScaleImage is likely to be in .NET 4.0/Studio 2010.
Your desire to create a WPF mapping tool is similar to mine, which lead me to ask this question about DeepZoom (aka MultiScaleImage) from Silverlight. I want a WPF version. The accepted answer provides a link to a very good starting point (similar to your described thought process).
Virtual Earth has something favour to WPF
Don't know if you use ESRI software, but I hear there developing a Silverlight API for there stack so you might want to hold off.
It does not fall on my field of work at all, but you may have a look at MapWindow GIS, which has an Open Source ActiveX object that provides a lot of mapping and GIS features.
Here is a post explaining how to embed it on WPF applications:
http://www.mapwindow.org/phorum/read.php?13,13484
Download Bing Maps WPF Control sdk(Microsoft.Maps.MapControl.WPF.dll).Add as dll as referance,then change the XAML as below
**
<Window x:Class="WPFTestApplication.InsertPushpin"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:m="clr-namespace:Microsoft.Maps.MapControl.WPF;assembly=Microsoft.Maps.MapControl.WPF"
Width="1024" Height="768">
<Grid x:Name="LayoutRoot" Background="White">
<m:Map CredentialsProvider="INSERT_YOUR_BING_MAPS_KEY"
Center="47.620574,-122.34942" ZoomLevel="12">
<m:Pushpin Location="47.620574,-122.34942"/>
</m:Map>
</Grid>
</Window>
**
The main question is how you store and access the items you are going to put in the map (assuming this isn't just a picture display). Lookup scenegraph for some ideas.
Also if you want it to be more than a toy image viewer the lat long to XY scaling can get 'interesting'
Don't build it yourself - use the WPF Bing Maps Control
http://www.bing.com/community/site_blogs/b/maps/archive/2012/01/12/announcing-the-bing-maps-windows-presentation-foundation-control-v1.aspx
the Bing Maps Windows Presentation Foundation Control v1 is best map control in WPF.
Support for tile layers – you can now overlay your own tile layers atop the map control.
Turning off the base tile layer – this is useful for when you don’t need/want to use our base map tiles and instead would prefer to use your own without overlaying them atop of ours.The control won’t request the tiles which reduces downloads and improves rendering performance.
SSL Support – since many of you are using the WPF control in secure applications, you can now make tile and service request over SSL without issue.
Hiding the scale bar – if you don’t want a scale bar (perhaps your map is small and the scale bar clutters the map) you can turn it off. In fact, the only elements you can’t turn off are the Bing logo and the copyrights.
New copyright service – provides accurate copyright for our data vendors. Additional inertia – inertia is now enabled for the mouse and is on by default for touch.
Miscellaneous bug fixes – thanks for the feedback on the MSDN Forums, the Bing Maps Blog, e-mail and Twitter. Good finds people.

Resources