@sankhyalabs/ezui 5.21.0-dev.2 → 5.21.0-dev.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cjs/ICustomRender-6fafffce.js +13 -0
- package/dist/cjs/ez-actions-button.cjs.entry.js +2 -1
- package/dist/cjs/ez-alert-list.cjs.entry.js +7 -5
- package/dist/cjs/ez-alert.cjs.entry.js +1 -1
- package/dist/cjs/ez-application.cjs.entry.js +1 -1
- package/dist/cjs/ez-badge.cjs.entry.js +1 -1
- package/dist/cjs/ez-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/ez-button.cjs.entry.js +3 -3
- package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
- package/dist/cjs/ez-card-item_3.cjs.entry.js +1 -1
- package/dist/cjs/ez-chart.cjs.entry.js +433 -0
- package/dist/cjs/ez-check.cjs.entry.js +1 -1
- package/dist/cjs/ez-chip.cjs.entry.js +1 -1
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +2 -1
- package/dist/cjs/ez-combo-box.cjs.entry.js +2 -1
- package/dist/cjs/{ez-text-edit.cjs.entry.js → ez-custom-form-input_2.cjs.entry.js} +95 -1
- package/dist/cjs/ez-date-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ez-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/ez-file-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-form-view.cjs.entry.js +34 -4
- package/dist/cjs/ez-form.cjs.entry.js +78 -3
- package/dist/cjs/ez-grid.cjs.entry.js +333 -33
- package/dist/cjs/ez-guide-navigator.cjs.entry.js +1 -1
- package/dist/cjs/ez-icon.cjs.entry.js +1 -1
- package/dist/cjs/ez-list.cjs.entry.js +2 -2
- package/dist/cjs/ez-loading-bar.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal-container.cjs.entry.js +16 -5
- package/dist/cjs/ez-modal.cjs.entry.js +8 -9
- package/dist/cjs/ez-multi-selection-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +35 -29
- package/dist/cjs/ez-popover.cjs.entry.js +1 -1
- package/dist/cjs/ez-popup.cjs.entry.js +15 -9
- package/dist/cjs/ez-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-scroller_3.cjs.entry.js +1 -1
- package/dist/cjs/ez-search.cjs.entry.js +18 -6
- package/dist/cjs/ez-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-item.cjs.entry.js +2 -1
- package/dist/cjs/ez-split-panel.cjs.entry.js +2 -2
- package/dist/cjs/ez-tabselector.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-area.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-toast.cjs.entry.js +1 -1
- package/dist/cjs/ez-upload.cjs.entry.js +1 -1
- package/dist/cjs/ez-view-stack.cjs.entry.js +1 -1
- package/dist/cjs/ezui.cjs.js +2 -2
- package/dist/cjs/filter-column.cjs.entry.js +1 -1
- package/dist/cjs/{index-a7b0c73d.js → index-9e5554cb.js} +11 -4
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/ez-alert-list/ez-alert-list.js +6 -4
- package/dist/collection/components/ez-button/ez-button.css +7 -0
- package/dist/collection/components/ez-button/ez-button.js +1 -1
- package/dist/collection/components/ez-chart/components/BarChart.js +27 -0
- package/dist/collection/components/ez-chart/components/ColumnChart.js +27 -0
- package/dist/collection/components/ez-chart/components/DonutChart.js +42 -0
- package/dist/collection/components/ez-chart/components/LineChart.js +27 -0
- package/dist/collection/components/ez-chart/components/PieChart.js +45 -0
- package/dist/collection/components/ez-chart/components/index.js +5 -0
- package/dist/collection/components/ez-chart/ez-chart.css +5 -0
- package/dist/collection/components/ez-chart/ez-chart.js +284 -0
- package/dist/collection/components/ez-chart/interfaces/ChartAxis.js +1 -0
- package/dist/collection/components/ez-chart/interfaces/ChartContext.js +14 -0
- package/dist/collection/components/ez-chart/interfaces/ChartOptions.js +1 -0
- package/dist/collection/components/ez-chart/interfaces/ChartSerie.js +1 -0
- package/dist/collection/components/ez-chart/interfaces/ChartStrategies.js +1 -0
- package/dist/collection/components/ez-chart/interfaces/ChartType.js +8 -0
- package/dist/collection/components/ez-chart/interfaces/index.js +5 -0
- package/dist/collection/components/ez-chart/test/mock-chart.js +137 -0
- package/dist/collection/components/ez-chart/types/BaseHighChartsRender.js +146 -0
- package/dist/collection/components/ez-form/ez-form.js +130 -4
- package/dist/collection/components/ez-form-view/custom-input/ez-custom-form-input.js +253 -0
- package/dist/collection/components/ez-form-view/ez-form-view.js +89 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.js +3 -2
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +56 -5
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +1 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +35 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.js +58 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.js +40 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellEditorConstants.js +11 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellRenderConstants.js +11 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellEditor.js +6 -3
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellRender.js +40 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/IUICellRender.js +1 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/NumberInput.tpl.js +3 -2
- package/dist/collection/components/ez-grid/ez-grid.css +1 -0
- package/dist/collection/components/ez-grid/ez-grid.js +233 -11
- package/dist/collection/components/ez-grid/interfaces/ICustomFormatter.js +1 -0
- package/dist/collection/components/ez-grid/interfaces/index.js +1 -0
- package/dist/collection/components/ez-grid/subcomponents/selection-counter.js +3 -11
- package/dist/collection/components/ez-grid/subcomponents/utils/selectionCounterUtils.js +22 -0
- package/dist/collection/components/ez-grid/test/resources/gridDataUnit.js +19 -0
- package/dist/collection/components/ez-list/ez-list.css +6 -2
- package/dist/collection/components/ez-modal/ez-modal.js +22 -9
- package/dist/collection/components/ez-modal-container/ez-modal-container.css +4 -0
- package/dist/collection/components/ez-modal-container/ez-modal-container.js +23 -3
- package/dist/collection/components/ez-number-input/ez-number-input.js +42 -27
- package/dist/collection/components/ez-popup/ez-popup.js +14 -8
- package/dist/collection/components/ez-search/ez-search.js +16 -5
- package/dist/collection/components/ez-split-panel/ez-split-panel.css +1 -0
- package/dist/collection/utils/customEditor/interfaces/ICustomEditor.js +5 -0
- package/dist/collection/utils/customEditor/interfaces/ICustomEditorInfo.js +1 -0
- package/dist/collection/utils/customRender/interfaces/ICustomRender.js +5 -0
- package/dist/collection/utils/customRender/interfaces/ICustomRenderInfo.js +1 -0
- package/dist/collection/utils/form/DataBinder.js +26 -0
- package/dist/collection/utils/form/test/DataBinder.test.js +41 -4
- package/dist/collection/utils/form/test/resources/metadataTest.js +15 -0
- package/dist/collection/utils/index.js +2 -0
- package/dist/custom-elements/index.d.ts +12 -0
- package/dist/custom-elements/index.js +1081 -105
- package/dist/esm/ICustomRender-875b5a40.js +13 -0
- package/dist/esm/ez-actions-button.entry.js +2 -1
- package/dist/esm/ez-alert-list.entry.js +7 -5
- package/dist/esm/ez-alert.entry.js +1 -1
- package/dist/esm/ez-application.entry.js +1 -1
- package/dist/esm/ez-badge.entry.js +1 -1
- package/dist/esm/ez-breadcrumb.entry.js +1 -1
- package/dist/esm/ez-button.entry.js +3 -3
- package/dist/esm/ez-calendar.entry.js +1 -1
- package/dist/esm/ez-card-item_3.entry.js +1 -1
- package/dist/esm/ez-chart.entry.js +429 -0
- package/dist/esm/ez-check.entry.js +1 -1
- package/dist/esm/ez-chip.entry.js +1 -1
- package/dist/esm/ez-collapsible-box.entry.js +2 -1
- package/dist/esm/ez-combo-box.entry.js +2 -1
- package/dist/esm/{ez-text-edit.entry.js → ez-custom-form-input_2.entry.js} +96 -3
- package/dist/esm/ez-date-input.entry.js +1 -1
- package/dist/esm/ez-date-time-input.entry.js +1 -1
- package/dist/esm/ez-dialog.entry.js +1 -1
- package/dist/esm/ez-dropdown.entry.js +1 -1
- package/dist/esm/ez-file-item.entry.js +1 -1
- package/dist/esm/ez-form-view.entry.js +34 -4
- package/dist/esm/ez-form.entry.js +79 -4
- package/dist/esm/ez-grid.entry.js +333 -33
- package/dist/esm/ez-guide-navigator.entry.js +1 -1
- package/dist/esm/ez-icon.entry.js +1 -1
- package/dist/esm/ez-list.entry.js +2 -2
- package/dist/esm/ez-loading-bar.entry.js +1 -1
- package/dist/esm/ez-modal-container.entry.js +16 -5
- package/dist/esm/ez-modal.entry.js +9 -10
- package/dist/esm/ez-multi-selection-list.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +35 -29
- package/dist/esm/ez-popover.entry.js +1 -1
- package/dist/esm/ez-popup.entry.js +15 -9
- package/dist/esm/ez-radio-button.entry.js +1 -1
- package/dist/esm/ez-scroller_3.entry.js +1 -1
- package/dist/esm/ez-search.entry.js +18 -6
- package/dist/esm/ez-skeleton.entry.js +1 -1
- package/dist/esm/ez-split-button.entry.js +1 -1
- package/dist/esm/ez-split-item.entry.js +2 -1
- package/dist/esm/ez-split-panel.entry.js +2 -2
- package/dist/esm/ez-tabselector.entry.js +1 -1
- package/dist/esm/ez-text-area.entry.js +1 -1
- package/dist/esm/ez-text-input.entry.js +1 -1
- package/dist/esm/ez-time-input.entry.js +1 -1
- package/dist/esm/ez-toast.entry.js +1 -1
- package/dist/esm/ez-upload.entry.js +1 -1
- package/dist/esm/ez-view-stack.entry.js +1 -1
- package/dist/esm/ezui.js +3 -3
- package/dist/esm/filter-column.entry.js +1 -1
- package/dist/esm/{index-baa5e267.js → index-5a720e56.js} +11 -5
- package/dist/esm/loader.js +3 -3
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-44caad9a.entry.js → p-0378416a.entry.js} +1 -1
- package/dist/ezui/p-085babb4.entry.js +1 -0
- package/dist/ezui/{p-91f626d3.entry.js → p-0e551dd4.entry.js} +1 -1
- package/dist/ezui/{p-af2ecb1b.entry.js → p-11b09aa1.entry.js} +1 -1
- package/dist/ezui/{p-77a4bd35.entry.js → p-11bfeca3.entry.js} +1 -1
- package/dist/ezui/p-23a796cc.entry.js +1 -0
- package/dist/ezui/{p-af95cd16.entry.js → p-24ca32a3.entry.js} +1 -1
- package/dist/ezui/{p-cc2dc4f4.entry.js → p-2a6e44a0.entry.js} +1 -1
- package/dist/ezui/p-2af4e2de.entry.js +1 -0
- package/dist/ezui/{p-baf80b13.entry.js → p-30951bd7.entry.js} +1 -1
- package/dist/ezui/p-31674f8e.entry.js +1 -0
- package/dist/ezui/{p-bf79aaa1.entry.js → p-33792b2b.entry.js} +1 -1
- package/dist/ezui/{p-b44741b0.entry.js → p-355c20f5.entry.js} +2 -2
- package/dist/ezui/{p-e85c48d7.entry.js → p-36180f4d.entry.js} +1 -1
- package/dist/ezui/{p-7bc07c31.entry.js → p-3f8c33e0.entry.js} +1 -1
- package/dist/ezui/p-4559c266.entry.js +1 -0
- package/dist/ezui/p-4607fb89.js +1 -0
- package/dist/ezui/p-507ec8ed.entry.js +1 -0
- package/dist/ezui/{p-8defa6d3.entry.js → p-51e4c040.entry.js} +1 -1
- package/dist/ezui/p-569a0b9a.entry.js +1 -0
- package/dist/ezui/{p-1f50fa05.entry.js → p-6b51c9cc.entry.js} +1 -1
- package/dist/ezui/p-6ec40dec.entry.js +1 -0
- package/dist/ezui/{p-5ed81457.entry.js → p-6fc26622.entry.js} +1 -1
- package/dist/ezui/{p-555c9018.entry.js → p-7567ccdd.entry.js} +1 -1
- package/dist/ezui/{p-1e7a8633.entry.js → p-81461d2f.entry.js} +1 -1
- package/dist/ezui/{p-072e6347.entry.js → p-82ac8b06.entry.js} +1 -1
- package/dist/ezui/{p-8df1ca33.entry.js → p-82fa4b09.entry.js} +1 -1
- package/dist/ezui/p-868b56f7.entry.js +1 -0
- package/dist/ezui/{p-85c8baae.entry.js → p-8eef0f70.entry.js} +1 -1
- package/dist/ezui/p-91ccae0c.entry.js +1 -0
- package/dist/ezui/{p-3faa2b46.entry.js → p-9634631d.entry.js} +1 -1
- package/dist/ezui/p-9a11e223.entry.js +1 -0
- package/dist/ezui/{p-7af81663.entry.js → p-9a23d513.entry.js} +1 -1
- package/dist/ezui/p-9aa27e69.entry.js +1 -0
- package/dist/ezui/{p-784fe207.entry.js → p-9c2e2d68.entry.js} +1 -1
- package/dist/ezui/{p-9050d2cd.entry.js → p-b0e71d23.entry.js} +1 -1
- package/dist/ezui/{p-17be134a.entry.js → p-b2f6bc0a.entry.js} +1 -1
- package/dist/ezui/{p-9f5fa3f9.entry.js → p-c2b20f78.entry.js} +1 -1
- package/dist/ezui/{p-5bd5e68f.entry.js → p-c3b7a23e.entry.js} +1 -1
- package/dist/ezui/p-cd1a2e6b.entry.js +1 -0
- package/dist/ezui/p-d62ff380.entry.js +1 -0
- package/dist/ezui/{p-bae4e180.entry.js → p-dbeee5aa.entry.js} +1 -1
- package/dist/ezui/{p-a80b1287.entry.js → p-dfca5946.entry.js} +1 -1
- package/dist/ezui/p-e151e795.entry.js +1 -0
- package/dist/ezui/{p-23a36bb6.js → p-e4c7eb39.js} +2 -2
- package/dist/ezui/{p-0306dff7.entry.js → p-e6b38ade.entry.js} +1 -1
- package/dist/ezui/{p-650e4b6d.entry.js → p-f1c2c19e.entry.js} +1 -1
- package/dist/ezui/p-f1c3f85d.entry.js +1 -0
- package/dist/ezui/{p-49456b34.entry.js → p-f291db18.entry.js} +1 -1
- package/dist/ezui/{p-6e429cff.entry.js → p-fc194825.entry.js} +1 -1
- package/dist/types/components/ez-alert-list/ez-alert-list.d.ts +2 -2
- package/dist/types/components/ez-chart/components/BarChart.d.ts +9 -0
- package/dist/types/components/ez-chart/components/ColumnChart.d.ts +9 -0
- package/dist/types/components/ez-chart/components/DonutChart.d.ts +9 -0
- package/dist/types/components/ez-chart/components/LineChart.d.ts +9 -0
- package/dist/types/components/ez-chart/components/PieChart.d.ts +9 -0
- package/dist/types/components/ez-chart/components/index.d.ts +5 -0
- package/dist/types/components/ez-chart/ez-chart.d.ts +58 -0
- package/dist/types/components/ez-chart/interfaces/ChartAxis.d.ts +7 -0
- package/dist/types/components/ez-chart/interfaces/ChartContext.d.ts +11 -0
- package/dist/types/components/ez-chart/interfaces/ChartOptions.d.ts +10 -0
- package/dist/types/components/ez-chart/interfaces/ChartSerie.d.ts +20 -0
- package/dist/types/components/ez-chart/interfaces/ChartStrategies.d.ts +7 -0
- package/dist/types/components/ez-chart/interfaces/ChartType.d.ts +7 -0
- package/dist/types/components/ez-chart/interfaces/index.d.ts +5 -0
- package/dist/types/components/ez-chart/types/BaseHighChartsRender.d.ts +15 -0
- package/dist/types/components/ez-form/ez-form.d.ts +20 -1
- package/dist/types/components/ez-form-view/custom-input/ez-custom-form-input.d.ts +43 -0
- package/dist/types/components/ez-form-view/ez-form-view.d.ts +11 -0
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +30 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +13 -0
- package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +7 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.d.ts +19 -0
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.d.ts +14 -0
- package/dist/types/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellEditorConstants.d.ts +11 -0
- package/dist/types/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellRenderConstants.d.ts +11 -0
- package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellEditor.d.ts +3 -0
- package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellRender.d.ts +15 -0
- package/dist/types/components/ez-grid/controller/ag-grid/editor/IUICellRender.d.ts +10 -0
- package/dist/types/components/ez-grid/ez-grid.d.ts +34 -1
- package/dist/types/components/ez-grid/interfaces/ICustomFormatter.d.ts +5 -0
- package/dist/types/components/ez-grid/interfaces/index.d.ts +1 -0
- package/dist/types/components/ez-grid/subcomponents/utils/selectionCounterUtils.d.ts +4 -0
- package/dist/types/components/ez-grid/test/resources/gridDataUnit.d.ts +2 -0
- package/dist/types/components/ez-modal/ez-modal.d.ts +9 -1
- package/dist/types/components/ez-modal-container/ez-modal-container.d.ts +3 -0
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +3 -0
- package/dist/types/components/ez-popup/ez-popup.d.ts +3 -3
- package/dist/types/components/ez-search/ez-search.d.ts +2 -1
- package/dist/types/components.d.ts +223 -4
- package/dist/types/utils/customEditor/interfaces/ICustomEditor.d.ts +29 -0
- package/dist/types/utils/customEditor/interfaces/ICustomEditorInfo.d.ts +5 -0
- package/dist/types/utils/customRender/interfaces/ICustomRender.d.ts +29 -0
- package/dist/types/utils/customRender/interfaces/ICustomRenderInfo.d.ts +5 -0
- package/dist/types/utils/form/DataBinder.d.ts +3 -0
- package/dist/types/utils/form/test/resources/metadataTest.d.ts +2 -0
- package/dist/types/utils/index.d.ts +2 -0
- package/package.json +2 -1
- package/react/components.d.ts +2 -0
- package/react/components.js +2 -0
- package/react/components.js.map +1 -1
- package/dist/ezui/p-0447d17c.entry.js +0 -1
- package/dist/ezui/p-20ec22c0.entry.js +0 -1
- package/dist/ezui/p-2a1a0e04.entry.js +0 -1
- package/dist/ezui/p-5e1d036e.entry.js +0 -1
- package/dist/ezui/p-5ef056ce.entry.js +0 -1
- package/dist/ezui/p-637f69f2.entry.js +0 -1
- package/dist/ezui/p-701231f0.entry.js +0 -1
- package/dist/ezui/p-99ead599.entry.js +0 -1
- package/dist/ezui/p-9aefaa52.entry.js +0 -1
- package/dist/ezui/p-a1ec32ef.entry.js +0 -1
- package/dist/ezui/p-b041333c.entry.js +0 -1
- package/dist/ezui/p-b567fa8c.entry.js +0 -1
- package/dist/ezui/p-bae3d0aa.entry.js +0 -1
- package/dist/ezui/p-bc2f844e.entry.js +0 -1
- package/dist/ezui/p-db77a984.entry.js +0 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as Highcharts from 'highcharts';
|
|
2
|
+
import { BaseHighChartsRender } from "../types/BaseHighChartsRender";
|
|
3
|
+
export class PieChartStrategy extends BaseHighChartsRender {
|
|
4
|
+
buildOptions(series, options) {
|
|
5
|
+
const dataLabels = [
|
|
6
|
+
{
|
|
7
|
+
enabled: true,
|
|
8
|
+
distance: 10
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
enabled: true,
|
|
12
|
+
distance: -40,
|
|
13
|
+
format: '{point.percentage:.1f}%',
|
|
14
|
+
style: {
|
|
15
|
+
fontSize: '1.2em',
|
|
16
|
+
textOutline: 'none',
|
|
17
|
+
opacity: 0.7
|
|
18
|
+
},
|
|
19
|
+
filter: {
|
|
20
|
+
property: 'percentage',
|
|
21
|
+
operator: '>',
|
|
22
|
+
value: 4
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
];
|
|
26
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({ chart: Object.assign(Object.assign({ type: 'pie' }, (options.width && { width: options.width })), (options.height && { height: options.height })), title: this.parseTitle(options.title) }, (options.subTitle && { subtitle: this.parseSubTitle(options.subTitle) })), { series: this.parseSerie(series), tooltip: this.buildFormatterTooltip(series), legend: {
|
|
27
|
+
enabled: options.legendEnabled,
|
|
28
|
+
}, plotOptions: {
|
|
29
|
+
series: Object.assign({ dataLabels, cursor: 'pointer' }, (options.onClickSerie && {
|
|
30
|
+
point: {
|
|
31
|
+
events: {
|
|
32
|
+
click: this.buildOnClickCallBack(options.onClickSerie),
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}))
|
|
36
|
+
} }), this.buildResposiveConfig()), this.buildDefaultChartOptions());
|
|
37
|
+
}
|
|
38
|
+
render(container, series, _xAxis, _yAxis, options) {
|
|
39
|
+
this.chart = Highcharts.chart(container, this.buildOptions(series, options));
|
|
40
|
+
}
|
|
41
|
+
destroy() {
|
|
42
|
+
var _a;
|
|
43
|
+
(_a = this.chart) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import { ChartContext, ChartType } from './interfaces';
|
|
3
|
+
import { ColumnChartStrategy, BarChartStrategy, LineChartStrategy, PieChartStrategy, DonutChartStrategy } from './components';
|
|
4
|
+
export class EzChart {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.STRATEGY_BY_CHART_TYPE = new Map();
|
|
7
|
+
this.type = ChartType.LINE;
|
|
8
|
+
this.xAxis = undefined;
|
|
9
|
+
this.yAxis = undefined;
|
|
10
|
+
this.chartTitle = "";
|
|
11
|
+
this.chartSubTitle = "";
|
|
12
|
+
this.legendEnabled = true;
|
|
13
|
+
this.series = undefined;
|
|
14
|
+
this.width = undefined;
|
|
15
|
+
this.height = undefined;
|
|
16
|
+
this.initializeStrategies();
|
|
17
|
+
}
|
|
18
|
+
initializeStrategies() {
|
|
19
|
+
this.STRATEGY_BY_CHART_TYPE.set(ChartType.COLUMN, new ColumnChartStrategy());
|
|
20
|
+
this.STRATEGY_BY_CHART_TYPE.set(ChartType.BAR, new BarChartStrategy());
|
|
21
|
+
this.STRATEGY_BY_CHART_TYPE.set(ChartType.LINE, new LineChartStrategy());
|
|
22
|
+
this.STRATEGY_BY_CHART_TYPE.set(ChartType.PIE, new PieChartStrategy());
|
|
23
|
+
this.STRATEGY_BY_CHART_TYPE.set(ChartType.DONUT, new DonutChartStrategy());
|
|
24
|
+
}
|
|
25
|
+
renderChart() {
|
|
26
|
+
this.chartContext.render(this._container, this.series, this.xAxis, this.yAxis, {
|
|
27
|
+
title: this.chartTitle,
|
|
28
|
+
subTitle: this.chartSubTitle,
|
|
29
|
+
legendEnabled: this.legendEnabled,
|
|
30
|
+
onClickSerie: this.ezSerieClick,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
componentWillLoad() {
|
|
34
|
+
this.setChartStrategy();
|
|
35
|
+
}
|
|
36
|
+
componentWillUpdate() {
|
|
37
|
+
this.renderChart();
|
|
38
|
+
}
|
|
39
|
+
componentDidLoad() {
|
|
40
|
+
this.renderChart();
|
|
41
|
+
}
|
|
42
|
+
disconnectedCallback() {
|
|
43
|
+
this.chartContext.destroy();
|
|
44
|
+
}
|
|
45
|
+
handleTypeChange() {
|
|
46
|
+
this.setChartStrategy();
|
|
47
|
+
}
|
|
48
|
+
setChartStrategy() {
|
|
49
|
+
const strategy = this.STRATEGY_BY_CHART_TYPE.get(this.type);
|
|
50
|
+
if (strategy) {
|
|
51
|
+
this.chartContext = new ChartContext(strategy);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
this.chartContext = new ChartContext(new LineChartStrategy());
|
|
55
|
+
}
|
|
56
|
+
render() {
|
|
57
|
+
return (h("div", { ref: (el) => this._container = el }));
|
|
58
|
+
}
|
|
59
|
+
static get is() { return "ez-chart"; }
|
|
60
|
+
static get encapsulation() { return "shadow"; }
|
|
61
|
+
static get originalStyleUrls() {
|
|
62
|
+
return {
|
|
63
|
+
"$": ["ez-chart.css"]
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
static get styleUrls() {
|
|
67
|
+
return {
|
|
68
|
+
"$": ["ez-chart.css"]
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
static get properties() {
|
|
72
|
+
return {
|
|
73
|
+
"type": {
|
|
74
|
+
"type": "string",
|
|
75
|
+
"mutable": false,
|
|
76
|
+
"complexType": {
|
|
77
|
+
"original": "ChartType",
|
|
78
|
+
"resolved": "ChartType.BAR | ChartType.COLUMN | ChartType.DONUT | ChartType.LINE | ChartType.PIE",
|
|
79
|
+
"references": {
|
|
80
|
+
"ChartType": {
|
|
81
|
+
"location": "import",
|
|
82
|
+
"path": "./interfaces"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"required": false,
|
|
87
|
+
"optional": false,
|
|
88
|
+
"docs": {
|
|
89
|
+
"tags": [],
|
|
90
|
+
"text": "Define o tipo de gr\u00E1fico apresentado pelo componente"
|
|
91
|
+
},
|
|
92
|
+
"attribute": "type",
|
|
93
|
+
"reflect": false,
|
|
94
|
+
"defaultValue": "ChartType.LINE"
|
|
95
|
+
},
|
|
96
|
+
"xAxis": {
|
|
97
|
+
"type": "unknown",
|
|
98
|
+
"mutable": false,
|
|
99
|
+
"complexType": {
|
|
100
|
+
"original": "ChartAxis | Array<ChartAxis>",
|
|
101
|
+
"resolved": "ChartAxis[] | ({ color?: string; categories?: string[]; formatter?: (value: string | number) => string; text?: string; invertedPosition?: boolean; })",
|
|
102
|
+
"references": {
|
|
103
|
+
"ChartAxis": {
|
|
104
|
+
"location": "import",
|
|
105
|
+
"path": "./interfaces"
|
|
106
|
+
},
|
|
107
|
+
"Array": {
|
|
108
|
+
"location": "global"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"required": false,
|
|
113
|
+
"optional": false,
|
|
114
|
+
"docs": {
|
|
115
|
+
"tags": [],
|
|
116
|
+
"text": "Defini\u00E7\u00F5es do eixo X do gr\u00E1fico"
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"yAxis": {
|
|
120
|
+
"type": "unknown",
|
|
121
|
+
"mutable": false,
|
|
122
|
+
"complexType": {
|
|
123
|
+
"original": "ChartAxis | Array<ChartAxis>",
|
|
124
|
+
"resolved": "ChartAxis[] | ({ color?: string; categories?: string[]; formatter?: (value: string | number) => string; text?: string; invertedPosition?: boolean; })",
|
|
125
|
+
"references": {
|
|
126
|
+
"ChartAxis": {
|
|
127
|
+
"location": "import",
|
|
128
|
+
"path": "./interfaces"
|
|
129
|
+
},
|
|
130
|
+
"Array": {
|
|
131
|
+
"location": "global"
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"required": false,
|
|
136
|
+
"optional": false,
|
|
137
|
+
"docs": {
|
|
138
|
+
"tags": [],
|
|
139
|
+
"text": "Defini\u00E7\u00F5es do eixo Y do gr\u00E1fico"
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
"chartTitle": {
|
|
143
|
+
"type": "string",
|
|
144
|
+
"mutable": false,
|
|
145
|
+
"complexType": {
|
|
146
|
+
"original": "string",
|
|
147
|
+
"resolved": "string",
|
|
148
|
+
"references": {}
|
|
149
|
+
},
|
|
150
|
+
"required": false,
|
|
151
|
+
"optional": false,
|
|
152
|
+
"docs": {
|
|
153
|
+
"tags": [],
|
|
154
|
+
"text": "Define o titulo a ser apresentado no gr\u00E1fico"
|
|
155
|
+
},
|
|
156
|
+
"attribute": "chart-title",
|
|
157
|
+
"reflect": false,
|
|
158
|
+
"defaultValue": "\"\""
|
|
159
|
+
},
|
|
160
|
+
"chartSubTitle": {
|
|
161
|
+
"type": "string",
|
|
162
|
+
"mutable": false,
|
|
163
|
+
"complexType": {
|
|
164
|
+
"original": "string",
|
|
165
|
+
"resolved": "string",
|
|
166
|
+
"references": {}
|
|
167
|
+
},
|
|
168
|
+
"required": false,
|
|
169
|
+
"optional": false,
|
|
170
|
+
"docs": {
|
|
171
|
+
"tags": [],
|
|
172
|
+
"text": "Define o sub titulo a ser apresentado no gr\u00E1fico"
|
|
173
|
+
},
|
|
174
|
+
"attribute": "chart-sub-title",
|
|
175
|
+
"reflect": false,
|
|
176
|
+
"defaultValue": "\"\""
|
|
177
|
+
},
|
|
178
|
+
"legendEnabled": {
|
|
179
|
+
"type": "boolean",
|
|
180
|
+
"mutable": false,
|
|
181
|
+
"complexType": {
|
|
182
|
+
"original": "boolean",
|
|
183
|
+
"resolved": "boolean",
|
|
184
|
+
"references": {}
|
|
185
|
+
},
|
|
186
|
+
"required": false,
|
|
187
|
+
"optional": false,
|
|
188
|
+
"docs": {
|
|
189
|
+
"tags": [],
|
|
190
|
+
"text": "Define se a legenda do gr\u00E1fico deve ser apresentada ou n\u00E3o."
|
|
191
|
+
},
|
|
192
|
+
"attribute": "legend-enabled",
|
|
193
|
+
"reflect": false,
|
|
194
|
+
"defaultValue": "true"
|
|
195
|
+
},
|
|
196
|
+
"series": {
|
|
197
|
+
"type": "unknown",
|
|
198
|
+
"mutable": false,
|
|
199
|
+
"complexType": {
|
|
200
|
+
"original": "ChartSerie | Array<ChartSerie>",
|
|
201
|
+
"resolved": "ChartSerie[] | ({ data: (number | ChartSerieData)[]; name?: string; color?: string; type?: \"line\" | \"column\" | \"bar\"; yAxis?: number; toolTipFormatter?: (serieName: string, xAxis: string | number, yAxis: number, dataName: string, percentage: number) => string; showDataLabel?: boolean; })",
|
|
202
|
+
"references": {
|
|
203
|
+
"ChartSerie": {
|
|
204
|
+
"location": "import",
|
|
205
|
+
"path": "./interfaces/ChartSerie"
|
|
206
|
+
},
|
|
207
|
+
"Array": {
|
|
208
|
+
"location": "global"
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
"required": false,
|
|
213
|
+
"optional": false,
|
|
214
|
+
"docs": {
|
|
215
|
+
"tags": [],
|
|
216
|
+
"text": "Define as series a serem apresentadas no gr\u00E1fico"
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
"width": {
|
|
220
|
+
"type": "number",
|
|
221
|
+
"mutable": false,
|
|
222
|
+
"complexType": {
|
|
223
|
+
"original": "number",
|
|
224
|
+
"resolved": "number",
|
|
225
|
+
"references": {}
|
|
226
|
+
},
|
|
227
|
+
"required": false,
|
|
228
|
+
"optional": false,
|
|
229
|
+
"docs": {
|
|
230
|
+
"tags": [],
|
|
231
|
+
"text": "Define uma largura do gr\u00E1fico"
|
|
232
|
+
},
|
|
233
|
+
"attribute": "width",
|
|
234
|
+
"reflect": false
|
|
235
|
+
},
|
|
236
|
+
"height": {
|
|
237
|
+
"type": "number",
|
|
238
|
+
"mutable": false,
|
|
239
|
+
"complexType": {
|
|
240
|
+
"original": "number",
|
|
241
|
+
"resolved": "number",
|
|
242
|
+
"references": {}
|
|
243
|
+
},
|
|
244
|
+
"required": false,
|
|
245
|
+
"optional": false,
|
|
246
|
+
"docs": {
|
|
247
|
+
"tags": [],
|
|
248
|
+
"text": "Define a altura do gr\u00E1fico"
|
|
249
|
+
},
|
|
250
|
+
"attribute": "height",
|
|
251
|
+
"reflect": false
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
static get events() {
|
|
256
|
+
return [{
|
|
257
|
+
"method": "ezSerieClick",
|
|
258
|
+
"name": "ezSerieClick",
|
|
259
|
+
"bubbles": true,
|
|
260
|
+
"cancelable": true,
|
|
261
|
+
"composed": true,
|
|
262
|
+
"docs": {
|
|
263
|
+
"tags": [],
|
|
264
|
+
"text": "Evento emitido quando ocorre um click em uma serie do gr\u00E1fico"
|
|
265
|
+
},
|
|
266
|
+
"complexType": {
|
|
267
|
+
"original": "SerieClickEvent",
|
|
268
|
+
"resolved": "{ name: string; data: number[]; type: string; yAxis: number; }",
|
|
269
|
+
"references": {
|
|
270
|
+
"SerieClickEvent": {
|
|
271
|
+
"location": "import",
|
|
272
|
+
"path": "./interfaces/ChartSerie"
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}];
|
|
277
|
+
}
|
|
278
|
+
static get watchers() {
|
|
279
|
+
return [{
|
|
280
|
+
"propName": "type",
|
|
281
|
+
"methodName": "handleTypeChange"
|
|
282
|
+
}];
|
|
283
|
+
}
|
|
284
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export class ChartContext {
|
|
2
|
+
constructor(strategy) {
|
|
3
|
+
this.strategy = strategy;
|
|
4
|
+
}
|
|
5
|
+
setStrategy(strategy) {
|
|
6
|
+
this.strategy = strategy;
|
|
7
|
+
}
|
|
8
|
+
render(container, series, xAxis, yAxis, options) {
|
|
9
|
+
return this.strategy.render(container, series, xAxis, yAxis, options);
|
|
10
|
+
}
|
|
11
|
+
destroy() {
|
|
12
|
+
return this.strategy.destroy();
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
export const mockChartProp = {
|
|
2
|
+
chartTitle: "Titulo do gráfico",
|
|
3
|
+
chartSubTitle: "Sub-titulo do gráfico",
|
|
4
|
+
series: [{
|
|
5
|
+
name: 'Qtd. Vendas',
|
|
6
|
+
data: [23, 20, 22, 26, 24, 28],
|
|
7
|
+
yAxis: 1,
|
|
8
|
+
showDataLabel: true,
|
|
9
|
+
}, {
|
|
10
|
+
name: 'Vlr. Vendas',
|
|
11
|
+
data: [25600, 21600, 24500, 26890, 20560, 22508],
|
|
12
|
+
yAxis: 0,
|
|
13
|
+
toolTipFormatter: jest.fn(),
|
|
14
|
+
}],
|
|
15
|
+
yAxis: [{
|
|
16
|
+
text: 'Valor das vendas no semestre',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
text: 'Quantidade de itens vendidos',
|
|
20
|
+
invertedPosition: true,
|
|
21
|
+
}],
|
|
22
|
+
xAxis: {
|
|
23
|
+
text: 'Defina uma descrição para o eixo',
|
|
24
|
+
formatter: jest.fn(),
|
|
25
|
+
color: '#008561',
|
|
26
|
+
categories: ['Jan', 'Feb', 'Mar', 'Abr', 'Mai', 'Jun']
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const expectChart = {
|
|
31
|
+
title: { text: "Titulo do gráfico" },
|
|
32
|
+
subtitle: { text: "Sub-titulo do gráfico" },
|
|
33
|
+
tooltip: { formatter: function () { return jest.fn(); } },
|
|
34
|
+
yAxis: [
|
|
35
|
+
{
|
|
36
|
+
title: { text: "Valor das vendas no semestre" }
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
title: { text: "Quantidade de itens vendidos" },
|
|
40
|
+
opposite: true,
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
xAxis: {
|
|
44
|
+
categories: ["Jan", "Feb", "Mar", "Abr", "Mai", "Jun"],
|
|
45
|
+
title: {
|
|
46
|
+
text: "Defina uma descrição para o eixo",
|
|
47
|
+
style: { color: "#008561" }
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
series: [{
|
|
51
|
+
name: "Qtd. Vendas",
|
|
52
|
+
data: [23, 20, 22, 26, 24, 28],
|
|
53
|
+
dataLabels: { enabled: true },
|
|
54
|
+
yAxis: 1,
|
|
55
|
+
}, {
|
|
56
|
+
name: "Vlr. Vendas",
|
|
57
|
+
data: [25600, 21600, 24500, 26890, 20560, 22508],
|
|
58
|
+
yAxis: 0,
|
|
59
|
+
}],
|
|
60
|
+
rules: [
|
|
61
|
+
{
|
|
62
|
+
condition: { maxWidth: 500 },
|
|
63
|
+
chartOptions: {
|
|
64
|
+
legend: { enabled: false },
|
|
65
|
+
xAxis: {
|
|
66
|
+
labels: { enabled: false },
|
|
67
|
+
gridLineWidth: 0,
|
|
68
|
+
},
|
|
69
|
+
yAxis: {
|
|
70
|
+
labels: { enabled: false },
|
|
71
|
+
gridLineWidth: 0,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
condition: { maxWidth: 600 },
|
|
77
|
+
chartOptions: {
|
|
78
|
+
xAxis: {
|
|
79
|
+
labels: {
|
|
80
|
+
style: { fontSize: "10px" },
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
yAxis: {
|
|
84
|
+
labels: {
|
|
85
|
+
style: { fontSize: "10px" },
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
title: {
|
|
89
|
+
style: { fontSize: "14px" },
|
|
90
|
+
},
|
|
91
|
+
subtitle: {
|
|
92
|
+
style: { fontSize: "12px" },
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
condition: { maxWidth: 400 },
|
|
98
|
+
chartOptions: {
|
|
99
|
+
chart: { margin: [10, 10, 15, 10] },
|
|
100
|
+
subtitle: { text: null },
|
|
101
|
+
title: { text: null },
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
credits: { enabled: false },
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
export const mockChartPieProp = {
|
|
110
|
+
chartTitle: "Titulo do gráfico",
|
|
111
|
+
chartSubTitle: "Sub-titulo do gráfico",
|
|
112
|
+
series: {
|
|
113
|
+
name: 'venda',
|
|
114
|
+
data: [
|
|
115
|
+
{ name: 'Chrome', y: 74.03 },
|
|
116
|
+
{ name: 'Edge', y: 12.66 },
|
|
117
|
+
{ name: 'Firefox', y: 4 },
|
|
118
|
+
{ name: 'Internet Explorer', y: 2 },
|
|
119
|
+
{ name: 'Other', y: 3 }
|
|
120
|
+
],
|
|
121
|
+
showDataLabel: true,
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export const expectPieChart = {
|
|
126
|
+
series: [{
|
|
127
|
+
name: "venda",
|
|
128
|
+
data: [
|
|
129
|
+
{ name: 'Chrome', y: 74.03 },
|
|
130
|
+
{ name: 'Edge', y: 12.66 },
|
|
131
|
+
{ name: 'Firefox', y: 4 },
|
|
132
|
+
{ name: 'Internet Explorer', y: 2 },
|
|
133
|
+
{ name: 'Other', y: 3 }
|
|
134
|
+
],
|
|
135
|
+
dataLabels: { enabled: true },
|
|
136
|
+
}],
|
|
137
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
export class BaseHighChartsRender {
|
|
2
|
+
parseSerie(series) {
|
|
3
|
+
if (Array.isArray(series)) {
|
|
4
|
+
const seriesOptions = series.map(serie => this.chartSerieToSeriesOptions(serie));
|
|
5
|
+
return seriesOptions;
|
|
6
|
+
}
|
|
7
|
+
const seriesOptions = this.chartSerieToSeriesOptions(series);
|
|
8
|
+
return [seriesOptions];
|
|
9
|
+
}
|
|
10
|
+
parseAxis(axis) {
|
|
11
|
+
if (Array.isArray(axis)) {
|
|
12
|
+
const axisOptions = axis.map(value => this.chartAxisToAxisOptions(value));
|
|
13
|
+
return axisOptions;
|
|
14
|
+
}
|
|
15
|
+
const axisOptions = this.chartAxisToAxisOptions(axis);
|
|
16
|
+
return axisOptions;
|
|
17
|
+
}
|
|
18
|
+
parseTitle(title) {
|
|
19
|
+
return {
|
|
20
|
+
text: title,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
parseSubTitle(subTtile) {
|
|
24
|
+
return {
|
|
25
|
+
text: subTtile,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
buildFormatterTooltip(series) {
|
|
29
|
+
const seriesArray = Array.isArray(series) ? series : [series];
|
|
30
|
+
return {
|
|
31
|
+
formatter: function (tooltip) {
|
|
32
|
+
const indexSerie = seriesArray.findIndex(serie => serie.name === this.series.name && serie.toolTipFormatter);
|
|
33
|
+
if (indexSerie !== -1) {
|
|
34
|
+
return seriesArray[indexSerie].toolTipFormatter(this.series.name, this.x, this.y, this.point.name, this.point.percentage);
|
|
35
|
+
}
|
|
36
|
+
return tooltip.defaultFormatter.call(this, tooltip);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
buildOnClickCallBack(evt) {
|
|
41
|
+
return function (_e) {
|
|
42
|
+
evt.emit({
|
|
43
|
+
name: this.series.name,
|
|
44
|
+
data: this.series.data,
|
|
45
|
+
type: this.series.type,
|
|
46
|
+
yAxis: this.x,
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
buildResposiveConfig() {
|
|
51
|
+
return {
|
|
52
|
+
rules: [
|
|
53
|
+
{
|
|
54
|
+
condition: {
|
|
55
|
+
maxWidth: 500
|
|
56
|
+
},
|
|
57
|
+
chartOptions: {
|
|
58
|
+
legend: {
|
|
59
|
+
enabled: false
|
|
60
|
+
},
|
|
61
|
+
xAxis: {
|
|
62
|
+
labels: {
|
|
63
|
+
enabled: false
|
|
64
|
+
},
|
|
65
|
+
gridLineWidth: 0
|
|
66
|
+
},
|
|
67
|
+
yAxis: {
|
|
68
|
+
labels: {
|
|
69
|
+
enabled: false
|
|
70
|
+
},
|
|
71
|
+
gridLineWidth: 0
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
condition: {
|
|
77
|
+
maxWidth: 600
|
|
78
|
+
},
|
|
79
|
+
chartOptions: {
|
|
80
|
+
xAxis: {
|
|
81
|
+
labels: {
|
|
82
|
+
style: {
|
|
83
|
+
fontSize: '10px'
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
yAxis: {
|
|
88
|
+
labels: {
|
|
89
|
+
style: {
|
|
90
|
+
fontSize: '10px'
|
|
91
|
+
},
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
title: {
|
|
95
|
+
style: {
|
|
96
|
+
fontSize: '14px'
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
subtitle: {
|
|
100
|
+
style: {
|
|
101
|
+
fontSize: '12px'
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
condition: {
|
|
108
|
+
maxWidth: 400
|
|
109
|
+
},
|
|
110
|
+
chartOptions: {
|
|
111
|
+
chart: {
|
|
112
|
+
margin: [10, 10, 15, 10],
|
|
113
|
+
},
|
|
114
|
+
subtitle: {
|
|
115
|
+
text: null
|
|
116
|
+
},
|
|
117
|
+
title: {
|
|
118
|
+
text: null
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
]
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
buildDefaultChartOptions() {
|
|
126
|
+
return {
|
|
127
|
+
credits: {
|
|
128
|
+
enabled: false
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
chartSerieToSeriesOptions(serie) {
|
|
133
|
+
const { name, data, color, showDataLabel, type, yAxis } = serie;
|
|
134
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (name && { name })), (type && { type })), (data && { data })), (color && { color })), (showDataLabel && { dataLabels: { enabled: showDataLabel } })), (yAxis !== undefined && { yAxis }));
|
|
135
|
+
}
|
|
136
|
+
chartAxisToAxisOptions(axis) {
|
|
137
|
+
const { categories, color, text, invertedPosition, formatter } = axis;
|
|
138
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({}, (categories && { categories })), (text && {
|
|
139
|
+
title: Object.assign({ text }, (color && { style: { color } }))
|
|
140
|
+
})), (formatter && {
|
|
141
|
+
labels: {
|
|
142
|
+
formatter: function () { return formatter(this.value); },
|
|
143
|
+
}
|
|
144
|
+
})), (invertedPosition && { opposite: invertedPosition }));
|
|
145
|
+
}
|
|
146
|
+
}
|