2021-09-09 15:10:22 +00:00
|
|
|
import Widget from "./widget";
|
|
|
|
|
import IconSVG from "./icon.svg";
|
|
|
|
|
import { GRID_DENSITY_MIGRATION_V1 } from "widgets/constants";
|
|
|
|
|
import { generateReactKey } from "widgets/WidgetUtils";
|
|
|
|
|
import { LabelOrientation } from "./constants";
|
|
|
|
|
|
|
|
|
|
export const CONFIG = {
|
|
|
|
|
type: Widget.getWidgetType(),
|
|
|
|
|
name: "Chart",
|
|
|
|
|
iconSVG: IconSVG,
|
|
|
|
|
needsMeta: true,
|
|
|
|
|
defaults: {
|
|
|
|
|
rows: 8 * GRID_DENSITY_MIGRATION_V1,
|
|
|
|
|
columns: 6 * GRID_DENSITY_MIGRATION_V1,
|
|
|
|
|
widgetName: "Chart",
|
2021-09-20 10:43:44 +00:00
|
|
|
chartType: "COLUMN_CHART",
|
|
|
|
|
chartName: "Sales Report",
|
2021-09-09 15:10:22 +00:00
|
|
|
allowHorizontalScroll: false,
|
|
|
|
|
version: 1,
|
|
|
|
|
chartData: {
|
|
|
|
|
[generateReactKey()]: {
|
|
|
|
|
seriesName: "Sales",
|
|
|
|
|
data: [
|
|
|
|
|
{
|
2021-09-20 10:43:44 +00:00
|
|
|
x: "Product1",
|
|
|
|
|
y: 20000,
|
2021-09-09 15:10:22 +00:00
|
|
|
},
|
|
|
|
|
{
|
2021-09-20 10:43:44 +00:00
|
|
|
x: "Product2",
|
|
|
|
|
y: 22000,
|
2021-09-09 15:10:22 +00:00
|
|
|
},
|
|
|
|
|
{
|
2021-09-20 10:43:44 +00:00
|
|
|
x: "Product3",
|
2021-09-09 15:10:22 +00:00
|
|
|
y: 32000,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
},
|
2021-09-20 10:43:44 +00:00
|
|
|
xAxisName: "Product Line",
|
|
|
|
|
yAxisName: "Revenue($)",
|
2021-09-09 15:10:22 +00:00
|
|
|
labelOrientation: LabelOrientation.AUTO,
|
|
|
|
|
customFusionChartConfig: {
|
|
|
|
|
type: "column2d",
|
|
|
|
|
dataSource: {
|
|
|
|
|
chart: {
|
2021-09-20 10:43:44 +00:00
|
|
|
caption: "Sales Report",
|
|
|
|
|
xAxisName: "Product Line",
|
|
|
|
|
yAxisName: "Revenue($)",
|
2021-09-09 15:10:22 +00:00
|
|
|
theme: "fusion",
|
|
|
|
|
},
|
|
|
|
|
data: [
|
|
|
|
|
{
|
2021-09-20 10:43:44 +00:00
|
|
|
label: "Product1",
|
|
|
|
|
value: 20000,
|
2021-09-09 15:10:22 +00:00
|
|
|
},
|
|
|
|
|
{
|
2021-09-20 10:43:44 +00:00
|
|
|
label: "Product2",
|
|
|
|
|
value: 22000,
|
2021-09-09 15:10:22 +00:00
|
|
|
},
|
|
|
|
|
{
|
2021-09-20 10:43:44 +00:00
|
|
|
label: "Product3",
|
2021-09-09 15:10:22 +00:00
|
|
|
value: 32000,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
properties: {
|
|
|
|
|
derived: Widget.getDerivedPropertiesMap(),
|
|
|
|
|
default: Widget.getDefaultPropertiesMap(),
|
|
|
|
|
meta: Widget.getMetaPropertiesMap(),
|
|
|
|
|
config: Widget.getPropertyPaneConfig(),
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default Widget;
|