Pie Charts custom color - wpf

I'm trying to develop a custom control for charting.
I'm using the WPF toolkit, but I can't find how it is possible (is it?) to set a specific color for each piece in a pie chart.
I don't understand why they made this one so complex. Many applications are using specific colors for existing categories, wouldn't be reasonable to use the same in the charting?

Related

Silverlight Toolkit Pie Chart Add Labels

I have been working with Silverlight for some time now but this is my first experience with the charting capability provided by the silverlight toolkit. Basically I am trying to create a pie chart that contains labels for each slice of the pie. The labels can be inside the pie piece itself or outside it makes very little difference to me. My data set is very simple. I have a Result class that contains 2 properties, a name and a count and I am using that as the source for the pie chart.
I have tried to google this but most of the results I get pertain to telerik or other 3rd party controls.
Can someone please share there wisdom on how to accomplish this? Thanks.

Winforms and drawing complicated charts

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.

Icons in WPF when to use image and when to use Xaml?

I am Working on a WPF based project where the design team have created the design in blend with some images like Edit, delete, checkbox etc. where i am prefring to use xaml insteed of images
Although i am sure that if the images are prety complex they should be used as images. but the simple im icon images can be used as xaml path designs. So i am looking for the recomandations. When to use Images in WPF design and When to use xaml for design.
If your application is going to be used in different screen resolutions then using Vector Graphics is recommended as they will scale nicely and all your images will look sharp regardless of the resolution of the screen. (There is a downside as well because your application needs to do the extra rendering of the xaml images to display them)
If you are using the images just to display the toolbar images (which are pretty much small and fixed size then you can get away by using png files as they will take less resources and easy to manage)

Scalable themes in qooxdoo

I'm developing an interactive full-screen application using qooxdoo Desktop. The application should deliver consistent user experience on multiple devices, from 1024x600 netbooks to modern 2560x1600 "retina" displays.
The application uses custom widget theme. The problem is, to provide consistent look'n'feel across multiple resolutions we have to adjust parameters like border radius (for buttons) and font size. Do I have to maintain individual themes for each major resolution, or is there more elegant way to do the same?
If you want to have a couple of predefined steps your theme should have, you can use states for that.
Patch qx.ui.core.Widget and add the desired states for every widget in the constructor
You can access these states in the appearance theme and react set the desired values based on the given state.

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.

Resources