How to make a contour plot in WPF? - wpf

I am going to make a contour plot of some data. I have a component called Telerik and a component called SciChart for making graphs. I have looked at their homepages and searched the internet and i dont think they support contour plots.
So how would i make a contour plot in WPF?

you can use https://oxyplot.codeplex.com/.
it is better documented than d3 and currently supported.

There is a question on Telerik site with the question, that may be interesting for you too.
And also Dynamic Data Display on CodePlex.

Related

Dynamically rendering polygons server-side?

I'm trying to implement a polygon based heatmap (i.e., instead of the color transitioning smoothly between two points, the color is the same within each polygon and changes across polygons).
The polygon color will tell the user which area's of the map are "good" and which are "bad". Similar to what these guys are doing here (http://illustreets.co.uk/explore-england/).
However, the color of the polygons will depend on the user input. Therefore, they have to be rendered dynamically. I don't think that the client will be able to handle the rendering, so the rendering will have to happen on the server.
I'm currently exploring ArcGIS as an option.
Does anybody know how to accomplish what I need in ArcGIS (or any other products)?
It would be best if I can find sample code that does something similar.
Thanks!
Based on our discussion in the comments, I can suggest the D3.js library. It is designed to make dynamic visualization easy.
http://d3js.org/

Implementing true Pinch and Zoom in the OxyPlot 2D library with MonoTouch

For plotting graphs I used the coreplot library for a while in my MonoTouch based iPhone app, but with iOS 6.0 the already annoying binding problems become so many that I decided to drop it for a library natively written in C#.
Searching around I found the excellent OxyPlot 2D library, and more specifically the MonoTouch port made by dvkwong.
The library works fine and has tons of useful features, but its output is just a rendered bitmap UIImage.
This means that I need to add myself the pinch and zoom features to the library.
The current implementation, based on the dvkwong preliminary example, uses the UIScrollView to zoom and unzoom the resulting bitmap image added to a simple subview.
This is not a good solution because when zooming the aliasing of the bitmap is made visible , and if the resolution is increased the text fonts becomes unreadable because are not optimized for the current zoom resolution.
I need to render the image each time at the correct resolution, without using UIScrollView but just overriding the DrawRect() call in a custom UIView.
But how to reproduce the the pinch-zoom gesture of Apple UIScrollView and draw the correct subrect of the OxyPlot plot model?
I tried to implement this method suggested here:
position the pinched view between the two fingers
But it doesn't work because I need to know the sub rect to draw, not applying a transformation matrix. Also there is no "draw sub rect" method in the OxyPlot library, so I need to set a cliprect in the image context and drawing a bigger image first and then clipping it. This is clearly too slow, because at some zoom levels the image can become huge (and I need the user to be able to zoom indefinitely on any part of the graph).
Any help is appreciated.
Thanks in advance.
I solved the problem myself.
I've created another MonoTouch port of the OxyPlot 2D library, this time supporting both Pan & Pinch-Zoom gestures. I've also added iPad support.
Now we have a native C# plot library for MonoTouch.
You can download it under the MIT Licence here:
https://github.com/Emasoft/OxyPlot.2DGraphLib.MonoTouch

WPF Charting + Grid help

We I'm looking for good WPF toolkit (ones that cost money) that can provide both powerful grid and charting. I'm not that up-to-date whats out there, so i was hoping anyone can assist me with where i should look for. some of the most needed features we need:
Grid:
Hierarchical tree grid
Charting:
panning and Zooming
3D charts
Empty Data point display
Line chart / Scatter Plot
any suggestion would be highly appreciated.
You might want to read this: https://stackoverflow.com/questions/1152016/best-charting-tool-for-silverlight-and-wpf
We're currently using two toolkits for WPF development:
Telerik
Infragistics
They both features charts and a powerful grid, plus a bunch of other things. There isn't much between them to be honest. Telerik seems to look a bit slicker. On the other hand the technical support you get from Infragistics is first class and well worth paying for. You can get a chat session with an actual developer within a couple of minutes and they usually have a solution for whatever problem you are facing.
I would happily recommend either of these.

