My understanding of your comments is that to have two colours for a
single series of data represented in OHLC bars could be done, but would
mess with the legend colouring. In other words, GD::Graph is capable of
graphing multiple data series on the same chart and quite sensibly
wishes one colour per data series.
In this case, it isn't a bug its a feature. Candlesticks are a different
story. If the change of bar (ie whether close <> open) is important one
can use candlesticks, if not or for multiple series one can use bars.
Unsure of your question re interface. Interface to your modules to do
things such as select colour and other features of the graph to be
produced, or interface for the whole project?
If the former, I'm happy to edit the source to choose the colours etc or
pass arguments via the command line (as your example perl script is
called by other scripts etc). I am not fussy about having different
colours etc and will happily pick a default setting and stick to it.
If what interface for the entire application, the goal is not to
recreate an entire charting package, although perhaps that is what will
be ultimately required. The problem which I am trying to solve is the
limited intraday historical data provided by any off the shelf software
package.
What I have now is a series of scripts which do the following
-pull data from the exchange (working automation but still a manual
process done weekly - CME has FTP access)
-sort into a flat file database by exchange and instrument
-parse trade data to 1 minute OHLCV and seperate according to trade date
-build various interval chart OHLCV data from the 1 minute data
-create a GD::Graph::Candlestick for each OHLC file (no display volume
data yet - that is to do)
As for the interface, browsing the images in a flat file structure is
all I have so far. This is dumped in a web facing folder and one uses
the following URL
http://host/database/EXCHANGE_INSTRUMENT_YYYYMMDD_INTERVAL.png
On Thu, 2012-08-16 at 07:11 -0400, Paul Miller via RT wrote:
Show quoted text> <URL:
https://rt.cpan.org/Ticket/Display.html?id=78988 >
>
>
> On Wed Aug 15 18:00:52 2012, tfischer@bern.swissdatacenters.ch wrote:
> > *add colorings for ohlc*
>
> I'm looking at the internals for GD::Graph::ohlc, which uses
> GD::Graph::axestype as its base. When a data point comes in, it's
> really up to that module to select a color for the node.
>
> It'd be easy enough to override that behavior and use a different color
> by copying what candlesticks does when it fills the box rather than
> leaving it empty. But it's not clear what I'm supposed to do about the
> legend then. The legend automatically shows what color is for what.
>
> It's a dreadful loose end. Mainly GD::Graph expects each independent
> variable to be exactly one color. I'm not sure there's a solution for
> this, so I'm just going to ignore it.
>
> Another thing though is that it's probably desirable that each data set
> should have its own color-pair.
>
> What kind of interface are you picturing? I've imagined something
> myself, I want to see if it lines up.
>
>
>