Luka
Luka

Reputation: 1801

Chart plotting algorithms?

I am looking to plot charts using the PHP image create, what kind of algorithms are used to transform my terrible chart:

Into something better like:

and

How can I make the lines of my chart smooth and pretty like the 2 charts above?

edit: I don't want to use any library, I am trying to do this myself.

Upvotes: 0

Views: 125

Answers (2)

Jasper
Jasper

Reputation: 3947

For "smoothing the lines", you have to refer to external sources about antialiasing (or let PHP do this part, see manual)

Then, you need to have an idea how exactly your graph should look like:

  • axis (scaling, labeling, ...)
  • grid (with differend line width for major and minor segments?)
  • representation of data (points, straight lines, smooth lines [getting rather hard again here])
  • description

And I think each point could be a quite well suited coding exercise. But without more specific questions, I can't help you better.

Upvotes: 1

Tomazi
Tomazi

Reputation: 791

Try this best think, I use these charts all the time

http://www.highcharts.com

Upvotes: 2

Related Questions