# @domoinc/axis

> Axis - Domo Widget

Latest version **4.4.0** (published 2016-05-11) · SEE LICENSE IN LICENSE license · 0 weekly downloads

## Install

```sh
npm install @domoinc/axis
pnpm add @domoinc/axis
yarn add @domoinc/axis
bun add @domoinc/axis
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.4.0 |
| Published | 2016-05-11 |
| First published | 2016-01-27 |
| Weekly downloads | 0 |
| License | SEE LICENSE IN LICENSE |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| Author | Domo Inc. |
| Maintainers | aharris88, dallasnorton, jaxry, jgalb, jmstewart, jonathan-law, morganjohn12, nicksrandall |
| Keywords | domo, app |

## Links

- npm: https://www.npmjs.com/package/@domoinc/axis
- npm.io page: https://npm.io/package/@domoinc/axis

## Dependencies (8)

- [d3](https://npm.io/package/d3.md) ^3.5.14
- [lodash](https://npm.io/package/lodash.md) ^3.10.1
- [d3.chart](https://npm.io/package/d3.chart.md) ^0.3.0
- [@domoinc/da-theme2](https://npm.io/package/@domoinc/da-theme2.md) ^2.3.0
- [@domoinc/utilities](https://npm.io/package/@domoinc/utilities.md) ^4.2.3
- [@domoinc/base-widget](https://npm.io/package/@domoinc/base-widget.md) ^1.4.1
- [@domoinc/domo-tooltip](https://npm.io/package/@domoinc/domo-tooltip.md) ^5.1.8
- [@domoinc/summary-number](https://npm.io/package/@domoinc/summary-number.md) ^0.1.1

## Recent versions

- 4.4.0 (latest) — 2016-05-11
- 4.3.0 — 2016-03-29
- 4.2.9 — 2016-02-19
- 4.2.8 — 2016-02-17
- 4.2.7 — 2016-02-16
- 4.2.6 — 2016-02-10
- 4.2.5 — 2016-02-10
- 4.2.4 — 2016-02-09
- 4.2.3 — 2016-02-09
- 4.2.2 — 2016-02-02
- 4.2.1 — 2016-01-27
- 4.2.0 — 2016-01-27

## README

# Axis



<img src=media/widget.png height=500 width=500> 

## Configuration Options


#### addBaseline
Type: `boolean`  
Default: `false`  

Adds the baseline path above the labels

#### addGridlines
Type: `boolean`  
Default: `false`  

Flag to show vertical or horizontal grid lines.

#### addLabels
Type: `boolean`  
Default: `true`  

Flag to show the text labels on the axis

#### addTicks
Type: `boolean`  
Default: `false`  

Flag to show the tick lines on the axis.

#### addZeroline
Type: `boolean`  
Default: `false`  

Makes the gridline corresponding to the zero tick show, and have increased stroke width

#### axesLabelColor
Type: `color`  
Default: `#888`  

Color of all the labels on the axes

#### axesLabelFontFamily
Type: `string`  
Default: `Open Sans`  

Font family for axes labels

#### axesLabelLetterSpacing
Type: `number`  
Default: `0`  
Units: `px`

Letter spacing for the axes labels.

#### axesLabelSize
Type: `number`  
Default: `11`  
Units: `px`

Size of the labels

#### axesLineColor
Type: `color`  
Default: `#E3E3E3`  

Color of all lines found in the axes

#### chartName
Type: `string`  
Default: `Axis`  

Name of chart for Reporting.

#### duration
Type: `number`  
Default: `750`  
Units: `ms`

Duration of the animation

#### height
Type: `number`  
Default: `250`  
Units: `px`



#### intelligentTicks
Type: `boolean`  
Default: `true`  

Try and show an appropriate number of ticks given available space.

#### intelligentTrunc
Type: `boolean`  
Default: `true`  

Truncate the labels so they do not over lap.

#### maxLegendSpace
Type: `number`  
Default: `50`  



#### orient
Type: `string`  
Default: `bottom`  

Sets the orientation of the axis. Options: bottom, top, left, right

#### scale
Type: `scale`  
Default: `function scale(x) {
	      return output(x);
	    }`  

d3 scale object for the axis.

