This article is one that was ported over from Internoetics. The imperfect nature of the function is preserved.
■ ■ ■
This article supports a number of color-related functions on our website. The primary purpose of the example is to represent RGB color values in a Google Pie Graph.
The Result
The shortcode of [hexgraph hex="#ffcc33"]
returns the following chart:
A 3D chart may be returned with [hexgraph hex="#bcbcbc" td="1"]
.
WordPress Shortcode
Copy and paste the WordPress function into your theme's functions.php
file or, if you sensibly have one installed, your custom functions plugin.
If you require shortcode to work in a sidebar widget, you'll have to enable the functionality with a filter. If you're using our custom functions plugin, you'll have that feature enabled by default.
Shortcode Attributes
hex
width
height
td
td="1"
.Considerations
- Review Google Chart options here .
- See also: "Using Google Graphs To Draw PHP, MySQL, and WP Version Usage" (article)
- In the original version of this post we provided a CSS horizontal graph to represent RGB values. The purpose of the graph is a little useless so it was omitted. Another post is scheduled that deals with CSS Progress Bars.
- Find other color related articles on our blog