Stretching Single-Pixel Images PHP

The following technique takes advantage of the behavior of most browsers with the width and height properties of the image tag. It does not require the GD extension, because it doesn't actually manipulate an image. It relies on the browser to stretch an image to match the width and height specified in the IMG tag. This allows you to stretch a singlepixel image into a large bar.

An HTML table is used to line up graph labels with bars. The largest data element will fill 100 percent of the graph width, which is specified by the graphWidthMax variable. Each element is pulled from the data array and used to scale graphWidthMax. This produces a horizontally oriented bar graph, but the samemethod can make a vertical graph, too.

Bar Graph Using Stretched Images

Bar Graph Using Stretched Images

Bar Graph Using Stretched Images



Face Book Twitter Google Plus Instagram Youtube Linkedin Myspace Pinterest Soundcloud Wikipedia

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

PHP Topics