#### shouldValidate
Type: `boolean`  
Default: `true`  

Flag for turning off data validation

#### showTooltip
Type: `boolean`  
Default: `false`  

undefined

#### textFontFamily
Type: `string`  
Default: `Open Sans`  



#### tickFormat
Type: `function`  
Default: `function (d) {
	          return i18n.summaryNumber(d);
	        }`  

Label format function for the tick labels.

#### tickPadding
Type: `number`  
Default: `7`  

Padding between the tick line and text.

#### tickSize
Type: `number`  
Default: `5`  

Size of the tick line.

#### tickSpacing
Type: `number`  
Default: `40`  

Space between each tick.

#### tooltipBackgroundColor
Type: `color`  
Default: `#555555`  



#### tooltipTextColor
Type: `color`  
Default: `#FFFFFF`  



#### tooltipTextSize
Type: `number`  
Default: `14`  
Units: `px`

undefined

#### updateSizeableConfigs
Type: `boolean`  
Default: `true`  

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

#### width
Type: `number`  
Default: `250`  
Units: `px`



#### x
Type: `number`  
Default: `0`  

The x coordinate for the axis.

#### y
Type: `number`  
Default: `0`  

The y coordinate for the axis.

## Data Definition


## Events


#### Dispatch Events

#### External Events


## Example

```js  
var aHeight = 400;
var aWidth = 400;

// var ascale = d3.scale.ordinal().domain(d3.range(0, 1000)).rangePoints([0,aWidth], 0);
// var ascale = d3.scale.linear().domain([-1000, 1000]).range([0, aWidth]);
var ascale = d3.time.scale().domain([new Date('2014-01-11'), new Date('2014-12-29')]).range([0,500]);
// var ascale = d3.scale.ordinal().domain(['A','B','C']).rangeRoundBands([0, aWidth], 0.25);

//Initialze the widget
var chart = d3.select("#vis")
  .append("svg")
  .attr('width', 500)
  .attr('height', 500)
  .append("g")
  .attr("transform", "translate(50,250)")
  .chart("Axis")
  .c({
    'width': aWidth,
    'height': aHeight,
    'scale': ascale,

    //'addGridlines': true,
    // 'addGridlines': false,
    //'addZeroline': true,
    // 'addZeroline': false,
    //'addTicks': true,
    // 'addTicks': false,

    //'addBaseline': true,
    // 'addBaseline': false,
    //'tickSize': 5,

    // 'orient': 'top',
    'orient': 'bottom',
    // 'orient': 'top',
    // 'orient': 'right',

    showTooltip: true,
  })


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


// var orient = 'top';
// var orient = 'bottom';
// var orient = 'left';
var orient = 'right';

// setTimeout(function() {
//   chart.c({
//     'orient': orient,
//     'addGridlines': false,
//     'addZeroline': true,
//     'addTicks': true,
//   })
//   chart.draw();
// }, 500)

// setTimeout(function() {
//   chart.c({
//     'orient': orient,
//     'addGridlines': true,
//     'addZeroline': false,
//     'addTicks': true,
//   })
//   chart.draw();
// }, 500)

// setTimeout(function() {
//   chart.c({
//     'orient': orient,
//     'addGridlines': true,
//     'addZeroline': true,
//     'addTicks': false,
//   })
//   chart.draw();
// }, 500)

// setTimeout(function() {
//   chart.c({
//     'orient': orient,
//     'addGridlines': false,
//     'addZeroline': false,
//     'addTicks': true,
//   })
//   chart.draw();
// }, 500)

// setTimeout(function() {
//   chart.c({
//     'orient': orient,
//     'addGridlines': true,
//     'addZeroline': false,
//     'addTicks': false,
//   })
//   chart.draw();
// }, 500)

// setTimeout(function() {
//   chart.c({
//     'orient': orient,
//     'addGridlines': false,
//     'addZeroline': true,
//     'addTicks': false,
//   })
//   chart.draw();
// }, 500)

// setTimeout(function() {
//   chart.c({
//     'orient': orient,
//     'addGridlines': false,
//     'addZeroline': false,
//     'addTicks': false,
//   })
//   chart.draw();
// }, 500)

```

---
_Source: https://npm.io/package/@domoinc/axis · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
