Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 1189 Vote(s) - 3.49 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is there a C-callable library that can generate PNG from raw data?

#1
I want to visualize a table of stock-price data as candlesticks; and as trend lines.

I'm looking for a C-callable library that will take as input raw price data and come out with a graphic file -- a picture -- that I can store someplace and then name in the HTML page that my CGI generates.

I suppose that there are many candidates. I find only three possibilities so far this morning:

1. the boost graphics interface language
2. imagemagick
3. gnuplot
4. I can also imagine drawing directly on the HTML5 canvas. I know less than nothing about that approach.

Can you recommend an approach/library that's straightforward, flexible, rich, and powerful?
Reply

#2
The [GD][1] library is useful for creating dynamic PNGs.

It is written in C, has good language bindings for PHP, Perl and many other languages, and there are some command line tools for shell programming.

See this question for C programming with GD:

[To see links please register here]


A Perl library on top of GD that does what you want is here:

[To see links please register here]


The code sample in there is easy to read, even if you haven't tried perl yet.
Then use it as a plain old CGI Script. Or try something more fancy.

Examples:

![Candlestick][2]

![Trendline][3]


[1]:

[To see links please register here]

[2]:

[3]:
Reply

#3
Assuming you are pulling data from an sql database

[To see links please register here]

allows generating many types of chart to .png straight from the command line. It's java so cross platform and standalone in one jar. Free version has watermarks, but it's free for students and open source projects.

Candle stick would look like this:
[![enter image description here][1]][1]
[![enter image description here][2]][2]


[1]:

[2]:
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through