Zooming on Silverlight Toolkit charts?

I need to enable zooming on the Silverlight charts I use - at the moment this is Silverlight Toolkit. As far as I've understood the SL Toolkit charts don't support zooming, however I'm looking into implementing this functionality. So far I haven't managed to get far: applying ScaleTransforms to the Series elements doesn't work as expected.
Can anyone provide me with example code on implementing zooming in Silverlight Toolkit?
I've previously looked into implementing zooming on the Silverlight Toolkit charts, however failed because of (probably) the following reasons:
Silverlight Toolkit charts don't seem to have been designed to be able to extend for zooming. There are no hooks that you could easily attack some zooming logic to, if you want to create zooming on them, you have to go much deeer.
The simplest way of implementing zooming is using ScaleTransform and RenderTransform to elements. In case of Silverlight Toolkit you want to apply this to the series. However just calculating the correct ScaleTransform and OffsetTransform are difficult enough
When scaling, you don't want everything to scale. If you zoom in 4x on a line series with points on it, you don't want the line to be 4x thicker and the points to be 4x larger. This means that even if you did implement applying the ScaleTransforms and RenderTransforms correctly, all you would get is a magnifying glass, which is still far from ideal.
After a few hours I gave up on adding this kind of support to the SL toolkit charts and instead looked for other components that support zooming and have a decent API to deal with it. These are the components I've found (though I'm sure there's more):
Visiblox Charts free version: it has a nice API and implenting zooming takes only a few lines of XAML according to this blog post (also see a post on a comparison with SL toolkit charts). Full disclosure: I have been heavily involved in development of this library.
Infragistics xamWebChart also claim to have support for zoom in the premium version of their charts
Telerik RadCharts also seem to allow zooming based on this example - though it's not clear to me whether you'd have to implement this functionality yourself.
Summing it up, I think the easiest way for you to go it with a component that already has zooming implemented - from my experience it would take a lot of investment to add proper zooming + panning to Silverlight Toolkit charts.
You should take a look at user610173's blog post. Specifically, download the full example code here: http://slchartzoomandpan.codeplex.com/SourceControl/list/changesets Very helpful!
Adding to Gergely Orozy comment about Telerik:
You can easily add the Zoom functionality with the following XAML.
<charting:ChartArea.ZoomScrollSettingsX>
<charting:ZoomScrollSettings ScrollMode="ScrollAndZoom" MinZoomRange="0.005"/>
</charting:ChartArea.ZoomScrollSettingsX>
You can check out a demo by clicking here and the source code is also available on that same tab.

Silverlight - Perspective 3D

I am considering using Silverlight for a project I am working on. This project will need to show a 3-Dimensional cube. Is this possible in Silverlight?
I see a lot of examples that a basically 2-sides of one item. Kind of like a sheet of paper. Is this what "perspective" 3D is? How is perspective 3D different than normal 3D?
Thank you!
You should look at Kit3D for Silverlight. Someone also created a silverlight3d.com site, but it current just has three reference articles and a link to Kit3D.
It is also possible to emulate 3D as demonstrated by this MSDN article.
The feature that was added in Silverlight 3 is referred to as "perspective 3D" to avoid confusion that might arise with someone expecting it be some kind of full scale 3d rendering API (like DirectX or OpenGl etc.) or something like WPFs UIElement3D.
The "perspective 3D" feature in Silverlight allows you to take any regular 2D UIElement and rotate it in 3D dimensions; you can think of it like a more powerful RenderTransform. There are two ways of setting a "Projection" on a UIElement, with a PlaneProjection (simple) or with a Matrix3DProjection (more complex).
You could certainly use this feature to create a 3D cube, where each face of the cube is a UIElement with a Projection applied to it. However you would not use this feature to create something that required complex 3d models such as a 3D game.

Resources