Axis Formatting

This section provides details for the following axis formatting options:

 

Setting Axis Ranges and Ticks

Sample Syntax

Action

xRange(0, 100)

Adjust the range of the X axis

yMin(15.5)

Set the minimum value on the Y axis

yMax(100)

Set the maximum value on the Y axis

.plot(...)   //this plot uses the left Y axis

.twinX()

.plot(...)   //this plot uses the right Y axis

Add a shared axis

xTickLabelAngle(45.0)

Change the angle of the tick labels on the X axis

yTicks(10)

Set gap between major ticks on the Y axis

xMinorTicksVisible(false)

yMinorTicksVisible(false)

Turn off minor ticks on both axes

Setting Axis Time Formatting

A time-related axis can be formatted using Java DataTimeFormatter strings. By default, Deephaven will attempt to determine an appropriate format. See the table below for some of the more common examples.

Sample Syntax

Action

Formatted Examples

xFormatPattern("yyyy-MM-dd")

Change the format used on the X axis to show the year, month and day

2017-03-08

xFormatPattern("HH:mm")

Change the format used on the X axis to include only hours and minutes based on a 24-hour clock

14:45

xFormatPattern("hh:mm a")

Change the format used on the X axis to include only hours and minutes based on a 12-hour clock with a.m./p.m notation

02:45 p.m.

xFormatPattern("HH:mm:ss")

Change the format used on the X axis to include hours, minutes and seconds

14:45:59

xFormatPattern("yyyy-MM-dd'T'HH:mm:ss")

Change the format used on the X axis to show the year, month, day, hour, minute and second

2017-03-08T 14:45:59

Note: The plotting of time is accurate to approximately 250 nanoseconds. If greater precision is desired, please contact Deephaven Customer Support for guidance.

Setting Axis Decimal Formatting

A numerical axis can be formatted using Java DecimalFormat strings. See the table below for some of the more common examples

Sample Syntax

Action

Formatted Examples

yFormatPattern("###,###.00")

Change the format of the Y axis and round to two mandatory decimal places.

123,456.78

654.32

1.99

yFormatPattern("\$###,###.00")

Change the decimal format of the Y axis to dollars and cents.

$123,456.78

$654.32

$1.99

yFormatPattern("\$###,###.00 Million")

Change the decimal format of the Y axis to dollars and cents, and then add further text to the value.

$123,456 Million

$654 Million

$1 Million

yFormatPattern("###.00%")

Change the Y axis to reflect percentage with two mandatory decimal places.

100.11%

10.22%

1.5%

.98%

yFormatPattern("0.00E00")

Change the Y axis to reflect the value in scientific notation with two decimal places and one exponent.

1.34E6

7.80E1

yFormatPattern("##0.00E00")

Change the Y axis to reflect the value in engineering notation with two decimal places and one exponent.

321.34E8

1.34E6

.78E2

Axis Transforms

Axis value ranges can be transformed to specific types with the following methods:

Sample Syntax

Action

xLog()

Convert the scale of the X axis to a logarithmic scale

xBusinessTime()

Convert the scale of the X axis to a business calendar


Last Updated: 25 February 2020 08:26 -05:00 UTC    Deephaven v.1.20200121  (See other versions)

Deephaven Documentation     Copyright 2016-2020  Deephaven Data Labs, LLC     All Rights Reserved