Class NumberRangeFilterBuilder

NumberRangeFilterBuilder

A builder for number range filter controls.

A number range filter is a slider with two thumbs that lets the user select ranges of numeric values. Given a column of type number and matching options, this control filters out the rows that don't match the range that was selected.

For more details, see the Gviz documentation.

Methods

MethodReturn typeBrief description
build()ControlBuilds a control.
setDataTable(tableBuilder)NumberRangeFilterBuilderSets the data table to use for the control using a DataTableBuilder.
setDataTable(table)NumberRangeFilterBuilderSets the control data table, which is the control's underlying data model.
setFilterColumnIndex(columnIndex)NumberRangeFilterBuilderSets the index of the data table column to filter on.
setFilterColumnLabel(columnLabel)NumberRangeFilterBuilderSets the label of the data table column to filter on.
setLabel(label)NumberRangeFilterBuilderSets the label to display next to the slider.
setLabelSeparator(labelSeparator)NumberRangeFilterBuilderSets a separator string appended to the label, to visually separate the label from the category picker.
setLabelStacking(orientation)NumberRangeFilterBuilderSets whether the label should display above (vertical stacking) or beside (horizontal stacking) the input field.
setMaxValue(maxValue)NumberRangeFilterBuilderSets the maximum allowed value for the range lower extent.
setMinValue(minValue)NumberRangeFilterBuilderSets the minimum allowed value for the range lower extent.
setOrientation(orientation)NumberRangeFilterBuilderSets the slider orientation.
setShowRangeValues(showRangeValues)NumberRangeFilterBuilderSets whether to have labels next to the slider displaying extents of the selected range.
setTicks(ticks)NumberRangeFilterBuilderSets the number of ticks (fixed positions in a range bar) a number range filter slider thumbs can fall in.

Detailed documentation

build()

Builds a control.

Return

Control — A control object, that can be used as a UI element.


setDataTable(tableBuilder)

Sets the data table to use for the control using a DataTableBuilder.

This is a convenience method for setting the data table without needing to call build().

Parameters

NameTypeDescription
tableBuilderDataTableBuilderA data table builder. A new data table is created instantly as part of this call, so any further updates to the builder won't be reflected in the control.

Return

NumberRangeFilterBuilder — This builder, useful for chaining.


setDataTable(table)

Sets the control data table, which is the control's underlying data model.

Parameters

NameTypeDescription
tableDataTableSourceThe data table to use for the control.

Return

NumberRangeFilterBuilder — This builder, useful for chaining.


setFilterColumnIndex(columnIndex)

Sets the index of the data table column to filter on.

The values of that column determine whether or not each row should be filtered. It is mandatory to set either this or the column label using setFilterColumnLabel(columnLabel).

Parameters

NameTypeDescription
columnIndexIntegerThe index of the data table column the filter should operate upon.

Return

NumberRangeFilterBuilder — This builder, useful for chaining.


setFilterColumnLabel(columnLabel)

Sets the label of the data table column to filter on.

The values of that column determine whether or not each row should be filtered. It is mandatory to set either this or a column index using setFilterColumnIndex(columnIndex).

Parameters

NameTypeDescription
columnLabelStringThe label of the column to filter on.

Return

NumberRangeFilterBuilder — This builder, useful for chaining.


setLabel(label)

Sets the label to display next to the slider.

If unspecified, the label of the column the control operates on is used.

Parameters

NameTypeDescription
labelStringThe label to display next to the slider.

Return

NumberRangeFilterBuilder — This builder, useful for chaining.


setLabelSeparator(labelSeparator)

Sets a separator string appended to the label, to visually separate the label from the category picker.

Parameters

NameTypeDescription
labelSeparatorStringThe string to use to separate the label from the category picker.

Return

NumberRangeFilterBuilder — This builder, useful for chaining.


setLabelStacking(orientation)

Sets whether the label should display above (vertical stacking) or beside (horizontal stacking) the input field.

Parameters

NameTypeDescription
orientationOrientationThe orientation of the stacking.

Return

NumberRangeFilterBuilder — This builder, useful for chaining.


setMaxValue(maxValue)

Sets the maximum allowed value for the range lower extent. If undefined, the value is inferred from the contents of the DataTable managed by the control.

// Builds a number range filter and sets the maximum value to 100.
var numberRangeFilter = Charts.newNumberRangeFilter()
  .setFilterColumnLabel("Col2")
  .setMaxValue(100)
  .build();

Parameters

NameTypeDescription
maxValueIntegerThe maximum value of the slider.

Return

NumberRangeFilterBuilder — This builder, useful for chaining.


setMinValue(minValue)

Sets the minimum allowed value for the range lower extent. If undefined, the value is inferred from the contents of the DataTable managed by the control.

// Builds a number range filter and sets the minimum value to 10.
var numberRangeFilter = Charts.newNumberRangeFilter()
  .setFilterColumnLabel("Col2")
  .setMinValue(10)
  .build();

Parameters

NameTypeDescription
minValueIntegerThe minimum value of the slider.

Return

NumberRangeFilterBuilder — This builder, useful for chaining.


setOrientation(orientation)

Sets the slider orientation.

// Builds a number range filter and sets it to have a horizontal orientation.
var numberRangeFilter = Charts.newNumberRangeFilter()
  .setFilterColumnLabel("Col2")
  .setOrientation(Charts.Orientation.HORIZONTAL)
  .build();

Parameters

NameTypeDescription
orientationOrientationThe slider orientation to set.

Return

NumberRangeFilterBuilder — This builder, useful for chaining.

See also


setShowRangeValues(showRangeValues)

Sets whether to have labels next to the slider displaying extents of the selected range.

// Builds a number range filter and enables showing of the number range values.
var numberRangeFilter = Charts.newNumberRangeFilter()
  .setFilterColumnLabel("Col2")
  .setShowRangeValues(true)
  .build();

Parameters

NameTypeDescription
showRangeValuesBooleanIf true, enables showing of labels next to the slider.

Return

NumberRangeFilterBuilder — This builder, useful for chaining.


setTicks(ticks)

Sets the number of ticks (fixed positions in a range bar) a number range filter slider thumbs can fall in.

// Builds a number range filter and sets the number of ticks for the range to 10.
var numberRangeFilter = Charts.newNumberRangeFilter()
  .setFilterColumnLabel("Col2")
  .setTicks(10)
  .build();

Parameters

NameTypeDescription
ticksIntegerThe number of ticks on the slider.

Return

NumberRangeFilterBuilder — This builder, useful for chaining.

다음에 대한 의견 보내기...

도움이 필요하시나요? 지원 페이지를 방문하세요.