By using the “axis” Object key passed with a boolean value to .x() or .y() will toggle the zero line of either axis on or off. Additional parameters for styling are “color”, “font”, and “rendering”.
Featured on D3plus.org.
| <!doctype html> | |
| <meta charset="utf-8"> | |
| <script src="http://www.d3plus.org/js/d3.js"></script> | |
| <script src="http://www.d3plus.org/js/d3plus.js"></script> | |
| <div id="viz"></div> | |
| <script> |
By using the “axis” Object key passed with a boolean value to .x() or .y() will toggle the zero line of either axis on or off. Additional parameters for styling are “color”, “font”, and “rendering”.
Featured on D3plus.org.
Passing the Object key “grid” to either .x() or .y() methods will toggle the gridlines on or off. The key will take a boolean value as well as “color” or “rendering” objects for formatting parameters.
Featured on D3plus.org.
If you pass a “range” Object key to either the .x() or .y() methods in a D3plus visualization you can set a static range for either axis. The value this key takes is an Array with the min and maximum values for the range.
Featured on D3plus.org.
By passing a “padding” Object with a number value to either the .x or .y() method will allow you to control the space between data points. If the number is less than 1, it is used as a percentage of the available space. If the number is greater than 1, it is used as a set pixel value (unless there isn’t sufficient space, then it will revert to the default)
Featured on D3plus.org.
You can format the ticks on either the x or the y axis of a D3plus visualization by passing a key of “ticks” to either the .x() or .y() methods. This key will accept keys of “width”, “color”, “font”, “rendering”, and “size”.
Featured on D3plus.org.
To override the labels of your x or y axes pass an object key of “labels” to the .x() or .y() method. Further formatting control possible by passing any of the additional supported object parameters: “color”, “decoration”, “family”, “padding”, “size”, “transform”, and “weight”.
Featured on D3plus.org.
If you'd like to show a data-driven subtitle in your tooltips, you can pass a “sub” key to the .tooltip( ) method, where the value is the key in each data point that contains the subtitle.
Featured on D3plus.org.
Use the “share” Object key with .tooltip() method to toggle the share percentage from showing in the tooltip info. This key will accept a boolean value.
Featured on D3plus.org.
Use the “opacity” keyed Object with the .edges() method to set the opacity of the connections in a network visualization.
Featured on D3plus.org.