From e111a335eea5784317ea029b10b0f6809ffbcf0a Mon Sep 17 00:00:00 2001 From: Fernando Jesus Date: Mon, 28 Jun 2021 11:32:39 -0300 Subject: [PATCH 1/5] feat: config init --- src/assets/scss/_multi-axis-line.scss | 3 + .../ChartMultiAxisLine.stories.js | 180 ++++++++++++++ .../MultiAxisLine/ChartMultiAxisLine.vue | 61 +++++ .../Charts/MultiAxisLine/MultiAxisLine.vue | 221 ++++++++++++++++++ 4 files changed, 465 insertions(+) create mode 100644 src/assets/scss/_multi-axis-line.scss create mode 100644 src/components/Charts/MultiAxisLine/ChartMultiAxisLine.stories.js create mode 100644 src/components/Charts/MultiAxisLine/ChartMultiAxisLine.vue create mode 100644 src/components/Charts/MultiAxisLine/MultiAxisLine.vue diff --git a/src/assets/scss/_multi-axis-line.scss b/src/assets/scss/_multi-axis-line.scss new file mode 100644 index 00000000..dc7f9c4b --- /dev/null +++ b/src/assets/scss/_multi-axis-line.scss @@ -0,0 +1,3 @@ +.multiaxisline { + +} diff --git a/src/components/Charts/MultiAxisLine/ChartMultiAxisLine.stories.js b/src/components/Charts/MultiAxisLine/ChartMultiAxisLine.stories.js new file mode 100644 index 00000000..b1892faf --- /dev/null +++ b/src/components/Charts/MultiAxisLine/ChartMultiAxisLine.stories.js @@ -0,0 +1,180 @@ +import ChartMultiAxisLine from './ChartMultiAxisLine'; + +export default { + title: 'Components/UI Elements/Charts/Multi Axis Line', + component: ChartMultiAxisLine, + argTypes: {}, + + parameters: { + componentSubtitle: '', + }, +}; + +const Template = (args, { argTypes }) => ({ + props: Object.keys(argTypes), + components: { ChartMultiAxisLine }, + template: + '
', +}); + +export const Default = Template.bind({}); +Default.args = { + id: 'lineSeries', + chartdata: { + labels: [ + '2021-05-02 08:35:00', + '2021-05-02 08:40:00', + '2021-05-02 08:45:00', + '2021-05-02 08:50:00', + '2021-05-02 08:55:00', + '2021-05-02 09:00:00', + '2021-05-02 09:05:00', + '2021-05-02 09:10:00', + '2021-05-02 09:15:00', + '2021-05-02 09:20:00', + '2021-05-02 09:25:00', + '2021-05-02 09:30:00', + '2021-05-02 09:35:00', + '2021-05-02 09:40:00', + '2021-05-02 09:45:00', + '2021-05-02 09:50:00', + '2021-05-02 09:55:00', + '2021-05-02 10:00:00', + '2021-05-02 10:05:00', + '2021-05-02 10:10:00', + '2021-05-02 10:15:00', + '2021-05-02 10:20:00', + '2021-05-02 10:25:00', + '2021-05-02 10:30:00', + '2021-05-02 10:35:00', + '2021-05-02 10:40:00', + '2021-05-02 10:45:00', + '2021-05-02 10:50:00', + '2021-05-02 10:55:00', + '2021-05-02 11:00:00', + '2021-05-02 11:05:00', + '2021-05-02 11:10:00', + '2021-05-02 11:15:00', + '2021-05-02 11:20:00', + '2021-05-02 11:25:00', + '2021-05-02 11:30:00', + '2021-05-02 11:35:00', + '2021-05-02 11:40:00', + '2021-05-02 11:45:00', + '2021-05-02 11:50:00', + '2021-05-02 11:55:00', + '2021-05-02 12:00:00', + '2021-05-02 12:05:00', + '2021-05-02 12:10:00', + '2021-05-02 12:15:00', + '2021-05-02 12:20:00', + '2021-05-02 12:25:00', + '2021-05-02 12:30:00', + '2021-05-02 12:35:00', + '2021-05-02 12:40:00', + '2021-05-02 12:45:00', + '2021-05-02 12:50:00', + '2021-05-02 12:55:00', + '2021-05-02 13:00:00', + '2021-05-02 13:05:00', + '2021-05-02 13:10:00', + '2021-05-02 13:15:00', + '2021-05-02 13:20:00', + '2021-05-02 13:25:00', + '2021-05-02 13:30:00', + '2021-05-02 13:35:00', + '2021-05-02 13:40:00', + '2021-05-02 13:45:00', + '2021-05-02 13:50:00', + '2021-05-02 13:55:00', + '2021-05-02 14:00:00', + '2021-05-02 14:05:00', + '2021-05-02 14:10:00', + '2021-05-02 14:15:00', + '2021-05-02 14:20:00', + '2021-05-02 14:25:00', + '2021-05-02 14:30:00', + '2021-05-02 14:35:00', + '2021-05-02 14:40:00', + '2021-05-02 14:45:00', + '2021-05-02 14:50:00', + '2021-05-02 14:55:00', + '2021-05-02 15:00:00', + '2021-05-02 15:05:00', + '2021-05-02 15:10:00', + '2021-05-02 15:15:00', + '2021-05-02 15:20:00', + '2021-05-02 15:25:00', + '2021-05-02 15:30:00', + '2021-05-02 15:35:00', + '2021-05-02 15:40:00', + '2021-05-02 15:45:00', + '2021-05-02 15:50:00', + '2021-05-02 15:55:00', + '2021-05-02 16:00:00', + '2021-05-02 16:05:00', + '2021-05-02 16:10:00', + '2021-05-02 16:15:00', + '2021-05-02 16:20:00', + '2021-05-02 16:25:00', + '2021-05-02 16:30:00', + '2021-05-02 16:35:00', + '2021-05-02 16:40:00', + '2021-05-02 16:45:00', + '2021-05-02 16:50:00', + '2021-05-02 16:55:00', + '2021-05-02 17:00:00', + '2021-05-02 17:05:00', + '2021-05-02 17:10:00', + '2021-05-02 17:15:00', + '2021-05-02 17:20:00', + '2021-05-02 17:25:00', + '2021-05-02 17:30:00', + '2021-05-02 17:35:00', + '2021-05-02 17:40:00', + '2021-05-02 17:45:00', + '2021-05-02 17:50:00', + '2021-05-02 17:55:00', + '2021-05-02 18:00:00', + '2021-05-02 18:05:00', + '2021-05-02 18:10:00', + '2021-05-02 18:15:00', + '2021-05-02 18:20:00', + '2021-05-02 18:25:00', + '2021-05-02 18:30:00', + '2021-05-02 18:35:00', + '2021-05-02 18:40:00', + '2021-05-02 18:45:00', + '2021-05-02 18:50:00', + '2021-05-02 18:55:00', + '2021-05-02 19:00:00', + '2021-05-02 19:05:00', + '2021-05-02 19:10:00', + '2021-05-02 19:15:00', + '2021-05-02 19:20:00', + '2021-05-02 19:25:00', + '2021-05-02 19:30:00', + '2021-05-02 19:35:00', + '2021-05-02 19:40:00', + ], + datasets: [ + 1.58, 0, 32.17, 130.41, 152.04, 219.25, 315.12, 355.18, 340.2, 384.2, + 440.88, 570.94, 666.36, 728.67, 830.4, 910.6, 1053.48, 1238.45, 1434.0, + 1603.63, 1641.0, 2050.56, 1976.66, 2030.88, 2115.69, 2220.6, 2372.27, + 2477.52, 2546.01, 3023.88, 2469.67, 3296.04, 2617.04, 2585.28, 1763.4, + 3900.0, 4298.69, 4201.99, 5008.92, 5083.34, 5471.16, 3449.02, 3016.56, + 4365.27, 5618.64, 3973.61, 6084.24, 6173.22, 4879.32, 5627.32, 6508.92, + 6198.5, 5076.6, 4448.35, 4306.17, 6917.16, 6582.7, 5364.24, 4537.69, + 7593.6, 7423.71, 5655.12, 7373.86, 7680.72, 7092.6, 7877.52, 3505.61, + 8016.12, 7103.68, 6443.76, 7365.48, 7766.73, 7965.84, 7419.61, 6157.08, + 6525.51, 5015.76, 2655.09, 3865.92, 7358.93, 7781.88, 8215.83, 7939.32, + 7405.77, 7129.91, 7610.16, 6672.52, 7426.92, 7000.74, 3681.24, 7058.05, + 4632.48, 7234.43, 7169.76, 7083.45, 7164.84, 7009.53, 6734.76, 6835.06, + 5748.44, 6464.28, 7041.79, 2805.12, 2283.17, 3211.68, 5297.78, 5661.84, + 6750.06, 6218.52, 5852.59, 3534.44, 1330.32, 725.66, 609.6, 742.88, + 1111.32, 1465.16, 1599.72, 1672.62, 1637.88, 1456.62, 964.32, 515.92, + 378.72, 202.76, 62.23, 80.52, 88.62, 96.84, 96.92, 75.36, 61.53, 56.28, + 19.81, + ], + }, +}; diff --git a/src/components/Charts/MultiAxisLine/ChartMultiAxisLine.vue b/src/components/Charts/MultiAxisLine/ChartMultiAxisLine.vue new file mode 100644 index 00000000..41adedd3 --- /dev/null +++ b/src/components/Charts/MultiAxisLine/ChartMultiAxisLine.vue @@ -0,0 +1,61 @@ + + + + + diff --git a/src/components/Charts/MultiAxisLine/MultiAxisLine.vue b/src/components/Charts/MultiAxisLine/MultiAxisLine.vue new file mode 100644 index 00000000..c29b919e --- /dev/null +++ b/src/components/Charts/MultiAxisLine/MultiAxisLine.vue @@ -0,0 +1,221 @@ + From 3477d25a425208d89deeaf44b253c22e42d42837 Mon Sep 17 00:00:00 2001 From: Fernando Jesus Date: Mon, 28 Jun 2021 22:00:53 -0300 Subject: [PATCH 2/5] feat: style chart --- src/assets/scss/_chart_multi-axis-line.scss | 11 ++ src/assets/scss/_multi-axis-line.scss | 3 - src/components/Charts/Bar/Bar.vue | 3 - src/components/Charts/Bar/ChartBar.stories.js | 2 +- .../LineSeries/ChartLineSeries.stories.js | 2 +- .../Charts/LineSeries/LineSeries.vue | 39 ++++- .../ChartMultiAxisLine.stories.js | 56 ++++--- .../MultiAxisLine/ChartMultiAxisLine.vue | 13 +- .../Charts/MultiAxisLine/MultiAxisLine.vue | 157 +++++++++--------- src/index.js | 4 +- 10 files changed, 160 insertions(+), 130 deletions(-) create mode 100644 src/assets/scss/_chart_multi-axis-line.scss delete mode 100644 src/assets/scss/_multi-axis-line.scss diff --git a/src/assets/scss/_chart_multi-axis-line.scss b/src/assets/scss/_chart_multi-axis-line.scss new file mode 100644 index 00000000..29f0b8c4 --- /dev/null +++ b/src/assets/scss/_chart_multi-axis-line.scss @@ -0,0 +1,11 @@ +.multi-axis-line { + .print { + @apply flex items-center uppercase cursor-pointer text-gray4 text-tiny leading-tight; + + &:before { + content: ''; + @apply w-6 h-6 block mr-1; + background: url(~@img/icon/print-image.svg) no-repeat center center; + } + } +} diff --git a/src/assets/scss/_multi-axis-line.scss b/src/assets/scss/_multi-axis-line.scss deleted file mode 100644 index dc7f9c4b..00000000 --- a/src/assets/scss/_multi-axis-line.scss +++ /dev/null @@ -1,3 +0,0 @@ -.multiaxisline { - -} diff --git a/src/components/Charts/Bar/Bar.vue b/src/components/Charts/Bar/Bar.vue index 9147f6d2..bd968d1c 100644 --- a/src/components/Charts/Bar/Bar.vue +++ b/src/components/Charts/Bar/Bar.vue @@ -121,9 +121,6 @@ export default { radius: 0, }, }, - hover: { - animationDuration: 1, - }, tooltips: { yAlign: 'bottom', xAlign: 'center', diff --git a/src/components/Charts/Bar/ChartBar.stories.js b/src/components/Charts/Bar/ChartBar.stories.js index e5aae72f..6d2a1e52 100644 --- a/src/components/Charts/Bar/ChartBar.stories.js +++ b/src/components/Charts/Bar/ChartBar.stories.js @@ -21,7 +21,7 @@ export default { const Template = (args, { argTypes }) => ({ props: Object.keys(argTypes), components: { ChartBar }, - template: '
', + template: '
', }); export const Default = Template.bind({}); diff --git a/src/components/Charts/LineSeries/ChartLineSeries.stories.js b/src/components/Charts/LineSeries/ChartLineSeries.stories.js index 200eb100..beb5f3e5 100644 --- a/src/components/Charts/LineSeries/ChartLineSeries.stories.js +++ b/src/components/Charts/LineSeries/ChartLineSeries.stories.js @@ -14,7 +14,7 @@ const Template = (args, { argTypes }) => ({ props: Object.keys(argTypes), components: { ChartLineSeries }, template: - '
', + '
', }); export const Default = Template.bind({}); diff --git a/src/components/Charts/LineSeries/LineSeries.vue b/src/components/Charts/LineSeries/LineSeries.vue index 9bbb248a..7b0ac071 100644 --- a/src/components/Charts/LineSeries/LineSeries.vue +++ b/src/components/Charts/LineSeries/LineSeries.vue @@ -1,10 +1,38 @@ diff --git a/src/components/Charts/MultiAxisLine/MultiAxisLine.vue b/src/components/Charts/MultiAxisLine/MultiAxisLine.vue index c29b919e..d0c38b5e 100644 --- a/src/components/Charts/MultiAxisLine/MultiAxisLine.vue +++ b/src/components/Charts/MultiAxisLine/MultiAxisLine.vue @@ -1,10 +1,38 @@