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.
Related
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, ...).
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.
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.
I'm looking for a WPF prism with ribbon application samples and tutorials. I have found many that cover prism or ribbon but only a few sources provide any information about implementating those two together in one application. No course code usually in available tough. An example with a few simple modules and a classical ribbon tab control would be perfect for me to start.
Thanks for any help.
Regards,
Enzo.
Edit:
I should add that by combining the two I want to be able to load different modules depending on the ribbon tab selected by user.
You can find some info on a customized region adapter for the WPF Ribbon Preview here.
Regarding the loading of modules on demand in Prism, here is another link to MSDN, covering the topic.
David Veeneman wrote a nice article about Ribbon & Prism on CodeProject
http://www.codeproject.com/KB/WPF/ViewSwitchingAppsPrism4.aspx
It includes RegionAdapter for Ribbon .
There is "Southridge Hands-On Labs" on Codeplex (download on WPF futures page). It is quite extensive, but documentation and source code are not in sync (it looks they updated labs source, but not accompanying documentation), so it can be a pain sometimes to get what is going on.
It is based on Microsoft's WPF Ribbon Preview library.
Edit:
I am not aware about any tutorial that covers both. You can check series of videos on Prism and Silverlight by Mike Taulty. There is also source code for application made in last video.
Then you can combine knowledge from Southridge labs and this Prism tutorial.
I ran into a similar problem this weekend and after much reading and searching came up with this code that I posted for review
https://codereview.stackexchange.com/questions/429/mvvm-wpf-ribbon-v4-with-prism
Forgive me for being a little naive perhaps, but it seems that System.Windows.Controls.DataVisualization.Charting has vanished from VS2010, and blend 4. I'm trying to make a bar graph with a line overlayed, but can't even get started because I can't find the appropriate controls.
I know I could use an external graphing package, but I'd like to try the inbuilt controls first.
You mention Blend so I assume that you are refering to the WPF/Silverlight chart controls.
The System.Windows.Controls.DataVisualization.Charting namespace is part of the WPF Toolkit. You will have to download this toolkit and reference it from your project.
The question has been clarified to indicate it is about WPF controls. The answer below refers to the Winforms and Asp.net chart controls. I'm leaving it here in case other people find it useful.
The original MS Chart controls were never part of the framework. They are an separate project.
You can download them here.
There is also more info on their project page.
There is an addon to the IDE, (here), but it's for VS2008, I don't know if it will work with 2010. I would assume they are going to update it at some point, but there doesn't seem to be any information on when that will happen.
I stand corrected, .Net 4.0 apparently now has built in chart controls. You shouldn't need to install anything. You'll need to make sure you are targeting framework 4.0.