-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Axis Background Grid #1
Comments
If you achieve the above, then you could provide an option boolean to slightly reduce the opacity of the bars (use the cross-platform route on that) so that the grid lines underneath would show through. Then, to make this even killer, use cross-platform box-shadow (another option boolean) to add a slight shadow behind the bars. |
Here is an example:
|
I was able to create this into an addGrid() method on your object by implementing the following code at the bottom of jqBarGraph.1.1.min.js. To call it, simply tack on ".addGrid()" after doing .jqBarGraph({your-options-go-here}). Note that it just creates a 10px grid. However, I could have made it swap the inline data image based on options passed to addGrid(), providing a 20px grid, and so on. Also, I could adjust the following code so that it doesn't do anything on IE if less than IE8.
|
Can you suggest a way to add an axis background grid behind the bars?
Here's a simple strategy I was thinking of...
Do you know how you can generate a GIF with inline data URLs? Documentation is here:
http://www.websiteoptimization.com/speed/tweak/inline-images/
Therefore, you could create a repeating image pattern and place it behind the chart's main DIV. You could then provide an option where one selects the pixel height of the lines, or use the word 'auto' to have it decide the most optimal pixel height. From there, it would use the inline data URL technique to create a GIF and repeat it behind the chart.
The only catch is that this won't work with IE6 and IE7, so you'd have to caveat and say that this feature is not available for those. Works on IE8+, however. (And, of course, works in all browsers besides IE since the days of IE7's release.)
The text was updated successfully, but these errors were encountered: