Skip to content
This repository has been archived by the owner on Jan 29, 2021. It is now read-only.

Commit

Permalink
Fix: fixed Y & Y2 ticks misalignment (fixes #209) (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdadn authored Jun 11, 2020
1 parent def2330 commit c6b8930
Show file tree
Hide file tree
Showing 6 changed files with 22,895 additions and 22,250 deletions.
33 changes: 17 additions & 16 deletions docs/core/Graph.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,23 @@ Graph is a set of graphs that share a common set of base visualization structure

### Optional

| Property Name | Expected | Default | Description |
| ---------------- | -------- | --------------------------------------------- | ------------------------------------------------------------------------------------ |
| bindLegendTo | string | null | If DOM id provided, binds legend into that container (Example: `"#legendContainer"`) |
| locale | object | LOCALE.en_US | Locale object for X-Axis tick values |
| dimension | object | {} | Refer [Dimension](#dimension) |
| throttle | number | (1000/60) => time in ms | Delay between resize of a browser window |
| showLabel | boolean | true | Toggle to show axes labels |
| showLegend | boolean | true | Toggle to show graph legend |
| showShapes | boolean | true | Toggle to show shapes in the line graph |
| showVGrid | boolean | true | Toggle to show vertical grid |
| showHGrid | boolean | true | Toggle to show horizontal grid |
| dateline | array | [] | Refer [Dateline](../helpers/Dateline.md) |
| pan | object | {} | Refer [Panning](../controls/Panning.md) |
| padding | object | `{ top: 10, bottom: 5, left: 30, right: 50 }` | Refer [Padding](../controls/Padding.md) |
| showNoDataText | boolean | true | Toggle to show no data text |
| allowCalibration | boolean | true | Toggle to allow calibration to adjust the y axis |
| Property Name | Expected | Default | Description |
| ---------------- | -------- | --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| allowCalibration | boolean | true | Toggle to allow calibration to adjust the y axis |
| bindLegendTo | string | null | If DOM id provided, binds legend into that container (Example: `"#legendContainer"`) |
| dateline | array | [] | Refer [Dateline](../helpers/Dateline.md) |
| dimension | object | {} | Refer [Dimension](#dimension) |
| locale | object | LOCALE.en_US | Locale object for X-Axis tick values |
| pan | object | {} | Refer [Panning](../controls/Panning.md) |
| padding | object | `{ top: 10, bottom: 5, left: 30, right: 50 }` | Refer [Padding](../controls/Padding.md) |
| showHGrid | boolean | true | Toggle to show horizontal grid |
| showLabel | boolean | true | Toggle to show axes labels |
| showLegend | boolean | true | Toggle to show graph legend |
| showNoDataText | boolean | true | Toggle to show no data text |
| showShapes | boolean | true | Toggle to show shapes in the line graph |
| showVGrid | boolean | true | Toggle to show vertical grid |
| ticksCount | number | 3 | Number of ticks to show on the vertical axes, excluding the upper and lower limits, if not provided, the number of ticks will be calculated automatically depending on the Y & Y2 range |
| throttle | number | (1000/60) => time in ms | Delay between resize of a browser window |

## Dimension

Expand Down
7 changes: 7 additions & 0 deletions docs/helpers/Ticks.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Ticks and Grid lines representing Axes values.

- [Ticks](#ticks)
- [Overview](#overview)
- [JSON Properties](#json-properties)
- [Required](#required)
- [Optional](#optional)
Expand All @@ -12,6 +13,12 @@ Ticks and Grid lines representing Axes values.
- [Datetime Buckets example](#datetime-buckets-example)
- [Use Case](#use-case)

## Overview

Ticks are labels on the Axes to represent axis values. These values are determined by the upper and lower limits of its axis. If any datapoints on the graph exceed the upper or lower limits, the axis range will adjust accordingly and the tick labels will be updated.

If there is only 1 axis in the graph, the tick intervals are calculated automatically using the d3.js `nice` function. If the Y2 axis is visible, the tick intervals are set based on the range of the Y & Y2 axes. This can be overridden to be custom using the `ticksCount` property in the graph configuration object. Acceptable values for `ticksCount` are `0 - 19`. Invalid values will result in `ticksCount` being ignored and going back to the default behavior.

## JSON Properties

#### Required
Expand Down
Loading

0 comments on commit c6b8930

Please sign in to comment.