Page 1 of 1

How can I create a chart with arrows, pointing to trades?

Posted: Fri Jan 22, 2010 2:52 pm
by Dymytry
Hello everyone!

My task is to create a financial candlestick chart and indicate the points in that chart where trades have been made. I can see two possible solutions:

1) To draw arrows somehow. How can I place an array of arrows to my chart?

2) To draw something instead of arrows. For example, I can create second dataset (additional to time-price chart) that will have the following properties: (Time) = trade time, (Open=Close=High=Low) = trade price. Then I should create two series and plot them in one chart. The problem is that I cannot create series in DefaultOHLCDataset and DefaultHighLowDataset classes using class.add() method. There is no such a method. How can I accomplish this task?

Re: How can I create a chart with arrows, pointing to trades?

Posted: Fri Jan 22, 2010 3:57 pm
by skunk
Add one of these to your plot for each "trade"

Code: Select all

org.jfree.chart.annotations.XYPointerAnnotation

Re: How can I create a chart with arrows, pointing to trades?

Posted: Fri Jan 22, 2010 4:35 pm
by Dymytry
Thank you, skunk, but as far as I understand Pointer classes are implemented only for XY plots and Category plots.

Re: How can I create a chart with arrows, pointing to trades?

Posted: Fri Jan 22, 2010 5:08 pm
by skunk
Dymytry wrote:Thank you, skunk, but as far as I understand Pointer classes are implemented only for XY plots and Category plots.
There are other types of plot?

Re: How can I create a chart with arrows, pointing to trades?

Posted: Thu Jan 28, 2010 2:40 pm
by Dymytry
Thank you, skunk!

It works.