11<template >
22 <f7-page >
3- <f7-navbar title =" Area Chart" back-link = " Back " />
4- <f7-block strong-ios outline-ios >
3+ <f7-navbar title =" Area Chart" back-link />
4+ <f7-block strong inset >
55 <p >Framework7 comes with simple to use and fully responsive Area Chart component.</p >
66 <p >
77 Area Chart generates SVG layout which makes it also compatible with SSR (server side
88 rendering).
99 </p >
1010 </f7-block >
1111 <f7-block-title >Simple Area Chart</f7-block-title >
12- <f7-block strong-ios outline-ios >
12+ <f7-block strong inset >
1313 <f7-area-chart
1414 :datasets =" [
15- {
16- color: '#f00',
17- values: [0, 100, 250, 300, 175, 400],
18- },
19- {
20- color: '#00f',
21- values: [100, 75, 133, 237, 40, 200],
22- },
23- {
24- color: '#ff0',
25- values: [100, 300, 127, 40, 250, 80],
26- },
15+ { color: '#f00', values: [0, 100, 250, 300, 175, 400] },
16+ { color: '#00f', values: [100, 75, 133, 237, 40, 200] },
17+ { color: '#ff0', values: [100, 300, 127, 40, 250, 80] },
2718 ]"
2819 />
2920 </f7-block >
3021 <f7-block-title >Area Chart With Tooltip</f7-block-title >
31- <f7-block strong-ios outline-ios >
22+ <f7-block strong inset >
3223 <f7-area-chart
3324 tooltip
3425 :datasets =" [
35- {
36- label: 'Red data',
37- color: '#f00',
38- values: [100, 75, 133, 237, 40, 200],
39- },
40- {
41- label: 'Blue data',
42- color: '#00f',
43- values: [100, 300, 127, 40, 250, 80],
44- },
45- {
46- label: 'Yellow data',
47- color: '#ff0',
48- values: [0, 100, 250, 300, 175, 400],
49- },
26+ { label: 'Red data', color: '#f00', values: [100, 75, 133, 237, 40, 200] },
27+ { label: 'Blue data', color: '#00f', values: [100, 300, 127, 40, 250, 80] },
28+ { label: 'Yellow data', color: '#ff0', values: [0, 100, 250, 300, 175, 400] },
5029 ]"
5130 />
5231 </f7-block >
5332 <f7-block-title >Area Chart With Axis</f7-block-title >
54- <f7-block strong-ios outline-ios >
33+ <f7-block strong inset >
5534 <f7-area-chart
5635 tooltip
5736 axis
5837 :axis-labels =" dates"
5938 :format-axis-label =" (date) => axisDateFormat.format(date)"
6039 :format-tooltip-axis-label =" (date) => tooltipDateFormat.format(date)"
6140 :datasets =" [
62- {
63- label: 'Green data',
64- color: '#0f0',
65- values: [100, 75, 133, 237],
66- },
67- {
68- label: 'Red data',
69- color: '#f00',
70- values: [100, 300, 127, 47],
71- },
72- {
73- label: 'Yellow data',
74- color: '#ff0',
75- values: [0, 100, 250, 307],
76- },
41+ { label: 'Green data', color: '#0f0', values: [100, 75, 133, 237] },
42+ { label: 'Red data', color: '#f00', values: [100, 300, 127, 47] },
43+ { label: 'Yellow data', color: '#ff0', values: [0, 100, 250, 307] },
7744 ]"
7845 />
7946 </f7-block >
8047 <f7-block-title >Area Chart With Legend</f7-block-title >
81- <f7-block strong-ios outline-ios >
48+ <f7-block strong inset >
8249 <f7-area-chart
8350 tooltip
8451 axis
8855 :format-axis-label =" (date) => axisDateFormat.format(date)"
8956 :format-tooltip-axis-label =" (date) => tooltipDateFormat.format(date)"
9057 :datasets =" [
91- {
92- label: 'Red data',
93- color: '#f00',
94- values: [100, 300, 127, 47],
95- },
96- {
97- label: 'Blue data',
98- color: '#00f',
99- values: [100, 75, 133, 237],
100- },
101- {
102- label: 'Yellow data',
103- color: '#ff0',
104- values: [0, 100, 250, 307],
105- },
58+ { label: 'Red data', color: '#f00', values: [100, 300, 127, 47] },
59+ { label: 'Blue data', color: '#00f', values: [100, 75, 133, 237] },
60+ { label: 'Yellow data', color: '#ff0', values: [0, 100, 250, 307] },
10661 ]"
10762 />
10863 </f7-block >
10964 <f7-block-title >Lines Chart</f7-block-title >
110- <f7-block strong-ios outline-ios >
65+ <f7-block strong inset >
11166 <f7-area-chart
11267 tooltip
11368 axis
11873 :format-axis-label =" (date) => axisDateFormat.format(date)"
11974 :format-tooltip-axis-label =" (date) => tooltipDateFormat.format(date)"
12075 :datasets =" [
121- {
122- label: 'Red data',
123- color: '#f00',
124- values: [0, 300, 127, 47],
125- },
126- {
127- label: 'Blue data',
128- color: '#00f',
129- values: [0, 75, 133, 237],
130- },
131- {
132- label: 'Green data',
133- color: '#0f0',
134- values: [0, 100, 250, 307],
135- },
76+ { label: 'Red data', color: '#f00', values: [0, 300, 127, 47] },
77+ { label: 'Blue data', color: '#00f', values: [0, 75, 133, 237] },
78+ { label: 'Green data', color: '#0f0', values: [0, 100, 250, 307] },
13679 ]"
13780 />
13881 </f7-block >
14285import { f7Page , f7Navbar , f7BlockTitle , f7Block , f7AreaChart } from ' framework7-vue' ;
14386
14487export default {
145- components: {
146- f7Page,
147- f7Navbar,
148- f7BlockTitle,
149- f7Block,
150- f7AreaChart,
151- },
88+ components: { f7Page, f7Navbar, f7BlockTitle, f7Block, f7AreaChart },
15289 setup () {
15390 // helpers data for axis
15491 const dates = [];
@@ -160,11 +97,7 @@ export default {
16097 }
16198 const axisDateFormat = Intl .DateTimeFormat (undefined , { month: ' short' , year: ' numeric' });
16299 const tooltipDateFormat = Intl .DateTimeFormat (undefined , { month: ' long' , year: ' numeric' });
163- return {
164- dates,
165- axisDateFormat,
166- tooltipDateFormat,
167- };
100+ return { dates, axisDateFormat, tooltipDateFormat };
168101 },
169102};
170103 </script >
0 commit comments