2.0.4 • Published 8 years ago

@domoinc/ca-time-summary-number v2.0.4

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
-
Last release
8 years ago

CATimeSummaryNumber

Configuration Options

animationDuration

Type: number
Default: 1000
Units: px

Duration of time for the animation

chartName

Type: string
Default: "CATimeSummaryNumber"

Name of chart for reporting

height

Type: number
Default: 115
Units: px

Height of the chart

isOnMobile

Type: boolean
Default: false

If true, it signals to the widget that it is running on a mobile device. Should be called before draw and then NEVER changed.

labelTextSize

Type: number
Default: 35
Units: px

General size in pixels for label text

labelUnits

Type: select
Default: {"name":"Days","value":"DAYS"}

Text for the top label

numberTextSize

Type: number
Default: 80
Units: px

General size in pixels for label text

shouldValidate

Type: boolean
Default: true

Flag for turning off data validation

textColor

Type: color
Default: "#f68c35"

Color for any text

textFontFamily

Type: string
Default: "Open Sans"

Font family for any text

topLabel

Type: string
Default: "AVG TIME TO CLOSE"

Text for the bottom label

updateSizeableConfigs

Type: boolean
Default: true

Flag for turning off the mimic of illustrator's scale functionality

width

Type: number
Default: 283
Units: px

Width of the chart

Data Definition

Label

Type: string

Default validate:

function validate(d) {
	          return this.accessor(d) !== undefined;
	        }

Default accessor:

function accessor(line) {
	          return line[0] === undefined ? undefined : String(line[0]);
	        }

Value

Type: number

Default validate:

function validate(d) {
	          return !isNaN(this.accessor(d)) && this.accessor(d) >= 0;
	        }

Default accessor:

function accessor(line) {
	          return parseFloat(line[1]);
	        }

Events

Dispatch Events

External Events

Example

//Setup some fake data
var data = [
  ['Sales', 45]
];

var chart = d3.select('#vis svg')
  .append('g')
  .attr('transform', 'translate(109,204)')
  .chart('CATimeSummaryNumber')

//Render the chart with data
chart._notifier.showMessage(true);
chart.draw(data);