forked from syncfusion/ej2-vue-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinversed-area.vue
142 lines (138 loc) · 3.54 KB
/
inversed-area.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<template>
<div class="control-section">
<div>
<ejs-stockchart
style="display:block"
id="stockchartcontainerinversed"
:primaryXAxis="primaryXAxis"
:primaryYAxis="primaryYAxis"
:chartArea="chartArea"
:crosshair="crosshair"
:seriesType="seriesType"
:title="title"
:theme="theme"
:indicatorType="indicator"
>
<e-stockchart-series-collection>
<e-stockchart-series
:dataSource="seriesData"
type="Area"
xName="x"
yName="high"
name="google"
opacity="0.5"
></e-stockchart-series>
</e-stockchart-series-collection>
</ejs-stockchart>
</div>
<div id="action-description">
<p> This sample visualizes stock data with inversed axis. Period and range selector help us to navigate different of data.</p>
</div>
<div id="description">
<p>
In this example, you can see how to render and configure the Stock chart.
<code>AreaSeries</code> is used to represent selected data value.
</p>
<br>
<p style="font-weight: 500">Injecting Module</p>
<p>
The Stock chart component features are segregated into individual feature-wise modules. To use date-time axis, inject
the
<code>DateTime</code> and <code>AreaSeries</code> module using <code> provide: { stockchart: [ DateTime, AreaSeries] },</code> method.
</p>
</div>
</div>
</template>
<script>
import Vue from "vue";
import { Browser } from "@syncfusion/ej2-base";
import { aapl } from "./stock-data";
import {
StockChartPlugin,
DateTime,
AreaSeries,
Crosshair,
LineSeries,
SplineSeries,
CandleSeries,
HiloOpenCloseSeries,
HiloSeries,
RangeAreaSeries,
Trendlines,
EmaIndicator,
RsiIndicator,
BollingerBands,
TmaIndicator,
MomentumIndicator,
SmaIndicator,
AtrIndicator,
AccumulationDistributionIndicator,
MacdIndicator,
StochasticIndicator,
Export
} from "@syncfusion/ej2-vue-charts";
Vue.use(StockChartPlugin);
let selectedTheme = location.hash.split("/")[1];
selectedTheme = selectedTheme ? selectedTheme : "Material";
let theme = (selectedTheme.charAt(0).toUpperCase() + selectedTheme.slice(1)).replace(/-dark/i, "Dark");
export default Vue.extend({
data: function() {
return {
seriesData: aapl,
theme: theme,
seriesType:[],
indicator: [],
//Initializing Primary X Axis
primaryXAxis: {
valueType: "DateTime",
isInversed: true,
majorGridLines: { width: 0 },
crosshairTooltip: { enable: true }
},
//Initializing Primary Y Axis
primaryYAxis: {
lineStyle: { color: "transparent" },
crosshairTooltip: { enable: true },
majorTickLines: { color: "transparent", width: 0 },
isInversed: true
},
crosshair: {
enable: true,
},
border : {width : 1},
title: 'AAPL Stock Price',
chartArea: {
border: {
width: 0
}
}
};
},
provide: {
stockChart: [
AreaSeries,
DateTime,
Crosshair,
LineSeries,
SplineSeries,
CandleSeries,
HiloOpenCloseSeries,
HiloSeries,
RangeAreaSeries,
Trendlines,
EmaIndicator,
RsiIndicator,
BollingerBands,
TmaIndicator,
MomentumIndicator,
SmaIndicator,
AtrIndicator,
AccumulationDistributionIndicator,
MacdIndicator,
StochasticIndicator,
Export
]
},
methods: {}
});
</script>