Where has Microsoft's WPF/Silverlight Charting gone in .NET 4.0? - wpf

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.

Related

Build Ribbon in full MVVM with Dot Net 4.5

we have several applications in FULL MVVM using the Ribbon from Microsoft. And it works fine, it's a great and flexible component :)
I was surprised to have to build my own templates and bindings to be able to use the ribbon in MVVM (I didn't find those files anywhere).
We are still using the Ribbon DLL from Microsoft (released around 2010 ) and can't switch to the ribbon existing in the Framework because it doesn't work with our Templates/bindings. Nothing happens/appears. Using the XAML description, everything is fine. I'm probably missing something. Does someone use it in full MVVM and which approach did you use to get it working ? Does the Framework contains the Templates and bindings hided somewhere ?
To summarize, how to use the ribbon included in the 4.5 Framework in FULL MVVM ?
Thanks for your help guys :)
If you target .NET Framework 4.5 or later you could add a reference to System.Windows.Controls.Ribbon.dll and use the built-in RibbonControl as-is:
<Ribbon />
You should be able to use this one more or less the exact same way as you use your current version. The templating of a control has nothing to do with MVVM. And of course the control comes with a default template.

Coded UI Test for DevExpress Controls does not work

I am going to start work on new project in which i am using DevExpress controls with winform applicaiton.
I want to do Coded UI test for winforms application and DevExpress controls.
I have VS 2010 Ultimate and DevExpress Controls 12.2 version(latest version).
In one of my example, i have created winform with GridControl of DevExpress.XtraGrid. when i create Coded UI test for this Grid Control, It's not working.
I mean it does not support it.
Can anyone give me solution/example/tutorial to do Coded UI for DevExpress controls in winforms.
Thanks !!
Refer: DevExpress Releases DXperience 12.1 with Coded UI Support and this.
Here you will get few videos that help you to understand about grid control and others also.
You can also go through Coded UI Test Extension for 3rd party
controls - the basics explained article of MSDN and documentation Verifying Code by Using Coded User Interface Tests.
More References:
DevExpress 2012 GridControl Coded-ui-tests issue
Ok for starters, ditch VS2010 and upgrade to VS2013 (Including latest update). If you don't do this - stop reading.
Next thing is versioning
To get reliable record and playback you will need to have the exact same version of DevExpess installed on your VS2013 Premium development box that your application under test uses.
So for example, if your app under test uses DevExpress 14.1.8 - INSTALL THAT VERSION in your coded ui dev environment. If you don't get the versioning exactly right - then it simply won't work.
Once you have that setup, create a new coded ui test project, and you should automatically get a DevExpress coded ui extension dll added.
Now fire up your application under test. Inside Visual Studio you will most likely get a sample test method, after creating the project. Set focus somewhere inside the test method, and then start the coded ui recorder. Now you should be able to identify controls and interact with them using the recorder. Save your actions / control identifications off to the UI map using the Generate Code in the recorder.
This should give you a good place to start with. If you really want my help, then you can send me a PM and I can share a lot of information that is beyond the scope of this. I'm on skype too and have made a lot of progress in the time I've spent specifically testing DevExpress based WinForms.
I can also share with you some helpful wrapped controls that wrap stuff like DXGrid to make your life tons easier.

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.

Windows Phone 7 Charting/Graphing Controls

We're working on a Windows Phone 7 prototype application and we need a Graphing/Charting control to work with. We looked at the Silverlight Toolkit, which has some controls that look like they would work great. However, we can't get that to work. Whenever we add a control to the XAML from that toolkit, it will throw an exception when trying to load the XAML at runtime, even though it appears to work in the designer. I think that it's because there's some dependencies that the phone doesn't actually support.
Does anyone know how to fix the problem or know of charting software that works on Windows Phone 7?
Here's an example of code that doesn't work. We downloaded and installed the 4.0 beta of Silverlight Toolkit. Added the DLL as a reference. Added this to import the namespace:
xmlns:c="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"`
then added this to make a chart:
<c:Chart>
<c:PieSeries>
<c:PieSeries.ItemsSource>
<l:IntList>
<sys:Int32>23</sys:Int32>
<sys:Int32>2</sys:Int32>
<sys:Int32>1</sys:Int32>
<sys:Int32>34</sys:Int32>
</l:IntList>
</c:PieSeries.ItemsSource>
</c:PieSeries>
</c:Chart>
the designer shows the pie perfectly, however when I try to compile and deploy it throws an exception saying that it can't find the MainPage.xaml. Which leads me to believe that MainPage.xaml isn't compilign correctly (not sure, as I'm still a newbie at Silverlight)
Here's the exception:
System.Windows.Markup.XamlParseException occurred
Message=2255 An error has occurred. [Line: 36 Position: 2]
LineNumber=36
LinePosition=2
StackTrace:
...
on this line:
System.Windows.Application.LoadComponent(this, new System.Uri("/Twitpic;component/MainPage.xaml", System.UriKind.Relative));
You can probably reuse some of the things provided by the silverlight toolkit, which is open source:
http://silverlight.codeplex.com/Wikipage
You might have to recompile some stuff against the win phone APIs, but it should work :-)
It looks like someone else has had the same issue as you and solved it by using the Silverlight Toolkit version 3
http://silverlightfeeds.com/post/2502/Windows_Phone_7_RTM_charting_using_the_Silverlight_Control_Toolkit.aspx
Just found these free WP7 charts: amCharts for Windows Phone 7
If you are looking for great charting on WP7, I suggest Visifire. Note that its a commercial offering. Has gesture support too! I've seen very less charting vendors who've optimized charting for mobile-form-factor like these guys do.
You can try MS Toolkit, if you are looking for free basic charts.
Playing around more, I was actually able to get Visifire to work. Just had to browse and add the reference to System.Windows.Browser. I don't know if this is the best way to make it work. But it'll do until the Silverlight Toolkit gets updated.
Macadamian team developed and gives for free a Chart Control. You can pick it up at http://themobileexperience.macadamian.com/2010/05/chart-control-for-windows-phone-7.html
Ani
Just a quick plug for my own graph control I recently released to open source:
Check it out, it scales to hundreds of thousands of points and responds to pinch,zoom,translate and tap gestures:
http://touchgraphwp7.codeplex.com/
A couple of options worth a look.
David Anson's blog and thread posting on charting.
Chart Control for Phone
Why didn't I think of that in the first place? [Windows Phone 7 Charting example updated to include reusable, platform-consistent Style and Templates] - Delay's Blog
And a commercial offering.
Silverlight, WPF & WP7 Chart Controls
This one too
http://www.visiblox.com/examples

Exception when add Silverlight dll in WPF application

When i added the silverlight dll in the wpf application , i got the following exception.
Could not load file or assembly "System.Core, Version=2.0.5.0". The located assembly's manifest definition does not match the
assembly reference.
This is happening only in VS 2010 professional Beta 2.
You cannot use Silverlight directly in a WPF application, as they do not use the same version of the .NET Framework, thus the error message
Could you give some more details on your scenario ?
If you have a WPF app, you have more than what Silverlight can give to you.
If you are building a solution with multiple products, and one is WPF for the desktop, one is Silverlight for the Web, you need to create 2 different projects in VS.
Take a look at the source tree here:
http://expressionblend.codeplex.com/
Specifically, the Expression.Samples.Interactivity.Design branch.
This shows a few examples of how to put in property editors for use with Blend. I'm not sure if the same concept is transportable to the Cider design surface, but heck, Blend is nicer for pure XAML editing anyways. :)

Resources