1.8.1 • Published 10 months ago

@finastra/charts v1.8.1

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months 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

10 months ago

1.8.0

12 months ago

1.7.0

1 year ago

1.6.0

1 year ago

1.4.2

1 year ago

1.5.0

1 year ago

1.4.1

1 year ago

1.4.0

1 year ago

1.3.0

1 year ago

1.1.1

2 years ago

1.1.0

2 years ago

1.2.8

2 years ago

1.2.7

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.1.3

2 years ago

1.0.4

2 years ago

1.2.1

2 years ago

1.1.2

2 years ago

1.2.9

1 year ago

1.2.12

1 year ago

1.2.13

1 year ago

1.2.10

1 year ago

1.2.11

1 year ago

1.2.16

1 year ago

1.2.17

1 year ago

1.2.14

1 year ago

1.2.15

1 year ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.42

2 years ago

0.0.44

2 years ago

1.0.3

2 years ago

0.0.40

2 years ago

0.0.41

2 years ago

0.0.32

2 years ago

0.0.33

2 years ago

0.0.34

2 years ago

0.0.35

2 years ago

0.0.36

2 years ago

0.0.37

2 years ago

0.0.38

2 years ago

0.0.39

2 years ago

0.0.31

2 years ago

0.0.30

2 years ago

0.0.29

2 years ago