File

libs/core/src/lib/model/internal/options.ts

Description

Options for each dataset.

Example

Index

Properties

Constructor

constructor(internalId: string, color: string)
Parameters :
Name Type Optional
internalId string No
color string No

Properties

Optional autoRangeSelection
Type : boolean
Default value : false

auto zoom when range selection

Public barPeriod
Type : string
Default value : 'PT1H'

period of the bars defined as moment.duration by a string See also: https://momentjs.com/docs/#/durations/ default is 'PT1H' which means one hour duration

Public barStartOf
Type : string
Default value : 'hour'

the start of, where to start with the bar chart See also: https://momentjs.com/docs/#/manipulating/start-of/ default is 'hour'

Public color
Type : string

color of the dataset

Public Optional generalize
Type : boolean
Default value : false

marker to request dataset data generalized

Public internalId
Type : string

internal dataset id

Public lineDashArray
Type : number | number[]

dasharray to structure the line or bar chart border See also here: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray

Public lineWidth
Type : number
Default value : 1

width of graphline

Public pointBorderColor
Type : string

color of the point border

Public pointBorderWidth
Type : number
Default value : 0

width of the point border

Public pointRadius
Type : number
Default value : 0

radius of graphpoint default is 0

Public Optional separateYAxis
Type : boolean
Default value : false

separate y axis of datasets with same unit

Public showReferenceValues
Type : ReferenceValueOption[]
Default value : []

list of visible reference values

Public type
Type : "line" | "bar"
Default value : 'line'

type to display the data default is 'line'

Public visible
Type : boolean
Default value : true

show or hide in the graph

Public Optional yAxisRange
Type : MinMaxRange

min and max range of y axis

Public Optional zeroBasedYAxis
Type : boolean
Default value : false

align graph that zero y axis is visible

export class DatasetOptions {

    /**
     * internal dataset id
     */
    public internalId: string;

    /**
     * type to display the data
     * default is 'line'
     */
    public type: 'line' | 'bar' = 'line';

    /**
     * color of the dataset
     */
    public color: string;

    /**
     * show or hide in the graph
     */
    public visible: boolean = true;

    /**
     * separate y axis of datasets with same unit
     */
    public separateYAxis?: boolean = false;

    /**
     * align graph that zero y axis is visible
     */
    public zeroBasedYAxis?: boolean = false;

    /**
     * auto zoom when range selection
     */
    autoRangeSelection?: boolean = false;

    /**
     * marker to request dataset data generalized
     */
    public generalize?: boolean = false;

    /**
     * list of visible reference values
     */
    public showReferenceValues: ReferenceValueOption[] = [];

    /**
     * radius of graphpoint
     * default is 0
     */
    public pointRadius: number = 0;

    /**
     * the start of, where to start with the bar chart
     * See also: https://momentjs.com/docs/#/manipulating/start-of/
     * default is 'hour'
     */
    public barStartOf: string = 'hour';

    /**
     * period of the bars
     * defined as moment.duration by a string
     * See also: https://momentjs.com/docs/#/durations/
     * default is 'PT1H' which means one hour duration
     */
    public barPeriod: string = 'PT1H';

    /**
     * width of graphline
     */
    public lineWidth: number = 1;

    /**
     * dasharray to structure the line or bar chart border
     * See also here: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray
     */
    public lineDashArray: number | number[];

    /**
     * color of the point border
     */
    public pointBorderColor: string;

    /**
     * width of the point border
     */
    public pointBorderWidth: number = 0;

    /**
     * min and max range of y axis
     */
    public yAxisRange?: MinMaxRange;

    constructor(
        internalId: string,
        color: string
    ) {
        this.internalId = internalId;
        this.color = color;
    }
}

export interface ReferenceValueOption {
    id: string;
    color: string;
}

/**
 * numbered range with a min and a max value
 *
 * @export
 */
export interface MinMaxRange {
    min: number;
    max: number;
}

export class TimedDatasetOptions extends DatasetOptions {
    public timestamp: number;

    constructor(
        internalId: string,
        color: string,
        timestamp: number
    ) {
        super(internalId, color);
        this.timestamp = timestamp;
    }
}

result-matching ""

    No results matching ""