2021-03-24 22:05:04 +00:00
|
|
|
import { ChartWidgetProps } from "widgets/ChartWidget";
|
2021-04-21 14:34:25 +00:00
|
|
|
import { VALIDATION_TYPES } from "constants/WidgetValidation";
|
2021-03-24 22:05:04 +00:00
|
|
|
|
2021-03-04 05:24:47 +00:00
|
|
|
export default [
|
|
|
|
|
{
|
|
|
|
|
sectionName: "General",
|
|
|
|
|
children: [
|
|
|
|
|
{
|
|
|
|
|
helpText: "Adds a title to the chart",
|
|
|
|
|
placeholderText: "Enter title",
|
|
|
|
|
propertyName: "chartName",
|
|
|
|
|
label: "Title",
|
|
|
|
|
controlType: "INPUT_TEXT",
|
|
|
|
|
isBindProperty: true,
|
|
|
|
|
isTriggerProperty: false,
|
2021-04-21 14:34:25 +00:00
|
|
|
validation: VALIDATION_TYPES.TEXT,
|
2021-03-04 05:24:47 +00:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
helpText: "Changes the visualisation of the chart data",
|
|
|
|
|
propertyName: "chartType",
|
|
|
|
|
label: "Chart Type",
|
|
|
|
|
controlType: "DROP_DOWN",
|
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
label: "Line Chart",
|
|
|
|
|
value: "LINE_CHART",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "Bar Chart",
|
|
|
|
|
value: "BAR_CHART",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "Pie Chart",
|
|
|
|
|
value: "PIE_CHART",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "Column Chart",
|
|
|
|
|
value: "COLUMN_CHART",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "Area Chart",
|
|
|
|
|
value: "AREA_CHART",
|
|
|
|
|
},
|
2021-03-24 22:05:04 +00:00
|
|
|
{
|
|
|
|
|
label: "Custom Chart",
|
|
|
|
|
value: "CUSTOM_FUSION_CHART",
|
|
|
|
|
},
|
2021-03-04 05:24:47 +00:00
|
|
|
],
|
|
|
|
|
isJSConvertible: true,
|
|
|
|
|
isBindProperty: true,
|
|
|
|
|
isTriggerProperty: false,
|
|
|
|
|
},
|
2021-03-24 22:05:04 +00:00
|
|
|
{
|
|
|
|
|
propertyName: "isVisible",
|
|
|
|
|
label: "Visible",
|
|
|
|
|
helpText: "Controls the visibility of the widget",
|
|
|
|
|
controlType: "SWITCH",
|
|
|
|
|
isJSConvertible: true,
|
|
|
|
|
isBindProperty: true,
|
|
|
|
|
isTriggerProperty: false,
|
2021-04-21 14:34:25 +00:00
|
|
|
validation: VALIDATION_TYPES.BOOLEAN,
|
2021-03-24 22:05:04 +00:00
|
|
|
},
|
2021-03-15 12:17:56 +00:00
|
|
|
],
|
|
|
|
|
},
|
2021-03-24 22:05:04 +00:00
|
|
|
{
|
|
|
|
|
helpText:
|
|
|
|
|
"Manually configure a FusionChart, see https://www.fusioncharts.com",
|
|
|
|
|
propertyName: "customFusionChartConfig",
|
|
|
|
|
placeholderText: `Enter {type: "bar2d","dataSource": {}}`,
|
|
|
|
|
label: "Custom Fusion Chart Configuration",
|
|
|
|
|
controlType: "CUSTOM_FUSION_CHARTS_DATA",
|
|
|
|
|
isBindProperty: true,
|
|
|
|
|
isTriggerProperty: false,
|
|
|
|
|
hidden: (x: any) => x.chartType !== "CUSTOM_FUSION_CHART",
|
2021-04-21 14:34:25 +00:00
|
|
|
validation: VALIDATION_TYPES.CUSTOM_FUSION_CHARTS_DATA,
|
2021-03-24 22:05:04 +00:00
|
|
|
},
|
2021-03-15 12:17:56 +00:00
|
|
|
{
|
|
|
|
|
sectionName: "Chart Data",
|
2021-03-24 22:05:04 +00:00
|
|
|
hidden: (props: ChartWidgetProps) =>
|
|
|
|
|
props.chartType === "CUSTOM_FUSION_CHART",
|
2021-03-15 12:17:56 +00:00
|
|
|
children: [
|
2021-03-04 05:24:47 +00:00
|
|
|
{
|
|
|
|
|
helpText: "Populates the chart with the data",
|
|
|
|
|
propertyName: "chartData",
|
|
|
|
|
placeholderText: 'Enter [{ "x": "val", "y": "val" }]',
|
2021-03-15 12:17:56 +00:00
|
|
|
label: "Chart Series",
|
2021-03-04 05:24:47 +00:00
|
|
|
controlType: "CHART_DATA",
|
2021-03-24 22:05:04 +00:00
|
|
|
|
2021-03-04 05:24:47 +00:00
|
|
|
isBindProperty: false,
|
|
|
|
|
isTriggerProperty: false,
|
|
|
|
|
children: [
|
|
|
|
|
{
|
|
|
|
|
helpText: "Series Name",
|
|
|
|
|
propertyName: "seriesName",
|
|
|
|
|
label: "Series Name",
|
|
|
|
|
controlType: "INPUT_TEXT",
|
|
|
|
|
isBindProperty: true,
|
|
|
|
|
isTriggerProperty: false,
|
2021-04-21 14:34:25 +00:00
|
|
|
validation: VALIDATION_TYPES.TEXT,
|
2021-03-04 05:24:47 +00:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
helpText: "Series data",
|
|
|
|
|
propertyName: "data",
|
|
|
|
|
label: "Series Data",
|
|
|
|
|
controlType: "INPUT_TEXT_AREA",
|
|
|
|
|
isBindProperty: true,
|
|
|
|
|
isTriggerProperty: false,
|
2021-04-21 14:34:25 +00:00
|
|
|
validation: VALIDATION_TYPES.CHART_DATA,
|
2021-03-04 05:24:47 +00:00
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
2021-03-15 12:17:56 +00:00
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
sectionName: "Axis",
|
2021-03-24 22:05:04 +00:00
|
|
|
hidden: (props: ChartWidgetProps) =>
|
|
|
|
|
props.chartType === "CUSTOM_FUSION_CHART",
|
2021-03-15 12:17:56 +00:00
|
|
|
children: [
|
2021-03-04 05:24:47 +00:00
|
|
|
{
|
|
|
|
|
helpText: "Specifies the label of the x-axis",
|
|
|
|
|
propertyName: "xAxisName",
|
|
|
|
|
placeholderText: "Enter label text",
|
|
|
|
|
label: "x-axis Label",
|
|
|
|
|
controlType: "INPUT_TEXT",
|
|
|
|
|
isBindProperty: true,
|
|
|
|
|
isTriggerProperty: false,
|
2021-04-21 14:34:25 +00:00
|
|
|
validation: VALIDATION_TYPES.TEXT,
|
2021-03-04 05:24:47 +00:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
helpText: "Specifies the label of the y-axis",
|
|
|
|
|
propertyName: "yAxisName",
|
|
|
|
|
placeholderText: "Enter label text",
|
|
|
|
|
label: "y-axis Label",
|
|
|
|
|
controlType: "INPUT_TEXT",
|
|
|
|
|
isBindProperty: true,
|
|
|
|
|
isTriggerProperty: false,
|
2021-04-21 14:34:25 +00:00
|
|
|
validation: VALIDATION_TYPES.TEXT,
|
2021-03-04 05:24:47 +00:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
helpText: "Enables scrolling inside the chart",
|
|
|
|
|
propertyName: "allowHorizontalScroll",
|
|
|
|
|
label: "Allow horizontal scroll",
|
|
|
|
|
controlType: "SWITCH",
|
|
|
|
|
isBindProperty: false,
|
|
|
|
|
isTriggerProperty: false,
|
2021-03-24 22:05:04 +00:00
|
|
|
hidden: (x: any) => x.chartType === "CUSTOM_FUSION_CHART",
|
2021-03-04 05:24:47 +00:00
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
sectionName: "Actions",
|
|
|
|
|
children: [
|
|
|
|
|
{
|
|
|
|
|
helpText: "Triggers an action when the chart data point is clicked",
|
|
|
|
|
propertyName: "onDataPointClick",
|
|
|
|
|
label: "onDataPointClick",
|
|
|
|
|
controlType: "ACTION_SELECTOR",
|
|
|
|
|
isJSConvertible: true,
|
|
|
|
|
isBindProperty: true,
|
|
|
|
|
isTriggerProperty: true,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
];
|