I'm sorry I don't know what it is so I may have asked an unclear question but I hope the attached images explains it. I circled the areas I need to remove. I simply need the whole background to have one continuous color whether it's gray or anything else.
Here is the piece of code I use to generate the chart:
final JFreeChart chart = ChartFactory.createTimeSeriesChart(generateTitle(title, resultsCount), xAxis, yAxis,
(XYDataset) paramCategoryDataset, true, false, false);
final XYPlot plot = chart.getXYPlot();
plot.setNoDataMessage(MSG_NO_DATA);
plot.setBackgroundPaint(Color.LIGHT_GRAY); //I need the BG to be plain gray.
SymbolAxis localSymbolAxis1 = new SymbolAxis("Domain", new String[] { "Failure", "Success", "Failure", "Success", "Failure", "Success" });
plot.setRangeAxis(localSymbolAxis1);
XYStepRenderer localXYStepRenderer = new XYStepRenderer();
localXYStepRenderer.setBaseFillPaint(Color.white);
localXYStepRenderer.setUseFillPaint(true);
localXYStepRenderer.setBaseShape(ShapeUtilities.createDiamond(2f));
localXYStepRenderer.setAutoPopulateSeriesShape(false);
localXYStepRenderer.setAutoPopulateSeriesStroke(false);
localXYStepRenderer.setDataBoundsIncludesVisibleSeriesOnly(false);
plot.setRenderer(localXYStepRenderer);
And here is the image showing what I need to remove within in curved rectangles:
But let me ask another greedy question. Is there a way to have my step graph line right in one of those hilighted areas instead of having half of it in the dark part and the other half in the lighter part ?
To get a continuous background color, you can set the gridlines' visibility to false.
plot.setDomainGridlinesVisible(false);
plot.setRangeGridlinesVisible(false);
Alternatively, you can set the plot's background color to match the gridlines.
Addendum: I meant the light and dark areas in the background.
Ah, you want the alternating light- and medium-gray areas to be a single shade of gray. Try this:
symbolAxis.setGridBandsVisible(false);
Related
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.
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.
So I have a working XYPlot but I want to add different colors to the background, not a single one. I know this appears to be doable for quadrants, but I want it basically row by row, or ranges of rows I should say.
Basically something like this :
but with ideally 3-4 colors instead of just 2. Can you set the background paint for a specified Axis range for example? I haven't found any info or way to do it yet.
IntervalMarker "Represents an interval to be highlighted in some way." In the example below, two markers span the plot's range.
XYPlot plot = new XYPlot(…);
plot.addRangeMarker(new IntervalMarker(.3, 1, new Color(0x60CCFFE5, true)));
plot.addRangeMarker(new IntervalMarker(0, .3, new Color(0x60FFCCE5, true)));
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;
I want to know if it is possible to put a JFreeChart subtitle in the bottom of the chart, under the chart, and not under the Title.
What I want to do is illustrated on these images:
http://i.stack.imgur.com/AmPJ8.jpg
and
http://i.stack.imgur.com/VBfvL.jpg.
I just tried almost everything and cannot do this.
I am using subtitle insted of legend, because legend is presented with a red square, indicating the color of the series shown on the graphics.
Thanks in advance!
Joey
In this example, the following TextTitle appears to work.
chart.addSubtitle(new TextTitle(new Date().toString(),
new Font("Dialog", Font.ITALIC, 14), Color.black,
RectangleEdge.BOTTOM, HorizontalAlignment.CENTER,
VerticalAlignment.BOTTOM, RectangleInsets.ZERO_INSETS));