ESM
import { convertConfigFieldsToChartRenderer, convertInlineDataToLayerDefinition, convertInlineConfigToLayerConfig } from "@arcgis/charts-components/utils/layer/inline-conversion/index.js";Functions
| Name | Return Type | Object |
|---|---|---|
WebChart["chartRenderer"] | | |
| | ||
Promise<{
chartRenderer?: WebChart["chartRenderer"];
iLayer?: IFeatureLayer;
layer?: FeatureLayer;
}> | |
convertConfigFieldsToChartRenderer
Function
Creates a chart renderer based on the provided config fields and inline data.
- Signature
-
convertConfigFieldsToChartRenderer (props: { categoryField: string; numericFields: string[]; configFields?: WebChartConfigFields; inlineData: WebChartDataTypes; }): WebChart["chartRenderer"]
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| props | {
categoryField: string;
numericFields: string[];
configFields?: WebChartConfigFields;
inlineData: WebChartDataTypes;
} | The category field, the numeric fields, the config fields and the data to convert. | |
- Returns
- WebChart["chartRenderer"]
convertInlineDataToLayerDefinition
Function
Converts an array of inline data to a feature set and returns an IFeatureLayer.
- Signature
-
convertInlineDataToLayerDefinition (props: { categoryField: string; categoryType: "date" | "dateOnly" | "number" | "string" | "timeStampOffset"; numericFields: string[]; inlineData: WebChartDataTypes; }): IFeatureLayer | undefined
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| props | {
categoryField: string;
categoryType: "date" | "dateOnly" | "number" | "string" | "timeStampOffset";
numericFields: string[];
inlineData: WebChartDataTypes;
} | The category field, the category type, the numeric fields and the inline data to convert. | |
- Returns
- IFeatureLayer | undefined
convertInlineConfigToLayerConfig
Function
Converts an array of inline data into a feature collection. Also returns a chartRenderer if the configFields are provided.
- Signature
-
convertInlineConfigToLayerConfig (props: { categoryField: string; categoryType: "date" | "dateOnly" | "number" | "string" | "timeStampOffset"; numericFields: string[]; configFields?: WebChartConfigFields; inlineData: WebChartDataTypes; }): Promise<{ chartRenderer?: WebChart["chartRenderer"]; iLayer?: IFeatureLayer; layer?: FeatureLayer; }>
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| props | {
categoryField: string;
categoryType: "date" | "dateOnly" | "number" | "string" | "timeStampOffset";
numericFields: string[];
configFields?: WebChartConfigFields;
inlineData: WebChartDataTypes;
} | The category field, the category type, the numeric fields, the config fields and the inline data to convert. | |
- Returns
- Promise<{ chartRenderer?: WebChart["chartRenderer"]; iLayer?: IFeatureLayer; layer?: FeatureLayer; }>