Skip to main content

g2plot-chart.chartdatasource

Home > @genesislcap/g2plot-chart > ChartDatasource

ChartDatasource class​

The Genesis Datasource for the g2plot-chart component.

Signature:

export declare class ChartDatasource extends ChartDatasource_base 

Extends: ChartDatasource_base

Properties​

Property

Modifiers

Type

Description

chartFields

string

Default value is 'groupBy value'. Can be customized but order matters.

[Mandatory] First is always the xField/colorField [Mandatory] Second is always the yField/angleField [Optional] Third is always the seriesField

criteria

string

Clients can send a Groovy expression to perform filters on the query server, these remain active for the life of the subscription.

data

any[]

Optional attribute that can be used to pass the data that will be used in the component.

isGroup

boolean

If true, will enable grouped chart plotting numeric values for levels of two categorical variables instead of one.

isSnapshot

boolean

Request a snapshot from the server.

isStack

boolean

If true, will enable stacked chart to effectively portray comparisons of total values across several categories.

maxRows

number

Maximum number of rows to be returned as part of the initial message, and as part of any additional MORE_ROWS messages. This will not affect the number of rows displayed.

maxView

number

Maximum number of rows to track as part of a client "view".

orderBy

string

This option can be used to select a Data Server index (defined in the Data Server query), which is especially useful if you want the data to be sorted in a specific way. By default, Data Server rows are returned in order of creation (from oldest database record to newest).

reduced

boolean

Enabled by default, will not work if a custom charts-fields is used (requires [type, value]).

request

any

This optional parameter enables you to specify request fields, which can include wildcards.

resourceName

string

Name of the backend resource which contain the data.

reverse

boolean

This option changes the Data Server index iteration. For example, if you are using the default index, the query will return rows in order from the newest database records to the oldest.

rowId

string

Attribute to set an unique identifier for the row.

serverFields

string

Can be customized but order matters.

[Mandatory] First will be associated to the first value in 'chartFields' (xField/colorField) [Mandatory] Second will be associated to the second value in 'chartFields' (yField/angleField) [Optional] Third will be associated to the third value in 'chartFields' (seriesField)

showFormattedTime

boolean

Only works if [withTimestampFormatting] is true.

Disabled by default, will ignore the TIME portion in the Chart labels. Only affects [DATETIME] fields.

withTimestampFormatting

boolean

Enabled by default, will format UNIX timestamp fields to readable [DATE|DATETIME] values.