JFreechart bars lots of color needed - jfreechart

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

Related

How to extract color using openCV

Hellow there~
I'm working to make app.
This app need feature that detect Rubik's cube color(Realtime).
I'm using OpenCV to implement the feature.
I try to set up ROI and I detect color in ROI.
I know how to detect specific color.
I used inRange function on hsv channel image.
It's good working.
But now I don't know how to check color on specific region.
Forexample,
rubik's cube color array
(00)Red/(01)Blue/(02)Blue
(10)Green/(11)White/(12)Orange
(20)Yellow/(21)Blue/(22)White.
I want to know (0,0)'s color. It's red.
I use inRange function like this inRange((0,0)_image, lower_color, upper_color, color_mask).
Now how to check (0,0)_image's color what is?
How to know that is red?
Thank you for your attention.
Please let me know.
You should convert your image into HSV color space, where H stands for hue -- that's the color. Hue 0 is red, 0.3 is about green, 0.7 is like blue, you'll figure it out quite easily.

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 different fonts or font sizes in title

Is it possible to use different fonts or font sizes in the title of a JFreeChart object?
Using:
chart.getTitle().setFont(new Font("Tahoma", Font.PLAIN, 16));
allows one to set the font but I am trying to create a bold, large font-size title followed by an explanatory sub-title with smaller font size on the line below.
E.g. something like: "Intensive Care Infections / data from 2008-01-01 up to 2012-12-31"
Any other way to achieve this effect, if not possible in the title object?
You can add one or many subtitles using the addSubtitle() method in the JFreeChart class. The title is always drawn first, then the subtitles are drawn (by index order). Note that the legend is added to the chart as a "subtitle", so depending on the position you may want to insert your real subtitle at index 0 so that it is positioned and drawn before the legend.

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

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;

Standard/best color schema for D3.js

Is there any standard/best color schema for D3.js? I used some colors but the UI is not good. Color combinations are not good. So if there is anything tell me.
There are a set of standard ordinal scales described in the api docs:
https://github.com/mbostock/d3/wiki/Ordinal-Scales#categorical-colors
You can use them like so:
var colors = d3.scale.category20();
d3.select("body").selectAll("text")
.data(d3.range(0,20))
.enter().append("p")
.text(function(d){return "Data point "+d})
.style("color", colors)
http://jsfiddle.net/x4xBL/
If you clone The d3 source, it also includes the color brewer categorical color scales. You can learn more about them here:
http://colorbrewer2.org/

Resources