As it stands, the Visify.js jQuery plug-in provided on this page is meant to create stacked bar charts. It enables you to create classes to convert the data to a human readable format, and pass it to the plug-in. It can be styled via CSS and accepts some options for your customization. It can handle multiple bar segments if multiple data values are passed per object, creating stacked bars. It uses the <canvas> tag to draw the graph. If the canvas tag is not supported (Lookin' at you IE), excanvas.js will be included.

USING THE PLUGIN: Visify expects three arguments, with an optional fourth argument for the options hash.

$('#myBlockElement').visify(data, subjectKey, dataKeys, optionsHash);

THE DATA: All of the data passed to the plug-in must be in byte form. It will be converted to KB, MB, GB, TB, PB, or XB appropriately. The data must be an array of Hashes. Each hash should have the same keys and a subject/name for each data set. Add more keys for more bar segments.

THE SUBJECT AND DATA KEYS: The subject key should be a JavaScript string of the key representing your dataset's name/title/subject. The data keys should be a JavaScript Array of strings representing the keys of your data values.

subjectKey = "Name";
dataKeys = ["Numbers In", "Numbers Out"]

THE OPTIONS HASH: The options hash accepts a number of options to customize your bar chart. It is not required.

This is the width of each bar in pixels (automatically calculated if no width is specified)

barSpacing

Integer

This is the space between each bar in pixels

backgroundColor

String

This is the background color you want the graph to have. It inherits the containing element's CSS valueby default

fontSize

Integer

This is the size of the font used in the graph. It inherits the containing element's CSS value by default

fontFamily

String

This is the font family used in the graph. It inherits the containing element's CSS value by default

colors

Array

This is an Array of Hash value RGB colors to use for the bar colors. Make sure to pass at least as many colors as you have bar segments

graphLines

Integer

This is the number of horizontal graph lines you want to see

rounder

Integer

This is the number minimum number of decimal places you want to see, excluding zeros after the decimal. Add a zero for each decimal place (1 => 2, 10 => 2.1, 100 => 2.12, etc)

converter

Class

This is the name of the Custom Converter class you want to modify the values by (treated like normal integers if not specified)

resizeThrottle

Integer

Represents the millisecond value to use to throttle the resize event for browsers that fire continuous resize messages.

BYTE EXAMPLE

You can pass a custom class to convert your values into a more human readable format. An example of this is byte size data. You could represent the data in pure bytes, but humans have a more difficult time relating bytes to today's measurement units. For example, some people might not how to quantify 1024KB, but they may be able to relate to 1MB. Simply include the ByteMe class, and pass it as an option.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.