JFreeChart, JRChartCustomizer, drawing a overlaying rectangle [duplicate] - jfreechart

I have used XYAnnotation and drawn a rectangle in xylinechart. Now how can I join it with another rectangle annonation?

One way would be to use an XYLineAnnotation
plot.addAnnotation(new XYBoxAnnotation( 0.5,0.5,1.5,1.5));
plot.addAnnotation(new XYBoxAnnotation( 4.5,3.5,5.5,4.5));
plot.addAnnotation(new XYLineAnnotation( 1.5,1.5,4.5,3.5));

Related

How to draw a round rect border

I have been trying to draw a round rectangle with a shadow, looked into FloatingActionButton and tried `RoundBorder' like this:
Label labelXXX = new Label("XXX");
labelXXX.getAllStyles().setBorder(RoundBorder.create().color(ColorUtil.WHITE).shadowY(0.0f).shadowOpacity(127));
But the resulting Border looks wrong.
According to the Javadoc of com.codename1.ui.plaf.RoundBorder.shadowY(float)I expected the shadow to be located at the top of the label. Also I expected the round border to fill the labels background and the shadow to be outside of the border.
What do I need to do to create a round rect border that fills the component space and has a shadow outside the component space?
RoundBorder != RoundRectBorder. If you mean to use the latter it's a different class.
Notice that RoundBorder has a rectangle mode which you can activate using a method with the same name that will produce that result.
The shadow can be at the top when you set the Y to 1. Maybe the javadoc isn't clear. This is meant as a directional shadow so the light source is above hence the shadow would be below.

How can I draw this shape in XAML?

I would like to draw a shape that looks exactly like this, with the same gradient fill:
using only XAML.
The radius of the inner circle needs to be configurable.
The radius of the outer circle needs to be configurable.
The width of the gap at the top needs to be configurable.
The white color needs to be transparent.
What is the best way of achieving this?

Blank Areas in the Corner When Filling Brushes into Rectangles Shape

No matter how I tried, there are blank areas in the corner when I try to fill in my brush which is created in ResourceDictionary. I tired Stretch = Fill, Uniform, and UniformToFill. None of them worked.
I guess you used transform rotation in your code. If you want to fill in a rectangle area. You must use rectangle shape brush instead of diamond or any other brush in shape other than rectangle. PS: rotated rectangle brushes may fill in ellipse, but will leave some blank for other shapes like polygon.

Join a rectangle annotation with another annotation in JFreeChart?

I have used XYAnnotation and drawn a rectangle in xylinechart. Now how can I join it with another rectangle annonation?
One way would be to use an XYLineAnnotation
plot.addAnnotation(new XYBoxAnnotation( 0.5,0.5,1.5,1.5));
plot.addAnnotation(new XYBoxAnnotation( 4.5,3.5,5.5,4.5));
plot.addAnnotation(new XYLineAnnotation( 1.5,1.5,4.5,3.5));

Filling a Rectangle at different levels with Silverlight Animation?

I am very new to Silverlight. I have a question on Animation. My requirement is, a rectangle should have different levels of fill indication. More clearly say, my rectangle is half filled initially, it has to be either increased/decreased with animation.
Can anyone help me out how can I do this in Silverlight animation?
draw a 2nd rectangle inside the 1st rectangle. adjust the height of the 2nd rectangle to fill up/down.
now mark my reply as the answer.

Resources