Skip to content

This is a gauge styled graphic based in Tomer Doron’s with a few modifications and improvements.

License

Notifications You must be signed in to change notification settings

renanbrando/Google-Gauge-D3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Google-Gauge-D3

This is a graphic gauge styled based in Tomer Doron’s with a few modifications and improvements. It is also an implementation of Google's gauge chart.

Usage

alt Gauge Chart

To use this gauge you must have gauge.js and d3 library imported to your application. An example can be found in index.html.

Config Example

let config = {
  size: 200, // size of gauge
  label: label, // label to displayed
  min: min, // minimum value to be displayed
  max: max, // maximum value to be displayed
  minorTicks: 5, // interval between values
  // zones to filled with colors, intervals must contain from and to
  greenZones: {
    from: 0,
    to: 50
  },
  yellowZones: {
    from: 50,
    to: 90
  },
  redZones: {
    from: 90,
    to: 100
  }
}				

Usage Example

var gauge = new Gauge( "GaugeContainer", config); // where GaugeContainer is the id of the div in html
gauge.render();
gauge.redraw(50, 5000, "%"); // 50 is the gauge displayed value, 5000 is the transition time and "%" is the unit to be displayed with the label (optional)

About

This is a gauge styled graphic based in Tomer Doron’s with a few modifications and improvements.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published