I'm trying to visualize stock (share) prices

« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by James Parsons on 11th January 2013

Thank you for responding so quickly to my previous support question.

I am looking to purchase graphing software for my website in the near future. Right now I am still comparing competing graphing toolkits to see which one best fits my needs. I originally had been leaning toward JpGraph, but found it has architectural issues that prevent it from doing what I need it to do. I have found a few bugs in RGraph, but the way RGraph is designed makes them easy to fix. Most other graphing packages out there use Flash, and I would like to avoid Flash if possible. I agree with the late Steve Jobs about the problems with Flash, and it appears that now even Adobe agrees. So, for my needs RGraph is the current frontrunner.

What I need to do is graph stock prices. In order to graph stock prices, I need to be able to ignore days and times when the stock market is not open. For example, professional stock charts do not have gaps during weekends and holidays. Instead, days when the stock market is closed are simply ignored. Also, most stock exchanges are only open for about 6.5 hours per day, so for graphing a week's worth of intraday prices I need the ability to graph one day's 6.5-hour block and then the next day's 6.5-hour block with no gap in between. These are areas where JpGraph failed me but RGraph appears to do well.

Another issue with graphing stock prices is that not all months have the same number of trading days. February is shorter than January, for example. On the x-axis I need the ability to lay out months of different lengths without having the weekend gaps mentioned in the previous paragraph. Also, if I want to show weekly prices over several years, I have to deal with the fact that most years have 52 "weeks" (Mondays) and some have 53. It seems that RGraph can handle this well.

There are two areas where RGraph could use some improvement. The first is that your stockplots require five data values (open, high, low, close, and average), but U.S. data providers only publish four data values (open, high, low, and close). This requires me to either fudge a fifth value or hide the "average" line. What I really need is a stockplock (i.e. candlestick) that takes only four data values (open, high, low, and close) and then a single color (rather than two) for the body of the candlestick (white for up or red for down).

The second area where RGraph could improve is by adding an OHLC (open, high, low, close) graph. A typical OHLC graph has a very short horizontal line for the opening price, a very short horizontal line for the closing price, and a vertical line between them that extends from the low to the high price. For an example of an OHLC graph see tinyurl.com/bfkgl4s which displays an OHLC graph for Microsoft (MSFT) and a line graph for Google (GOOG). None of the competing graphing toolkits I've seen have this capability, but it is a type of graph that would be nice to have. The benefit of an OHLC graph over a candlestick graph is that you can fit more data into the same amount of horizontal space.

I just thought I'd share with you my needs regarding graphing stock prices, because anyone graphing stock prices will have the same basic needs.
Posted by RGraph support on 12th January 2013
Hi James,

What I can do if you decide to opt for RGraph is separate the candlestick Scatter chart into a candlestick and also an OHLC chart.

If you're interested, there's another demonstration of using the Scatter to show financial data here:


This again uses the Scatter chart - not the Line chart.

Richard, RGraph Support

Add a reply

« Back to message list