Fluent Commerce Logo
Docs

Area Chart Wrapper

UI Component

Changed on:

2 July 2024

Overview

An area chart wrapper that converts data from Metrics API to chart-readable format.
Plugin NameInventory
Inventory components for managing a Fluent Commerce account.
2023-12-15

v1.0.0

Inventory UI

Alias

fc.chart.area.wrapper.feed

Detailed technical description

Area Chart Wrapper is used in the Feeds Dashboard

Properties

NameTypeRequiredDefaultDescription
chartContainerConfig`ChartContainerConfig`noNo alt providedThe property allows charts to adapt to the size of the parent container. One of the props width and height should be a percentage string.
dataSource`string`yesnoneA string that defines a path to GraphQL data.
path`string`nononeA string that defines a path to the data in the chart data.
tooltip`boolean`nononeEnables tooltip visibility.
legend`boolean`nononeEnables legend visibility.
cartesianGrid`CartesianGrid`nononeWhether the component should render graph lines.
XAxis` Axis` yes none X-axis, which corresponds to the data. The property is used for the tiny axis configuration.
 YAxis` Axis` no noneY-axis, which corresponds to the data. The property is used for the tiny axis configuration.
title`string`nononeChart card title.
widthCardWidth (`"quarter"` / `"third"` / `"half"` / `"two-thirds"` / `"full"``number` (1-12)) no ‘full’Define the width of the card on a 12-column grid. You can use the named widths for readability or numbers directly. On mobile devices, all widths will automatically change to 12 for the best responsive experience. The default is "full" and will take up the full width of the containing component.
noCard`boolean`nononeIf set to `true`, you can use the component without a card background.
 ChartContainerConfig
NameTypeRequiredDefaultDescription
width`string/number`no`100%`The percentage value of the chart's width or a fixed width.
aspect`number`no`1`Width/height. If specified, the height will be calculated by width/aspect.
maxHeight`number`no`200`The maximum height of the container.
height`string/number`nononeThe percentage value of the chart's width or a fixed height.
minWidth`number/string`nononeThe minimum width of the container.
minHeight`number/string`nononeThe minimum height of the container.
debounce`number`no`1`If specified, a positive number, debounced function will be used to handle the resize event.
 CartesianGrid
NameTypeRequiredDefaultDescription
strokeDasharray`string`yesnoneThe pattern of dashes and gaps used to paint the lines of the grid.
 Axis
NameTypeRequiredDefaultDescription
tickLine`boolean`no`true`If set false, no axis tick lines will be drawn.
axisline`boolean`no`true`If set false, no axis line will be drawn.

Configuration example

1{
2  "component": "fc.chart.area.wrapper.feed",
3  "props": {
4    "dataKey": "value",
5    "width": 6,
6    "noCard": true,
7    "YAxis": {
8      "label": "i18n:fc.inventory.feeds.dashboard.area.chart.updates",
9      "padding": {
10        "top": 10
11      },
12      "tickLine": false,
13      "axisLine": false
14    },
15    "XAxis": {
16      "label": "i18n:fc.inventory.feeds.dashboard.area.chart.time"
17    },
18    "tooltip": true,
19    "chartContainerConfig": {
20        "height": 170,
21        "maxHeight": 170
22        },
23    "dataSource": "inventoryFeedsFiltered"
24  }
25}

Version History

2023-12-28

v1.0.0

Area Chart Wrapper description

Recommended Placement

None