I think it would make a good addition to PHPlot, however each data point requires 4 values and we don't have anything like that now. This would mean introducing a new data type, which makes it a more extensive change.
On the other hand, perhaps we can do this with existing data-data and text-data data types, by using 4 Y values for each X and limiting to one actual data set per plot. This might work, because I don't think a candlestick plot with more than 1 data set would be unreadable. So the data array would simply be rows of (label, X, Yopen, YHigh, YLow, YClose) for example.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In progress: 3 new plot types. A basic OHLC (vertical line shows the range,
with tick marks for open and close); candlestick (using filled body for closing
down, unfilled for closing up); and candlestick-filled (using filled body
in both cases, data colors need to be set). Each row will use 4 Y values as
described in the previous comment. Data colors and line thickness can be
controlled. Candle/tick width is automatically calculated, but there are
class variables that can be set to adjust this (similar to bar widths).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This has been implemented and committed to CVS. It will be in the next release. There are 3 new plot types: ohlc, candlesticks, and candlesticks2 (at the last minute I changed 'candlesticks-filled' to 'candlesticks2'; not really happy about it but the first name was too long and the dash was annoying).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
To clarify, OHLC = Candlestick, as shown here: http://en.wikipedia.org/wiki/Candlestick_chart
Is this a good reference for what you are requesting?
I think it would make a good addition to PHPlot, however each data point requires 4 values and we don't have anything like that now. This would mean introducing a new data type, which makes it a more extensive change.
On the other hand, perhaps we can do this with existing data-data and text-data data types, by using 4 Y values for each X and limiting to one actual data set per plot. This might work, because I don't think a candlestick plot with more than 1 data set would be unreadable. So the data array would simply be rows of (label, X, Yopen, YHigh, YLow, YClose) for example.
Correction: OHLC is an overall term; candlestick is one type of OHLC plot.
Here is another: http://en.wikipedia.org/wiki/Open-high-low-close_chart
In progress: 3 new plot types. A basic OHLC (vertical line shows the range,
with tick marks for open and close); candlestick (using filled body for closing
down, unfilled for closing up); and candlestick-filled (using filled body
in both cases, data colors need to be set). Each row will use 4 Y values as
described in the previous comment. Data colors and line thickness can be
controlled. Candle/tick width is automatically calculated, but there are
class variables that can be set to adjust this (similar to bar widths).
Samples from under-development PHPlot with OHLC plot types:
http://phplot.sourceforge.net/samples/ohlc.php
This has been implemented and committed to CVS. It will be in the next release. There are 3 new plot types: ohlc, candlesticks, and candlesticks2 (at the last minute I changed 'candlesticks-filled' to 'candlesticks2'; not really happy about it but the first name was too long and the dash was annoying).
Implemented in PHPlot-5.3.0