Winforms and drawing complicated charts - winforms

I need to draw complicated chart (something like in the picture).
As I am developing WinForms app, I would like to show that chart in my window. What I am looking for is some library that would allow me to do that. I found ChartControl, but it seems to be a bit primitive and insufficient for my needs.
Do you know some libraries that would let me draw complex charts? Compatibility with winForms is not priority, but I would like to generate that chart using C#.

From within WinForms you can use the System.Drawing namespace to do your own drawing.
For a chart as complex as this, there is a great likelihood that you will be able to write your own code to draw it in less time than it will take you to learn some existing library (which was built primarily for bar charts) and coerce it to draw such a chart for you.

Related

DynamicDataDisplay and other charting libraries for WPF apps

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, ...).

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

Need recommendations for Image Editing Library

I am trying to create a WPF based application which will allows users to edit photos and provide features like:
Increase/Decrease Brightness
Crop
Retro looks
and lot more.
I am also looking forward to provide more fancy features like : Framing an image, print to a Tshirt, but these are low on priority.
Any open source libraries for that?
P.S -> This is a POC project, even if i miss some features it will be fine.
I would suggest you to use BitmapEffects available in WPF, the BitmapEffects make use Shading language; at present very few effects available in .net Fx. But it is quite easy create your own shaders to adjust the birghtness, gamma, colour saturation, and they can be data bound too. The great thing about shaders is you apply them to videos as well.
Shazzam Tool is on of the best tool to create shadders, it lets you try the effect on your images and generate the C# or VB.Net binding code to use in WPF/Silverlight.
I guess you have to write code to do the image cropping, or quick Google search would help.
Opensource shader effects available here in codeplex.
For a low-level library that allows GDI like operations on bitmaps please see the WriteableBitmapEx library. This is open source and as a disclaimer, I have made a minor contribution to it.
WriteableBitmapEx has functions for drawing shapes, lines, ellipses, applying filters (via matrices, e.g. convolution blur etc), rotation, resize and cropping. You would have to write your own code to apply framing but this could be done by rendering to a separate bitmap and using the Blit function.
Above all its very fast and portable, to WP7 and Silverlight!
Best regards,

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.

Making input form rotate in 3d using WPF (like silverlight planeprojection)

I am looking at updating the UI of one of my projects that currently uses Winforms and i was hoping to use WPF. I have used silverlight for a while and wanted to use the same PlaneProjection effects to basically rotate my form (by form i mean a group of input controls) along the Y axis.
After looking over the interwebs it looks like for some reason WPF doesnt support this kind of usage with 2d controls like silverlight does, however after scouring i managed to find Thriple, which looked like it was what i wanted, however i find trying to create my UI in the XAML editor a nightmare with it as it seems to stretch and skew everything and ignores the width/heights as if it is automatically scaling everything.
I was wondering if there was anything else that would allow me to do what i want, ideally i would also like it to support WindowsFormHost controls as i have some winform controls that i would like to continue using. It seems a bit silly that silverlight does EXACTLY what i want, but the main technology it is based upon doesnt...
Any alternatives would be great, i just want something that will let me rotate and translate my controls in 3d space and still allow the user to interact with the control.
I don't think it's as easy to do in WPF, but its definitely possible. You'd have to use the Viewport2DVisual3D class inside a Viewport3d.

Resources