D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
jkeohan
Full window
Github gist
D3-Legends Examples
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <script type="text/javascript" src="https://d3js.org/d3.v3.js"></script> <link rel="stylesheet" href="legends.css"> <style type="text/css"></style> </head> <body> <div class="legend1"> <h3>HTML Vertical Legend</h3> <div class="legend1"> <p class="country-name"><span class="key-dot queens"></span>Queens</p> </div> <div class="legend1"> <p class="country-name"><span class="key-dot kings"></span>Kings</p> </div> <div class="legend1"> <p class="country-name"><span class="key-dot bronx"></span>Bronx</p> </div> </div> <div id="legend2"> <h3>HTML Horizontal Legend</h3> <div class="legend2"> <p class="country-name"><span class="key-dot queens"></span>Queens</p> </div> <div class="legend2"> <p class="country-name"><span class="key-dot kings"></span>Kings</p> </div> <div class="legend2"> <p class="country-name"><span class="key-dot bronx"></span>Bronx</p> </div> </div> <div class="legend3"> <h3>D3 Vertical Legend</h3> <div class="legend3"></div> </div> <div class="legend4"> <h3>D3 Horizonal Legend Using 'g' Elements</h3> <div class="legend4"></div> </div> <div class="legend5"> <h3>D3 Horizonal Legend Using 'key-dot' CSS</h3> </div> <br> <div class="legend6"> <h3>D3 Horizonal Legend Using Div's and d3.html()</h3> </div> <br> <div class="legend7"> <h3>D3 Reusable Legend</h3> </div> <script type="text/javascript" src="legends.js"></script> </body> </html>
https://d3js.org/d3.v3.js