1.8.1 • Published 2 years ago

@finastra/charts v1.8.1

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Charts

See it on NPM! How big is this package in your project? Storybook

This package contains a wrapper for Apex Charts in Web Components as well as a implementation of a Pie Chart.

Other type of charts will be added in the future, but the wrapper is already ready to use and extend if you need something more specific.

Have a look at the Pie Chart implementation for an example of how to extend the generic wrapper.

Usage

Import

npm i @finastra/charts
import '@finastra/charts';
...
<fds-pie-chart width="380" data='[44, 55, 13, 43, 22]' label="['Apple', 'Mango', 'Orange', 'Watermelon', 'Wiki']"></fds-pie-chart>

API

Properties

PropertyAttributeTypeDefaultDescription
$elHTMLElement \| nullnull
chartApexCharts \| nullnull
chartThemeChartTheme
colorcolorsemantic-1\|semantic-2\|semantic-3\|categorical\|focus-1\|focus-2\|focus-1-angular\|focus-2-angular \|sequential-1\|sequential-2"categorical"Define palette used by the chart
heightheightstring"100%"Height of the chart
hideDataLabelhide-data-labelbooleanfalseHide labels
legendHorizontalAlignlegendHorizontalAlignleft\|center\|right"center"Define the horizontal alignment of legend
legendPositionlegendPositiontop\|right\|bottom\|left"bottom"Define the position of the legend
optionsApexOptions
override
seriesApexAxisChartSeries \| ApexNonAxisChartSeries
typeChartType
widthwidthstring"100%"Width of the chart

Methods

MethodType
createChartEl(): HTMLElement
extend<T>(target: T, source: Partial<T>): T
getColor(): any
getDataLabelColor(): string[]
getStrokeColor(): { stroke: { colors: string[]; }; }
init(): Promise<void> \| undefined
initWatchers(): void
isObject(item: any): boolean
loadChartThemeFromCssVariables(): void
refresh(): Promise<void> \| undefined

fds-donut-chart

Properties

PropertyAttributeTypeDefaultDescription
$elHTMLElement \| nullnull
chartApexCharts \| nullnull
chartThemeChartTheme
colorcolorsemantic-1\|semantic-2\|semantic-3\|categorical\|focus-1\|focus-2\|focus-1-angular\|focus-2-angular \|sequential-1\|sequential-2"categorical"Define palette used by the chart
datadataArray"[]"Data of the chart
disableSelectiondisable-selectionbooleanfalseDisable selection
heightheightstring"100%"Height of the chart
hideDataLabelhide-data-labelbooleanfalseHide labels
labelslabelsArray"[]"Labels correspond to value in data array
legendHorizontalAlignlegendHorizontalAlignleft\|center\|right"center"Define the horizontal alignment of legend
legendPositionlegendPositiontop\|right\|bottom\|left"bottom"Define the position of the legend
optionsApexOptions
override
seriesApexAxisChartSeries \| ApexNonAxisChartSeries
typestring"donut"
widthwidthstring"100%"Width of the chart

Methods

MethodType
createChartEl(): HTMLElement
extend<T>(target: T, source: Partial<T>): T
getColor(): any
getDataLabelColor(): string[]
getStrokeColor(): { stroke: { colors: string[]; }; }
init(): Promise<void> \| undefined
initWatchers(): void
isObject(item: any): boolean
loadChartThemeFromCssVariables(): void
refresh(): Promise<void> \| undefined
toggleSelected(): void

fds-pie-chart

Properties

PropertyAttributeTypeDefaultDescription
$elHTMLElement \| nullnull
chartApexCharts \| nullnull
chartThemeChartTheme
colorcolorsemantic-1\|semantic-2\|semantic-3\|categorical\|focus-1\|focus-2\|focus-1-angular\|focus-2-angular \|sequential-1\|sequential-2"categorical"Define palette used by the chart
datanumber[]
disableSelectiondisable-selectionboolean
heightheightstring"100%"Height of the chart
hideDataLabelhide-data-labelbooleanfalseHide labels
labelsstring[]
legendHorizontalAlignlegendHorizontalAlignleft\|center\|right"center"Define the horizontal alignment of legend
legendPositionlegendPositiontop\|right\|bottom\|left"bottom"Define the position of the legend
optionsApexOptions
override
seriesApexAxisChartSeries \| ApexNonAxisChartSeries
typestring"pie"
widthwidthstring"100%"Width of the chart

Methods

