Skip to content
Ali Almossawi edited this page Jul 7, 2016 · 38 revisions

HomeList of OptionsAxes

Axes Options

# axes_not_compact

Determines whether to show compact or non-compact axes. Non-compact axes cover the length of the plot area (left) whereas compact axes cover the length of the auto-generated ticks (right). This option is available as of v2.7.

axes_not_compact

Possible values: {true, false}

# european_clock

Determines whether to show axis labels using a 24-hour clock, rather than AM/PM. This option is available as of v2.7.

Possible values: {false, true}

# inflator

A multiplier for inflating max_x and max_y.

Possible values: {10/9, number}

# max_x

The maximum x-value. By default, the value is inferred from the dataset.

Possible values: {null, number}

# max_y

The maximum y-value. By default, the value is inferred from the dataset.

Possible values: {null, number}

# min_x

The minimum x-value. By default, the value is inferred from the dataset.

Possible values: {null, number}

# min_y

The minimum y-value. By default, the value is inferred from the dataset, though if the minimum y-value greater than 0, it is set to 0.

Possible values: {null, number}

# min_y_from_data

If set, y-axis will start at the data's minimum value rather than at 0.

Possible values: {false, true}

# show_year_markers

Determines whether to show the year markers along the x-axis. Year markers are vertical lines that allow you to visually segment a time-series by year. Available as of v2.3.

Possible values: {false, true}

# show_years

Deprecatad as of v2.1. Please refer to show_secondary_x_label.

Determines whether to show the year on the x-axis below the first month of the year's label.

Possible values: {true, false}

# show_secondary_x_label

Determines whether to show the year, or another unit of time in the case of smaller series, on the x-axis below the x-axis labels.

Possible values: {true, false}

# small_text

Deprecatad as of v2.8. Coerces small text regardless of graphic size.

Possible values: {false, true}

# x_extended_ticks

Determines whether to extend the x-axis ticks across the chart.

Possible values: {false, true}

# x_axis

Determines whether to display the x-axis.

Possible values: {true, false}

# x_label

The label to show below the x-axis.

Possible values: {null, string}

# xax_count

The number of x-axis ticks. The actual number of ticks will be as close to the specified number as possible.

Possible values: {6, number}

# xax_format

A function that formats the x-axis' labels. By default, the x-axis is assumed to be a time-series and the labels are formatted by showing the full month name followed by the day.

// it returns function to format date objects
d3.time.format('%b %d')

For the full list of directives for formatting time, refer to this list. A custom function may be passed in.

# xax_start_at_min

Deprecatad as of v2.7. Please refer to axes_not_compact.

Determines whether to start the x-axis from the left-most edge rather than using the auto-generated set of ticks, which evenly cover the data's domain. Available as of v2.3.

Possible values: {false, true}

# xax_tick_length

The x-axis' tick length in pixels.

Possible values: {5, number}

# xax_units

A prefix symbol to be shown alongside the x axis' labels. Useful for currencies, for instance.

Possible values: {null, string}

# x_scale_type

The x-axis scale type. This option is available as of v2.9.

Possible values: {'linear', 'log'}

# y_axis

Determines whether to display the y-axis.

Possible values: {true, false}

# y_extended_ticks

Determines whether to extend the y-axis ticks across the chart.

Possible values: {false, true}

# y_label

The label to show beside the y-axis.

Possible values: {null, string}

# y_scale_type

The y-axis scale type.

Possible values: {'linear', 'log'}

# yax_count

The number of y-axis ticks. The actual number of ticks will be as close to the specified number as possible.

Possible values: {5, number}

# yax_format

A function that formats the y-axis' labels. For example, to format percentages so that they have two digits of significance:

yax_format: d3.format('2p')

# yax_tick_length

The y-axis' tick length in pixels.

Possible values: {5, number}

# yax_units

A prefix symbol to be shown alongside the y axis' labels. Useful for currencies, for instance.

Possible values: {null, string}

# yax_units_append

Determines whether to append rather than prepend units. This option is available as of v2.10.

Possible values: {false, true}

Clone this wiki locally