diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/componentStructure.json b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/componentStructure.json
index de0270f6be..ee0f99a074 100644
--- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/componentStructure.json
+++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/componentStructure.json
@@ -75,6 +75,14 @@
{
"name": "Chart",
"icon": "GraphBarVertical",
- "children": ["bar", "line", "area", "candlestick", "pie", "donut"]
+ "children": [
+ "bar",
+ "line",
+ "area",
+ "candlestick",
+ "pie",
+ "donut",
+ "histogram"
+ ]
}
]
diff --git a/packages/client/manifest.json b/packages/client/manifest.json
index 1e4c443f06..934df9dacb 100644
--- a/packages/client/manifest.json
+++ b/packages/client/manifest.json
@@ -2212,6 +2212,147 @@
}
]
},
+ "histogram": {
+ "name": "Histogram Chart",
+ "description": "Histogram chart",
+ "icon": "Histogram",
+ "size": {
+ "width": 600,
+ "height": 400
+ },
+ "requiredAncestors": ["dataprovider"],
+ "settings": [
+ {
+ "type": "text",
+ "label": "Title",
+ "key": "title"
+ },
+ {
+ "type": "dataProvider",
+ "label": "Provider",
+ "key": "dataProvider",
+ "required": true
+ },
+ {
+ "type": "field",
+ "label": "Data column",
+ "key": "valueColumn",
+ "dependsOn": "dataProvider",
+ "required": true
+ },
+ {
+ "type": "text",
+ "label": "Y axis label",
+ "key": "yAxisLabel",
+ "defaultValue": "Frequency"
+ },
+ {
+ "type": "text",
+ "label": "X axis label",
+ "key": "xAxisLabel"
+ },
+ {
+ "type": "number",
+ "label": "Bucket count",
+ "key": "bucketCount",
+ "defaultValue": 10,
+ "min": 2
+ },
+ {
+ "type": "boolean",
+ "label": "Data labels",
+ "key": "dataLabels",
+ "defaultValue": false
+ },
+ {
+ "type": "text",
+ "label": "Width",
+ "key": "width"
+ },
+ {
+ "type": "text",
+ "label": "Height",
+ "key": "height",
+ "defaultValue": "400"
+ },
+ {
+ "type": "select",
+ "label": "Colors",
+ "key": "palette",
+ "defaultValue": "Palette 1",
+ "options": [
+ "Custom",
+ "Palette 1",
+ "Palette 2",
+ "Palette 3",
+ "Palette 4",
+ "Palette 5",
+ "Palette 6",
+ "Palette 7",
+ "Palette 8",
+ "Palette 9",
+ "Palette 10"
+ ]
+ },
+ {
+ "type": "color",
+ "label": "C1",
+ "key": "c1",
+ "dependsOn": {
+ "setting": "palette",
+ "value": "Custom"
+ }
+ },
+ {
+ "type": "color",
+ "label": "C2",
+ "key": "c2",
+ "dependsOn": {
+ "setting": "palette",
+ "value": "Custom"
+ }
+ },
+ {
+ "type": "color",
+ "label": "C3",
+ "key": "c3",
+ "dependsOn": {
+ "setting": "palette",
+ "value": "Custom"
+ }
+ },
+ {
+ "type": "color",
+ "label": "C4",
+ "key": "c4",
+ "dependsOn": {
+ "setting": "palette",
+ "value": "Custom"
+ }
+ },
+ {
+ "type": "color",
+ "label": "C5",
+ "key": "c5",
+ "dependsOn": {
+ "setting": "palette",
+ "value": "Custom"
+ }
+ },
+ {
+ "type": "boolean",
+ "label": "Animate",
+ "key": "animate",
+ "defaultValue": true
+ },
+ {
+ "type": "boolean",
+ "label": "Horizontal",
+ "key": "horizontal",
+ "defaultValue": false
+ }
+ ]
+ },
"form": {
"name": "Form",
"icon": "Form",
@@ -3965,6 +4106,10 @@
"label": "Bar",
"value": "bar"
},
+ {
+ "label": "Histogram",
+ "value": "histogram"
+ },
{
"label": "Line",
"value": "line"
@@ -4215,6 +4360,47 @@
}
]
},
+ {
+ "section": true,
+ "name": "Histogram Chart",
+ "icon": "Histogram",
+ "dependsOn": {
+ "setting": "chartType",
+ "value": "histogram"
+ },
+ "settings": [
+ {
+ "type": "field",
+ "label": "Value column",
+ "key": "valueColumn",
+ "dependsOn": "dataSource",
+ "required": true
+ },
+ {
+ "type": "text",
+ "label": "Y axis label",
+ "key": "yAxisLabel"
+ },
+ {
+ "type": "text",
+ "label": "X axis label",
+ "key": "xAxisLabel"
+ },
+ {
+ "type": "boolean",
+ "label": "Horizontal",
+ "key": "horizontal",
+ "defaultValue": false
+ },
+ {
+ "type": "number",
+ "label": "Bucket count",
+ "key": "bucketCount",
+ "defaultValue": 10,
+ "min": 2
+ }
+ ]
+ },
{
"section": true,
"name": "Line Chart",
diff --git a/packages/client/src/components/app/blocks/ChartBlock.svelte b/packages/client/src/components/app/blocks/ChartBlock.svelte
index 92151ad9c0..1bbc69ce63 100644
--- a/packages/client/src/components/app/blocks/ChartBlock.svelte
+++ b/packages/client/src/components/app/blocks/ChartBlock.svelte
@@ -46,6 +46,9 @@
export let lowColumn
export let dateColumn
+ // Histogram
+ export let bucketCount
+
let dataProviderId
$: colors = c1 && c2 && c3 && c4 && c5 ? [c1, c2, c3, c4, c5] : null
@@ -92,6 +95,7 @@
highColumn,
lowColumn,
dateColumn,
+ bucketCount,
}}
/>
{/if}
diff --git a/packages/client/src/components/app/charts/HistogramChart.svelte b/packages/client/src/components/app/charts/HistogramChart.svelte
new file mode 100644
index 0000000000..26b9028550
--- /dev/null
+++ b/packages/client/src/components/app/charts/HistogramChart.svelte
@@ -0,0 +1,136 @@
+
+
+
diff --git a/packages/client/src/components/app/charts/index.js b/packages/client/src/components/app/charts/index.js
index b1fea9ef0d..e428b4eecf 100644
--- a/packages/client/src/components/app/charts/index.js
+++ b/packages/client/src/components/app/charts/index.js
@@ -4,3 +4,4 @@ export { default as pie } from "./PieChart.svelte"
export { default as donut } from "./DonutChart.svelte"
export { default as area } from "./AreaChart.svelte"
export { default as candlestick } from "./CandleStickChart.svelte"
+export { default as histogram } from "./HistogramChart.svelte"