MethodType
createChartEl(): HTMLElement
extend<T>(target: T, source: Partial<T>): T
getColor(): any
getDataLabelColor(): string[]
getStrokeColor(): { stroke: { colors: string[]; }; }
init(): Promise<void> \| undefined
initWatchers(): void
isObject(item: any): boolean
loadChartThemeFromCssVariables(): void
refresh(): Promise<void> \| undefined
toggleSelected(): void

fds-radial-bar-chart

Properties

PropertyAttributeTypeDefaultDescription
$elHTMLElement \| nullnull
chartApexCharts \| nullnull
chartThemeChartTheme
colorcolorsemantic-1\|semantic-2\|semantic-3\|categorical\|focus-1\|focus-2\|focus-1-angular\|focus-2-angular \|sequential-1\|sequential-2"categorical"Define palette used by the chart
datadataArray"[]"Data of the chart
heightheightstring"100%"Height of the chart
hideDataLabelhide-data-labelbooleanfalseHide labels
hideLabelshide-labelsBooleanfalseHide the labels and display only the value,
labelslabelsArray"[]"Labels correspond to value in data array
legendHorizontalAlignlegendHorizontalAlignleft\|center\|right"center"Define the horizontal alignment of legend
legendPositionlegendPositiontop\|right\|bottom\|left"bottom"Define the position of the legend
optionsApexOptions
override
seriesApexAxisChartSeries \| ApexNonAxisChartSeries
totalLabeltotal-labelString""Total label, visible only with multiple data
typestring"radialBar"
widthwidthstring"100%"Width of the chart

Methods

MethodType
createChartEl(): HTMLElement
extend<T>(target: T, source: Partial<T>): T
getColor(): any
getDataLabelColor(): string[]
getStrokeColor(): { stroke: { colors: string[]; }; }
init(): Promise<void> \| undefined
initWatchers(): void
isObject(item: any): boolean
loadChartThemeFromCssVariables(): void
refresh(): Promise<void> \| undefined

fds-line-chart

Properties

PropertyAttributeTypeDefaultDescription
$elHTMLElement \| nullnull
chartApexCharts \| nullnull
chartThemeChartTheme
colorcolorcategorical"categorical"Define palette used by the chart
seriesObjectname, dataSet of data
heightheightstring"100%"Height of the chart
hideDataLabelhide-data-labelbooleanfalseHide data labels
legendHorizontalAlignlegendHorizontalAlignleft\|center\|right"center"Define the horizontal alignment of legend
legendPositionlegendPositiontop\|right\|bottom\|left"bottom"Define the position of the legend
optionsApexOptions
override
typestring"pie"
widthwidthstring"100%"Width of the chart
xaxisObjectDefine axis X and its properties
yaxisObjectDefine axis X and its properties
showToolbarshow-toolbarbooleantrueDisplay toolbar from the top right corner
strokestrokeObjectDefine stroke and its properties
strokeCurvestroke-curvestringDefine curve type
tooltiptooltipObjectDefine tooltip and its properties

Methods

MethodType
createChartEl(): HTMLElement
extend<T>(target: T, source: Partial<T>): T
getColor(): any
getDataLabelColor(): string[]
getStrokeColor(): { stroke: { colors: string[]; }; }
init(): Promise<void> \| undefined
initWatchers(): void
isObject(item: any): boolean
loadChartThemeFromCssVariables(): void
refresh(): Promise<void> \| undefined

CSS Custom Properties

PropertyDefaultDescription
--fds-radial-label" var(--fds-body-3)"Label size
--fds-radial-value" var(--fds-headline-2)"Label size
1.8.1

2 years ago

1.8.0

2 years ago

1.7.0

2 years ago

1.6.0

2 years ago

1.4.2

2 years ago

1.5.0

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.3.0

2 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.2.8

3 years ago

1.2.7

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.1.3

3 years ago

1.0.4

3 years ago

1.2.1

3 years ago

1.1.2

3 years ago

1.2.9

3 years ago

1.2.12

3 years ago

1.2.13

3 years ago

1.2.10

3 years ago

1.2.11

3 years ago

1.2.16

3 years ago

1.2.17

3 years ago

1.2.14

3 years ago

1.2.15

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.42

3 years ago

0.0.44

3 years ago

1.0.3

3 years ago

0.0.40

3 years ago

0.0.41

3 years ago

0.0.32

3 years ago

0.0.33

3 years ago

0.0.34

3 years ago

0.0.35

3 years ago

0.0.36

3 years ago

0.0.37

3 years ago

0.0.38

3 years ago

0.0.39

3 years ago

0.0.31

3 years ago

0.0.30

3 years ago

0.0.29

3 years ago