How to create pie chart using wpftoolkit with shades of only one colour - wpf

I am new to wpf, I am using wpf toolkit to create pie chart. I have created pie chart using wpf toolkit but my problem is that I have to create Pie chart only with a particular color shade. Say for example green, then my pie chart should use shades of green only. Also this assignment of color to pie pieces should be done pro grammatically.
Can anyone please advice how I go about it?

There isn't a simple answer to your question.
You can set the colors manually, or let the framework pick random ones for you.
What you could do, is have a method that takes as an argument the amount of series in your graph, and a color, and returns an array of colors of that color shade.
You'll have to look at how colors work (RGB) and figure out how you want to do that (keep in mind if you have heaps of series, this will not look good).
Have a look at this colorpicker page for a quick understanding of what you're looking for (in shades).
an example going from dark blue to white will have the following values:
#000000
#00001A
#000033
#00004C
#000066
#000080
#000099
#0000B2
#0000CC
#0000E6
#0000FF
#1919FF
#3333FF
#4D4DFF
#6666FF
#8080FF
#9999FF
#B2B2FF
#CCCCFF
#E6E6FF
#FFFFFF
and it shouldn't be hard to pick from that array 4 shades for example.
Then you'll have to manually (well, with a for loop, but still, in code) add them to your series.

You can use below code in order to change the shades of the charts.
if you want to change from XAML then use this code:
<chartingToolkit:PieSeries x:Name="piecharts"
ItemsSource="{Binding DepartmentwiseGroupedEmployee}"
IndependentValuePath="DeptName"
DependentValuePath="DeptId">
<chartingToolkit:PieSeries.Effect>
<DropShadowEffect ShadowDepth="10" BlurRadius="14" Color="Green"/>
</chartingToolkit:PieSeries.Effect>
</chartingToolkit:PieSeries>
or if you want to change from code then use below code:
var shadowEffect = new DropShadowEffect();
shadowEffect.Color = Colors.Green;
shadowEffect.ShadowDepth = 10;
shadowEffect.BlurRadius = 14;
piecharts.Effect = shadowEffect;

Related

JFreeChart change text color

I have recently implemented a JFreeChart library in my program, but I struggle to change some of the colors of the text, so I can use it in my dark theme. The screenshot below highlights the labels I was not able to figure out how to change the color of.
I am using java swing library with the latest version of JFreeChart and JCommon
If there is any way of changing those colors to some brighter colors, I would be really glad.
Thanks everybody for their answers, I really appreciate any kind of help with this problem. This is the image showing which parts of the chart I want to change the color of the text.
Try setTickLabelPaint() on the Axis that you want.
See all Changing color of labels in JFreeChart.

How to show the each levels with different color in sunburst chart?

I have created a sunburst chart with the help of the Anychart library. Now I want to fill different colors on each level. Like blue color background in all slice of level-1. all data is coming dynamically from SQL. How I can do this?Sample image of what I want
Colors of the children in Sunburst chart are inherited from the parent. It means the only way to achieve what you want is to set them for each point in the data. Please check this sample: https://playground.anychart.com/997YGRTI

Unable to change ColorPalette property on Telerik Report graph

I'm using the Telerik Reports graph wizard to create a bar chart. Even though I can change the ColorPalette property to GradientPalette and can choose the desired colors, the results are the same flat single color. What am I doing wrong? Thanks for your help and advice.
The Graph's Color Palette applies gradient coloring on the whole series, not on each of the the data points. I believe you're trying to achieve gradient-colored bars, but this feature is not supported. If in your bar chart you define series groups, then the first bar will be colored using the palette's BeginColor, the last bar will be colored with the palette's EndColor all the bars between them will have solid color, calculated based on their count and offset from the BeginColor towards the EndColor.
The Gradient Palette makes much sense when used in the Choropleth, where the color represents an additional data measure - see a demo here.

JFreechart bars lots of color needed

I am plotting a barchart with 26 bars.I need different colors for the bars.So i need 26 colors.I found that color can be set by specifying 'Color.BLUE' 'Color.red' etc.
But are there 26 colors available like this?Is it possible to use colorcodes like '#66FF66'
I tried 'Color.#66FF66',which is not correct.
Can anybody help?
JFreeChart defines several colors in org.jfree.chart.ChartColor. You can use these if you like. These are the colors it cycles through as you add additional datasets to your plot.
ChartColor.DARK_BLUE
ChartColor.DARK_CYAN
etc...
Or you can use java.awt.Color. There are lots of ways to specify a Color--look at the javadoc for it. Here's an example using RGB values:
//this will create light blue color
Color customColor = new Color(10,10,255); //r g b

Silverlight Toolkit Charting Control - Show "Column" Colours

In the silverlight toolkit chart control, the legend on the X Axis can show an indeterminate amount of points. E.g. 1,2,3,4,5.
Would it be possible to colour the virtual columns that this creates? I.e. in the space where legend mark 2 is shown, the space above to the top of the control is shaded to a different colour. This will make it interesting as as the chart scales, the legends on the X Axis change with the size available.
This is mainly for a series of type ScatterSeries for my specific example but could extend to a series of LineSeries.
Hope this explains my requirements.
It's not really possible due to the fact that there are no virtual columns created.
The chart is a canvas and the scatter point is just a point positioned on it. Your best bet would be to create your own ColumnSeries type and then style it to look like a ScatterSeries with your desired background colour.

Resources