"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LineChartStories = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const FormConfiguration_1 = require("../../FormConfiguration");
const FormRuntime_1 = require("../../FormRuntime");
const Containers_1 = require("../../Containers");
const ObjectDataDefinition_1 = require("@appglue/common/dist/Common/Data/Definitions/ObjectDataDefinition");
const NumberDataDefinition_1 = require("@appglue/common/dist/Common/Data/Definitions/NumberDataDefinition");
const StringDataDefinition_1 = require("@appglue/common/dist/Common/Data/Definitions/StringDataDefinition");
const LineChartFormControl_1 = require("../Web/LineChartFormControl");
const StoryData_1 = require("../../../CommonUI/StoryBook/StoryData");
function getUI() {
    let ui = new FormConfiguration_1.FormConfiguration();
    let dataDef = ui.getInputDefinition();
    const chartDataDef = new ObjectDataDefinition_1.ObjectDataDefinition("invoiceByMonth");
    chartDataDef.list = true;
    const labelDef = new StringDataDefinition_1.StringDataDefinition("label");
    const valueDef = new NumberDataDefinition_1.NumberDataDefinition("value");
    chartDataDef.fields.push(labelDef);
    chartDataDef.fields.push(valueDef);
    dataDef.fields.push(chartDataDef);
    const values = [
        {
            label: "Jan",
            value: "1500",
        },
        {
            label: "Feb",
            value: "1250",
        },
        {
            label: "Mar",
            value: "1600",
        },
        {
            label: "Apr",
            value: "1400",
        },
        {
            label: "May",
            value: "1940",
        },
        {
            label: "Jun",
            value: "1150",
        },
        {
            label: "Jul",
            value: "1600",
        },
    ];
    dataDef.value["invoiceByMonth"] = values;
    ui.inputData = dataDef;
    let container = new Containers_1.XStackContainer();
    const chart = new LineChartFormControl_1.LineChartFormControl();
    container.add(chart);
    ui.add(container);
    return { form: ui, control: chart };
}
exports.LineChartStories = [
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Line Chart", "Default"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        ui.control.dataName = "invoiceByMonth";
        ui.control.label = "Line Chart";
        ui.control.chartType = "LineChart";
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Line Chart", "Line Type"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        ui.control.dataName = "invoiceByMonth";
        ui.control.label = "Bar Chart";
        ui.control.chartType = "BarChart";
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Line Chart", "Bar Type"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        ui.control.dataName = "invoiceByMonth";
        ui.control.label = "Bar Chart";
        ui.control.chartType = "BarChart";
        ui.control.showLegend = true;
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Line Chart", "Bar Type with Legend"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        ui.control.dataName = "invoiceByMonth";
        ui.control.label = "Bar Chart";
        ui.control.chartType = "BarChart";
        ui.control.showLegend = true;
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Line Chart", "Bar Type with Legend"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        ui.control.dataName = "invoiceByMonth";
        ui.control.label = "Bar Chart";
        ui.control.chartType = "BarChart";
        ui.control.show3D = true;
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Line Chart", "Bar Type (3d)"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        ui.control.dataName = "invoiceByMonth";
        ui.control.label = "Bar Chart";
        ui.control.chartType = "BarChart";
        ui.control.cursor = true;
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Line Chart", "Bar Type (with cursor)"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        ui.control.dataName = "invoiceByMonth";
        ui.control.label = "Bar Chart";
        ui.control.chartType = "BarChart";
        ui.control.exportable = true;
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Line Chart", "Bar Type (exportable)"),
];
//# sourceMappingURL=XLineChart-stories.js.map