How to draw a picture (graph) with minimum size using PHP GD library

Posted on 2005-03-08
Medium Priority
Last Modified: 2012-05-05
Dear all

I am using 3rd parties library, ChartDirector, http://www.advsofteng.com/ to draw my share market graph statistics (using PHP and mysql as DB)

I need to draw an 10 hours graph (picture) with 5 sec interval, but the picture size is simple too big, > 20M and still growing

I am targeting for ~ 1M picture size with as many data as above

Appreciate your comment!

Question by:garytan
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 49

Expert Comment

ID: 13484199
What happens when you use image_jpeg for output with a high compression?

Or isn't that an option due to needed quality?

Author Comment

ID: 13484566
ya, quality required too
LVL 25

Accepted Solution

Marcus Bointon earned 500 total points
ID: 13487325
It just sounds like you're just drawing too big a graph - a 20Mb image is going to be about 3000 pixels wide! The quantity of data you're drawing should have little to do with the size of the output graph (unless image resolution is limiting the data you're drawing), so I really don't see why it should be a problem. Typically graphs use lots of flat colours, so JPEG is probably not a good compression scheme to use - PNG should give much cleaner results.

Alternatively, just use different graph drawing software such as:


I use jpgraph all the time and my graphs rarely exceed 30k, no matter how many points I'm drawing.

Assisted Solution

a2liter earned 500 total points
ID: 13488489
I have been using this application for years and it is very flexable and easy to use. it can create just about anykind of graph or chart you want on the fly. I mostly use it with data stored ina mysql DB to generate graphs from datasets chosen by users via web interface. It costs a little, but I think it is well worth the investment if you are doing a lot of graphical analysis of data and need to do it on the fly.


LVL 11

Expert Comment

ID: 15639996
No comment has been added to this question in more than 21 days, so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:
Split between Squinky and a2liter

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

- Neester -
EE Cleanup Volunteer

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question