diff --git a/chart_sdk/radicalbit_platform_chart_sdk/charts/chart.py b/chart_sdk/radicalbit_platform_chart_sdk/charts/chart.py index 15994584..b2f70a74 100644 --- a/chart_sdk/radicalbit_platform_chart_sdk/charts/chart.py +++ b/chart_sdk/radicalbit_platform_chart_sdk/charts/chart.py @@ -46,18 +46,18 @@ def numerical_bar_chart(self, data: NumericalBarChartData) -> EChartsRawWidget: "right": 20, "bottom": 0, "top": 10, - "containLabel": true + "containLabel": True }, "xAxis": { "type": "category", "axisTick": { - "show": false + "show": False }, "axisLine": { - "show": false + "show": False }, "splitLine": { - "show": false + "show": False }, "axisLabel": { "fontSize": 12, @@ -65,18 +65,7 @@ def numerical_bar_chart(self, data: NumericalBarChartData) -> EChartsRawWidget: "color": "#9B99A1", "rotate": 20 }, - "data": [ - "[19,700-99,400) ", - "[99,400-179,000) ", - "[179,000-259,000) ", - "[259,000-339,000) ", - "[339,000-418,000) ", - "[418,000-498,000) ", - "[498,000-578,000) ", - "[578,000-657,000) ", - "[657,000-737,000) ", - "[737,000-817,000] " - ] + "data": data.bucket_data }, "yAxis": { "type": "value", @@ -91,7 +80,7 @@ def numerical_bar_chart(self, data: NumericalBarChartData) -> EChartsRawWidget: } }, "emphasis": { - "disabled": true + "disabled": True }, "barCategoryGap": "0", "barGap": "0", @@ -99,27 +88,7 @@ def numerical_bar_chart(self, data: NumericalBarChartData) -> EChartsRawWidget: "borderWidth": 1, "borderColor": "rgba(201, 25, 25, 1)" }, - "series": [ - { - "title": "reference", - "type": "bar", - "itemStyle": { - "color": "#9B99A1" - }, - "data": [ - 502, - 982, - 896, - 356, - 181, - 44, - 24, - 10, - 3, - 2 - ] - } - ] + "series": series } return EChartsRawWidget(option=option) diff --git a/chart_sdk/radicalbit_platform_chart_sdk/charts/chart_data.py b/chart_sdk/radicalbit_platform_chart_sdk/charts/chart_data.py index cc43e782..fd1c3f53 100644 --- a/chart_sdk/radicalbit_platform_chart_sdk/charts/chart_data.py +++ b/chart_sdk/radicalbit_platform_chart_sdk/charts/chart_data.py @@ -7,5 +7,6 @@ class ChartData(BaseModel): x_axis_data: List[str] class NumericalBarChartData(BaseModel): + bucket_data: List[str] reference_data: List[float] - current_data: Optional[List[float]] \ No newline at end of file + current_data: Optional[List[float]] = None \ No newline at end of file diff --git a/chart_sdk/test/numerical_bar_chart.ipynb b/chart_sdk/test/numerical_bar_chart.ipynb new file mode 100644 index 00000000..aaba6fcb --- /dev/null +++ b/chart_sdk/test/numerical_bar_chart.ipynb @@ -0,0 +1,129 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "cf17c43b-22b9-4d43-83bf-4bd03d068b7e", + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "b10bdb9783f04f15826934a7d560b4ef", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "EChartsRawWidget(option={'grid': {'left': 0, 'right': 20, 'bottom': 0, 'top': 10, 'containLabel': True}, 'xAxi…" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "from radicalbit_platform_chart_sdk.charts import NumericalBarChartData, Chart\n", + "\n", + "Chart().numerical_bar_chart(data=NumericalBarChartData(\n", + " bucket_data=[\"[19,700-99,400) \",\"[99,400-179,000) \",\"[179,000-259,000) \",\"[259,000-339,000) \",\"[339,000-418,000) \",\"[418,000-498,000) \",\"[498,000-578,000) \",\"[578,000-657,000) \",\"[657,000-737,000) \",\"[737,000-817,000] \"],\n", + " reference_data=[502,982,896,356,181,44,24,10,3,2],\n", + "))\n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "d85c083f-2ed3-4049-aeec-effe807fc0bf", + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "80a4ca3d166b4063808a4122aec532b9", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "EChartsRawWidget(option={'grid': {'left': 0, 'right': 20, 'bottom': 0, 'top': 10, 'containLabel': True}, 'xAxi…" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "from radicalbit_platform_chart_sdk.charts import NumericalBarChartData, Chart\n", + "\n", + "Chart().numerical_bar_chart(data=NumericalBarChartData(\n", + " bucket_data=[\"[19,700-99,400) \",\"[99,400-179,000) \",\"[179,000-259,000) \",\"[259,000-339,000) \",\"[339,000-418,000) \",\"[418,000-498,000) \",\"[498,000-578,000) \",\"[578,000-657,000) \",\"[657,000-737,000) \",\"[737,000-817,000] \"],\n", + " reference_data=[502,982,896,356,181,44,24,10,3,2],\n", + " current_data=[]\n", + "))" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "45ed67a9-1c12-4ae2-a066-eafaa9b06749", + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "a8149dbe179240fdb73d1bf6fbf79f77", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "EChartsRawWidget(option={'grid': {'left': 0, 'right': 20, 'bottom': 0, 'top': 10, 'containLabel': True}, 'xAxi…" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "from radicalbit_platform_chart_sdk.charts import NumericalBarChartData, Chart\n", + "\n", + "Chart().numerical_bar_chart(data=NumericalBarChartData(\n", + " bucket_data=[\"[19,700-99,400) \",\"[99,400-179,000) \",\"[179,000-259,000) \",\"[259,000-339,000) \",\"[339,000-418,000) \",\"[418,000-498,000) \",\"[498,000-578,000) \",\"[578,000-657,000) \",\"[657,000-737,000) \",\"[737,000-817,000] \"],\n", + " reference_data=[502,982,896,356,181,44,24,10,3,2],\n", + " current_data=[502,982,896,356,181,44,24,10,3,2]\n", + "))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e0e396df-a75e-49b8-8164-544b23fc126a", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "radicalbit-platform-chart-sdk-ayHfA1Gh-py3.1", + "language": "python", + "name": "radicalbit-platform-chart-sdk-ayhfa1gh-py3.1" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.9" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/chart_sdk/test/test_chart.ipynb b/chart_sdk/test/test_chart.ipynb index 1802801f..0aa6c752 100644 --- a/chart_sdk/test/test_chart.ipynb +++ b/chart_sdk/test/test_chart.ipynb @@ -2,14 +2,14 @@ "cells": [ { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "id": "5d415d16-3f98-4c19-9a04-2dff6a1f50ac", "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "dcc70b04e7524a9ca0060b57242b43f6", + "model_id": "0fe475f28fe840d9901bc93b85ba2bbe", "version_major": 2, "version_minor": 0 }, @@ -17,7 +17,7 @@ "EChartsRawWidget(option={'xAxis': {'type': 'category', 'boundaryGap': False, 'data': ['Mon', 'Tue', 'Wed', 'Th…" ] }, - "execution_count": 2, + "execution_count": 1, "metadata": {}, "output_type": "execute_result" } @@ -34,18 +34,48 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "id": "f4e9ff8a-6490-4ce7-a01d-fe4d43159f5a", "metadata": {}, + "outputs": [ + { + "ename": "NameError", + "evalue": "name 'true' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[4], line 3\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mradicalbit_platform_chart_sdk\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mcharts\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m NumericalBarChartData, Chart\n\u001b[0;32m----> 3\u001b[0m \u001b[43mChart\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mnumerical_bar_chart\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdata\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mNumericalBarChartData\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 4\u001b[0m \u001b[43m \u001b[49m\u001b[43mreference_data\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m502\u001b[39;49m\u001b[43m,\u001b[49m\u001b[38;5;241;43m982\u001b[39;49m\u001b[43m,\u001b[49m\u001b[38;5;241;43m896\u001b[39;49m\u001b[43m,\u001b[49m\u001b[38;5;241;43m356\u001b[39;49m\u001b[43m,\u001b[49m\u001b[38;5;241;43m181\u001b[39;49m\u001b[43m,\u001b[49m\u001b[38;5;241;43m44\u001b[39;49m\u001b[43m,\u001b[49m\u001b[38;5;241;43m24\u001b[39;49m\u001b[43m,\u001b[49m\u001b[38;5;241;43m10\u001b[39;49m\u001b[43m,\u001b[49m\u001b[38;5;241;43m3\u001b[39;49m\u001b[43m,\u001b[49m\u001b[38;5;241;43m2\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 5\u001b[0m \u001b[43m \u001b[49m\u001b[43mcurrent_data\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m[\u001b[49m\u001b[43m]\u001b[49m\n\u001b[1;32m 6\u001b[0m \u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/radicalbit/radicalbit-ai-monitoring/chart_sdk/radicalbit_platform_chart_sdk/charts/chart.py:49\u001b[0m, in \u001b[0;36mChart.numerical_bar_chart\u001b[0;34m(self, data)\u001b[0m\n\u001b[1;32m 32\u001b[0m current_data_json \u001b[38;5;241m=\u001b[39m {\n\u001b[1;32m 33\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtitle\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcurrent\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 34\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtype\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mbar\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 38\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mdata\u001b[39m\u001b[38;5;124m\"\u001b[39m: data\u001b[38;5;241m.\u001b[39mcurrent_data\n\u001b[1;32m 39\u001b[0m }\n\u001b[1;32m 41\u001b[0m series \u001b[38;5;241m=\u001b[39m [reference_data_json] \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m data\u001b[38;5;241m.\u001b[39mcurrent_data \u001b[38;5;28;01melse\u001b[39;00m [reference_data_json, current_data_json]\n\u001b[1;32m 43\u001b[0m option \u001b[38;5;241m=\u001b[39m {\n\u001b[1;32m 44\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mgrid\u001b[39m\u001b[38;5;124m\"\u001b[39m: {\n\u001b[1;32m 45\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mleft\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;241m0\u001b[39m,\n\u001b[1;32m 46\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mright\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;241m20\u001b[39m,\n\u001b[1;32m 47\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mbottom\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;241m0\u001b[39m,\n\u001b[1;32m 48\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtop\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;241m10\u001b[39m,\n\u001b[0;32m---> 49\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcontainLabel\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[43mtrue\u001b[49m\n\u001b[1;32m 50\u001b[0m },\n\u001b[1;32m 51\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mxAxis\u001b[39m\u001b[38;5;124m\"\u001b[39m: {\n\u001b[1;32m 52\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtype\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcategory\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 53\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124maxisTick\u001b[39m\u001b[38;5;124m\"\u001b[39m: {\n\u001b[1;32m 54\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mshow\u001b[39m\u001b[38;5;124m\"\u001b[39m: false\n\u001b[1;32m 55\u001b[0m },\n\u001b[1;32m 56\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124maxisLine\u001b[39m\u001b[38;5;124m\"\u001b[39m: {\n\u001b[1;32m 57\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mshow\u001b[39m\u001b[38;5;124m\"\u001b[39m: false\n\u001b[1;32m 58\u001b[0m },\n\u001b[1;32m 59\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124msplitLine\u001b[39m\u001b[38;5;124m\"\u001b[39m: {\n\u001b[1;32m 60\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mshow\u001b[39m\u001b[38;5;124m\"\u001b[39m: false\n\u001b[1;32m 61\u001b[0m },\n\u001b[1;32m 62\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124maxisLabel\u001b[39m\u001b[38;5;124m\"\u001b[39m: {\n\u001b[1;32m 63\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mfontSize\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;241m12\u001b[39m,\n\u001b[1;32m 64\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124minterval\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;241m0\u001b[39m,\n\u001b[1;32m 65\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcolor\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m#9B99A1\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 66\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mrotate\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;241m20\u001b[39m\n\u001b[1;32m 67\u001b[0m },\n\u001b[1;32m 68\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mdata\u001b[39m\u001b[38;5;124m\"\u001b[39m: [\n\u001b[1;32m 69\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m[19,700-99,400) \u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 70\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m[99,400-179,000) \u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 71\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m[179,000-259,000) \u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 72\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m[259,000-339,000) \u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 73\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m[339,000-418,000) \u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 74\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m[418,000-498,000) \u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 75\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m[498,000-578,000) \u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 76\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m[578,000-657,000) \u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 77\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m[657,000-737,000) \u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 78\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m[737,000-817,000] \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 79\u001b[0m ]\n\u001b[1;32m 80\u001b[0m },\n\u001b[1;32m 81\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124myAxis\u001b[39m\u001b[38;5;124m\"\u001b[39m: {\n\u001b[1;32m 82\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtype\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mvalue\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 83\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124maxisLabel\u001b[39m\u001b[38;5;124m\"\u001b[39m: {\n\u001b[1;32m 84\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mfontSize\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;241m9\u001b[39m,\n\u001b[1;32m 85\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcolor\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m#9B99A1\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 86\u001b[0m },\n\u001b[1;32m 87\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124msplitLine\u001b[39m\u001b[38;5;124m\"\u001b[39m: {\n\u001b[1;32m 88\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mlineStyle\u001b[39m\u001b[38;5;124m\"\u001b[39m: {\n\u001b[1;32m 89\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcolor\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m#9f9f9f54\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 90\u001b[0m }\n\u001b[1;32m 91\u001b[0m }\n\u001b[1;32m 92\u001b[0m },\n\u001b[1;32m 93\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124memphasis\u001b[39m\u001b[38;5;124m\"\u001b[39m: {\n\u001b[1;32m 94\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mdisabled\u001b[39m\u001b[38;5;124m\"\u001b[39m: true\n\u001b[1;32m 95\u001b[0m },\n\u001b[1;32m 96\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mbarCategoryGap\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m0\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 97\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mbarGap\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m0\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 98\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mitemStyle\u001b[39m\u001b[38;5;124m\"\u001b[39m: {\n\u001b[1;32m 99\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mborderWidth\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;241m1\u001b[39m,\n\u001b[1;32m 100\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mborderColor\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mrgba(201, 25, 25, 1)\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 101\u001b[0m },\n\u001b[1;32m 102\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mseries\u001b[39m\u001b[38;5;124m\"\u001b[39m: [\n\u001b[1;32m 103\u001b[0m {\n\u001b[1;32m 104\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtitle\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mreference\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 105\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtype\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mbar\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 106\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mitemStyle\u001b[39m\u001b[38;5;124m\"\u001b[39m: {\n\u001b[1;32m 107\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcolor\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m#9B99A1\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 108\u001b[0m },\n\u001b[1;32m 109\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mdata\u001b[39m\u001b[38;5;124m\"\u001b[39m: [\n\u001b[1;32m 110\u001b[0m \u001b[38;5;241m502\u001b[39m,\n\u001b[1;32m 111\u001b[0m \u001b[38;5;241m982\u001b[39m,\n\u001b[1;32m 112\u001b[0m \u001b[38;5;241m896\u001b[39m,\n\u001b[1;32m 113\u001b[0m \u001b[38;5;241m356\u001b[39m,\n\u001b[1;32m 114\u001b[0m \u001b[38;5;241m181\u001b[39m,\n\u001b[1;32m 115\u001b[0m \u001b[38;5;241m44\u001b[39m,\n\u001b[1;32m 116\u001b[0m \u001b[38;5;241m24\u001b[39m,\n\u001b[1;32m 117\u001b[0m \u001b[38;5;241m10\u001b[39m,\n\u001b[1;32m 118\u001b[0m \u001b[38;5;241m3\u001b[39m,\n\u001b[1;32m 119\u001b[0m \u001b[38;5;241m2\u001b[39m\n\u001b[1;32m 120\u001b[0m ]\n\u001b[1;32m 121\u001b[0m }\n\u001b[1;32m 122\u001b[0m ]\n\u001b[1;32m 123\u001b[0m }\n\u001b[1;32m 125\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m EChartsRawWidget(option\u001b[38;5;241m=\u001b[39moption)\n", + "\u001b[0;31mNameError\u001b[0m: name 'true' is not defined" + ] + } + ], + "source": [ + "from radicalbit_platform_chart_sdk.charts import NumericalBarChartData, Chart\n", + "\n", + "Chart().numerical_bar_chart(data=NumericalBarChartData(\n", + " bucket_data=[\"[19,700-99,400) \",\"[99,400-179,000) \",\"[179,000-259,000) \",\"[259,000-339,000) \",\"[339,000-418,000) \",\"[418,000-498,000) \",\"[498,000-578,000) \",\"[578,000-657,000) \",\"[657,000-737,000) \",\"[737,000-817,000] \"],\n", + " reference_data=[502,982,896,356,181,44,24,10,3,2],\n", + " current_data=[]\n", + "))\n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3a2a5412-7085-48de-87b1-9b7995d918bc", + "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "radicalbit-platform-chart-sdk-ayHfA1Gh-py3.1", "language": "python", - "name": "python3" + "name": "radicalbit-platform-chart-sdk-ayhfa1gh-py3.1" }, "language_info": { "codemirror_mode": {