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

Discussion about JFreeChart related to stockmarket charts.
Locked
Dymytry
Posts: 4
Joined: Fri Jan 22, 2010 2:36 pm
antibot: No, of course not.

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

Post by Dymytry » Fri Jan 22, 2010 2:52 pm

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?

skunk
Posts: 1087
Joined: Thu Jun 02, 2005 10:14 pm
Location: Brisbane, Australia

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

Post by skunk » Fri Jan 22, 2010 3:57 pm

Add one of these to your plot for each "trade"

Code: Select all

org.jfree.chart.annotations.XYPointerAnnotation

Dymytry
Posts: 4
Joined: Fri Jan 22, 2010 2:36 pm
antibot: No, of course not.

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

Post by Dymytry » Fri Jan 22, 2010 4:35 pm

Thank you, skunk, but as far as I understand Pointer classes are implemented only for XY plots and Category plots.

skunk
Posts: 1087
Joined: Thu Jun 02, 2005 10:14 pm
Location: Brisbane, Australia

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

Post by skunk » Fri Jan 22, 2010 5:08 pm

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?

Dymytry
Posts: 4
Joined: Fri Jan 22, 2010 2:36 pm
antibot: No, of course not.

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

Post by Dymytry » Thu Jan 28, 2010 2:40 pm

Thank you, skunk!

It works.

Locked