Message Boards Message Boards

1
|
3750 Views
|
3 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Overlay on TradingChart[ ]

I am trying to overlay a line plot on a TradingChart. I have tried a number of things but can't achieve what I want. What I have done is better explained in the attached notebook. Thanks

POSTED BY: Henrick Jeanty
3 Replies

Hello Rohit,

Now, that would make sense. I hadn't thought of that.

Thanks Henrick

POSTED BY: Henrick Jeanty

I will reply to my own question. As I was looking at some other posts regarding overlaying graphics I saw the Prolog option and tried the following which worked (see attached notebook).

I still don't understand why just changing Epilog to Prolog made it work. With Epilog I could not see my line segments. With Prolog the line segments appeared.

POSTED BY: Henrick Jeanty
Posted 2 years ago

TradingChart is a composite of two Graphics. Looks like Epilog is added to the second one (volume chart) and Prolog is added to the first one.

scaledPath = MapAt[2*10^5 # &, currentPath, {All, 2}];
TradingChart[data[[1 ;; 32]],
 Epilog -> {Thickness[0.0075], Black, Line[scaledPath], PointSize[Medium], Red, Point[scaledPath]},
 Prolog -> {Thickness[0.0075], Black, Line[currentPath], PointSize[Medium], Red, Point[currentPath]}]

enter image description here

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract