JavaScript/jQuery Chart - argumentAxis.visualRange

Defines the axis' displayed range. Cannot be wider than the wholeRange.

Type:

Object

|

Array<Number | String | Date>

Raised Events: onOptionChanged
Cannot be used in themes.

This property accepts one of the following:

  • A two-item array

    Specifies the range's start and end. The array can contain a pair of numeric, string, or date-time values, depending on the axis's argumentType. You can also set one of the array values to null to specify an open-ended range.

    jQuery
    index.js
    $(#chart).dxChart({
        argumentAxis: {
            visualRange: [50, 70]
        }
    })
    // Open-ended range
    $(#chart).dxChart({
        argumentAxis: {
            visualRange: [null, 70]
        }
    })
    Angular
    app.component.html
    <dx-chart>
        <dxo-argument-axis [visualRange]="[50, 70]" ></dxo-argument-axis>
    </dx-chart>
    <!-- Open-ended range -->
    <dx-chart>
        <dxo-argument-axis [visualRange]="[null, 70]" ></dxo-argument-axis>
    </dx-chart>
    Vue
    App.vue
    <DxChart>
        <DxArgumentAxis :visualRange="[50, 70]" />
    </DxChart>
    <!-- Open-ended range -->
    <DxChart>
        <DxArgumentAxis :visualRange="[null, 70]" />
    </DxChart>
    React
    App.tsx
    <Chart>
        <ArgumentAxis visualRange={[50, 70]} />
    </Chart>
    <!-- Open-ended range -->
    <Chart>
        <ArgumentAxis visualRange={[null, 70]} />
    </Chart>
  • An object with the startValue and endValue fields

    An alternative to the two-item array.

    jQuery
    index.js
    $(#chart).dxChart({
        argumentAxis: {
            visualRange: { startValue: 50, endValue: 70 }
        }
    })
    // Open-ended range
    $(#chart).dxChart({
        argumentAxis: {
            visualRange: { startValue: null, endValue: 70 }
        }
    })
    Angular
    app.component.html
    <dx-chart>
        <dxo-argument-axis [visualRange]="{ startValue: 50, endValue: 70 }" ></dxo-argument-axis>
    </dx-chart>
    <!-- Open-ended range -->
    <dx-chart>
        <dxo-argument-axis [visualRange]="{ startValue: null, endValue: 70 }" ></dxo-argument-axis>
    </dx-chart>
    Vue

    The following code snippet demonstrates visualRange defined as a <DxArgumentAxis> attribute:

    App.vue
    <DxChart>
        <DxArgumentAxis :visualRange="{ startValue: null, endValue: 70 }" />
    </DxChart>
    <!-- Open-ended range -->
    <DxChart>
        <DxArgumentAxis :visualRange="{ startValue: null, endValue: 70 }" />
    </DxChart>

    The following code snippet demonstrates visualRange defined as a <DxVisualRange> selector:

    <DxChart>
        <DxArgumentAxis>
            <DxVisualRange startValue="50" endValue="70" />
        </DxArgumentAxis>
    </DxChart>
    <!-- Open-ended range -->
    <DxChart>
        <DxArgumentAxis>
            <DxVisualRange :startValue="null" endValue="70" />
        </DxArgumentAxis>
    </DxChart>
    React

    The following code snippet demonstrates visualRange defined as a <ArgumentAxis> attribute:

    App.tsx
    <Chart>
        <ArgumentAxis visualRange={{ startValue: null, endValue: 70 }} />
    </Chart>
    <!-- Open-ended range -->
    <Chart>
        <ArgumentAxis visualRange={{ startValue: null, endValue: 70 }} />
    </Chart>

    The following code snippet demonstrates visualRange defined as a <VisualRange> selector:

    <Chart>
        <ArgumentAxis>
            <VisualRange startValue="50" endValue="70" />
        </ArgumentAxis>
    </Chart>
    <!-- Open-ended range -->
    <Chart>
        <ArgumentAxis>
            <VisualRange startValue={null} endValue="70" />
        </ArgumentAxis>
    </Chart>
  • An object with the length and startValue or endValue

    Specifies the range using length and start or end values.

    jQuery
    index.js
    $(#chart).dxChart({
        argumentAxis: {
            visualRange: { startValue: 50, length: 20 }
        }
    })
    // or
    $(#chart).dxChart({
        argumentAxis: {
            visualRange: { endValue: 70, length: 20 }
        }
    })
    Angular
    app.component.html
    <dx-chart>
        <dxo-argument-axis [visualRange]="{ startValue: 50, length: 20 }" ></dxo-argument-axis>
    </dx-chart>
    <!-- or -->
    <dx-chart>
        <dxo-argument-axis [visualRange]="{ endValue: 70, length: 20 }" ></dxo-argument-axis>
    </dx-chart>
    Vue

    The following code snippet demonstrates visualRange defined as an attribute of <DxArgumentAxis>:

    App.vue
    <DxChart>
        <DxArgumentAxis :visualRange="{ startValue: 50, length: 20 }" />
    </DxChart>
    <!-- or -->
    <DxChart>
        <DxArgumentAxis :visualRange="{ endValue: 70, length: 20 }" />
    </DxChart>

    The following code snippet demonstrates visualRange defined as a selector (<DxVisualRange>):

    <DxChart>
        <DxArgumentAxis>
            <DxVisualRange startValue="50" length="20" />
        </DxArgumentAxis>
    </DxChart>
    <!-- or -->
    <DxChart>
        <DxArgumentAxis>
            <DxVisualRange endValue="70" length="20" />
        </DxArgumentAxis>
    </DxChart>
    React

    The following code snippet demonstrates visualRange defined as an attribute of <ArgumentAxis>:

    App.tsx
    <Chart>
        <ArgumentAxis visualRange={{ startValue: 50, length: 20 }} />
    <Chart>
    <!-- or -->
    <Chart>
        <ArgumentAxis visualRange={{ endValue: 70, length: 20 }} />
    <Chart>

    The following code snippet demonstrates visualRange defined as a selector (<VisualRange>):

    <Chart>
        <ArgumentAxis>
            <VisualRange startValue="50" length="20" />
        </ArgumentAxis>
    <Chart>
    <!-- or -->
    <Chart>
        <ArgumentAxis>
            <VisualRange endValue="70" length="20" />
        </ArgumentAxis>
    <Chart>

    If you specify only length, the component defines the endValue property as the largest scale value.

Angular
NOTE
The component does not support visualRange properties defined as dxo- selectors.

View Demo

To specify the minimum visual range that a user can set, use the minVisualRangeLength property.

See Also

endValue

The range's end value.

Type:

Number

|

Date

|

String

| undefined
Default Value: undefined
Raised Events: onOptionChanged

length

The range's length.

Type:

Number

|

Object

|

TimeInterval

| undefined
Default Value: undefined

If the axis/scale displays numbers, set this property to a number:

length: 100 // a hundred axis/scale values

If the axis/scale displays date-time values, set it to an accepted string value or object that contains a field described further in this section:

length: 'day' // one day
length: { days: 2 } // two days

startValue

The range's start value.

Type:

Number

|

Date

|

String

| undefined
Default Value: undefined
Raised Events: onOptionChanged