├── .idea
├── inspectionProfiles
│ └── Project_Default.xml
├── misc.xml
├── modules.xml
├── vcs.xml
├── vue-KLineChart.iml
└── workspace.xml
├── README.md
├── babel.config.js
├── package.json
├── public
├── favicon.ico
└── index.html
└── src
├── App.vue
├── assets
└── logo.png
├── components
├── KlinChart.vue
└── kLineConfig
│ └── config.js
└── main.js
/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/vue-KLineChart.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/workspace.xml:
--------------------------------------------------------------------------------
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 | config
54 | hasOwnProperty
55 |
56 |
57 |
58 |
59 |
60 |
61 |
68 |
69 |
70 |
71 |
72 |
73 |
74 | true
75 | DEFINITION_ORDER
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 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 | 1587017625472
179 |
180 |
181 | 1587017625472
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # vue_klineChart
2 |
3 | klinechart 是一个轻量级的K线图插件(基于html5 canvas构建,图表支持20种技术指标,支持自定义指标参数,支持绘制标记图形,支持自定义样式) https://github.com/liihuu/KLineChart
4 |
5 | 相比tradingview 更适合小白
6 |
7 | ## Project setup
8 |
9 | ```
10 | npm install
11 | ```
12 |
13 | ### Compiles and hot-reloads for development
14 | ```
15 | npm run serve
16 | ```
17 |
18 | ### Compiles and minifies for production
19 | ```
20 | npm run build
21 | ```
22 |
23 | ### Run your tests
24 | ```
25 | npm run test
26 | ```
27 |
28 | ### Lints and fixes files
29 | ```
30 | npm run lint
31 | ```
32 |
33 | ### Customize configuration
34 | See [Configuration Reference](https://cli.vuejs.org/config/).
35 |
--------------------------------------------------------------------------------
/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | '@vue/cli-plugin-babel/preset'
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "vue_klineChart",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "serve": "vue-cli-service serve",
7 | "build": "vue-cli-service build",
8 | "lint": "vue-cli-service lint"
9 | },
10 | "dependencies": {
11 | "core-js": "^3.6.4",
12 | "klinecharts": "^5.1.1",
13 | "vue": "^2.6.11"
14 | },
15 | "devDependencies": {
16 | "@vue/cli-plugin-babel": "^4.3.0",
17 | "@vue/cli-plugin-eslint": "^4.3.0",
18 | "@vue/cli-service": "^4.3.0",
19 | "babel-eslint": "^10.1.0",
20 | "eslint": "^6.7.2",
21 | "eslint-plugin-vue": "^6.2.2",
22 | "vue-template-compiler": "^2.6.11"
23 | },
24 | "eslintConfig": {
25 | "root": true,
26 | "env": {
27 | "node": true
28 | },
29 | "extends": [
30 | "plugin:vue/essential",
31 | "eslint:recommended"
32 | ],
33 | "parserOptions": {
34 | "parser": "babel-eslint"
35 | },
36 | "rules": {}
37 | },
38 | "browserslist": [
39 | "> 1%",
40 | "last 2 versions",
41 | "not dead"
42 | ]
43 | }
44 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/waveTan/vue-KLineChart/ffb87959692c740edc27b4893e0871314291ac63/public/favicon.ico
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | <%= htmlWebpackPlugin.options.title %>
9 |
10 |
11 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |

4 |
5 |
6 |
7 |
8 |
9 |
19 |
20 |
34 |
--------------------------------------------------------------------------------
/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/waveTan/vue-KLineChart/ffb87959692c740edc27b4893e0871314291ac63/src/assets/logo.png
--------------------------------------------------------------------------------
/src/components/KlinChart.vue:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
144 |
145 |
197 |
--------------------------------------------------------------------------------
/src/components/kLineConfig/config.js:
--------------------------------------------------------------------------------
1 | export const config = {
2 | grid: {
3 | display: true,
4 | horizontal: {
5 | display: true,
6 | size: 1,
7 | color: '#393939',
8 | // 'solid'|'dash'
9 | style: 'dash',
10 | dashValue: [2, 2]
11 | },
12 | vertical: {
13 | display: false,
14 | size: 1,
15 | color: '#393939',
16 | // 'solid'|'dash'
17 | style: 'dash',
18 | dashValue: [2, 2]
19 | }
20 | },
21 | candleStick: {
22 | bar: {
23 | // 'solid'|'stroke'|'up_stroke'|'down_stroke'|'ohlc'
24 | style: 'solid',
25 | upColor: '#26A69A',
26 | downColor: '#EF5350',
27 | noChangeColor: '#666666'
28 | },
29 | priceMark: {
30 | display: true,
31 | high: {
32 | display: true,
33 | color: '#D9D9D9',
34 | textMargin: 5,
35 | textSize: 10
36 | },
37 | low: {
38 | display: true,
39 | color: '#D9D9D9',
40 | textMargin: 5,
41 | textSize: 10
42 | },
43 | last: {
44 | display: true,
45 | upColor: '#26A69A',
46 | downColor: '#EF5350',
47 | noChangeColor: '#666666',
48 | line: {
49 | display: true,
50 | // 'solid'|'dash'
51 | style: 'dash',
52 | dashValue: [4, 4],
53 | size: 1
54 | },
55 | text: {
56 | display: true,
57 | size: 12,
58 | paddingLeft: 2,
59 | paddingTop: 2,
60 | paddingRight: 2,
61 | paddingBottom: 2,
62 | color: '#FFFFFF'
63 | }
64 | }
65 | }
66 | },
67 | realTime: {
68 | timeLine: {
69 | color: '#1e88e5',
70 | size: 1,
71 | areaFillColor: 'rgba(30, 136, 229, 0.08)'
72 | },
73 | averageLine: {
74 | display: true,
75 | color: '#F5A623',
76 | size: 1
77 | }
78 | },
79 | technicalIndicator: {
80 | bar: {
81 | upColor: '#26A69A',
82 | downColor: '#EF5350',
83 | noChangeColor: '#666666'
84 | },
85 | line: {
86 | size: 1,
87 | colors: ['#D9D9D9', '#F5A623', '#F601FF', '#1587DD', '#1e88e5']
88 | }
89 | },
90 | xAxis: {
91 | display: true,
92 | maxHeight: 50,
93 | minHeight: 30,
94 | axisLine: {
95 | display: true,
96 | color: '#888888',
97 | size: 1
98 | },
99 | tickText: {
100 | display: true,
101 | color: '#D9D9D9',
102 | size: 12,
103 | margin: 3
104 | },
105 | tickLine: {
106 | display: true,
107 | size: 1,
108 | length: 3,
109 | color: '#888888'
110 | }
111 | },
112 | yAxis: {
113 | display: true,
114 | maxWidth: 100,
115 | minWidth: 60,
116 | // 'left' | 'right'
117 | position: 'right',
118 | // 'normal' | 'percentage'
119 | type: 'normal',
120 | axisLine: {
121 | display: true,
122 | color: '#888888',
123 | size: 1
124 | },
125 | tickText: {
126 | // 'outside' | 'inside'
127 | position: 'outside',
128 | display: true,
129 | color: '#D9D9D9',
130 | size: 12,
131 | margin: 3
132 | },
133 | tickLine: {
134 | display: true,
135 | size: 1,
136 | length: 3,
137 | color: '#888888'
138 | }
139 | },
140 | separator: {
141 | size: 1,
142 | color: '#888888',
143 | fill: true
144 | },
145 | floatLayer: {
146 | crossHair: {
147 | display: true,
148 | horizontal: {
149 | display: true,
150 | line: {
151 | display: true,
152 | // 'solid'|'dash'
153 | style: 'dash',
154 | dashValue: [4, 2],
155 | size: 1,
156 | color: '#888888'
157 | },
158 | text: {
159 | display: true,
160 | color: '#D9D9D9',
161 | size: 12,
162 | paddingLeft: 2,
163 | paddingRight: 2,
164 | paddingTop: 2,
165 | paddingBottom: 2,
166 | borderSize: 1,
167 | borderColor: '#505050',
168 | backgroundColor: '#505050'
169 | }
170 | },
171 | vertical: {
172 | display: true,
173 | line: {
174 | display: true,
175 | // 'solid'|'dash'
176 | style: 'dash',
177 | dashValue: [4, 2],
178 | size: 1,
179 | color: '#888888'
180 | },
181 | text: {
182 | display: true,
183 | color: '#D9D9D9',
184 | size: 12,
185 | paddingLeft: 2,
186 | paddingRight: 2,
187 | paddingTop: 2,
188 | paddingBottom: 2,
189 | borderSize: 1,
190 | borderColor: '#505050',
191 | backgroundColor: '#505050'
192 | }
193 | }
194 | },
195 | prompt: {
196 | // 'always' | 'follow_cross' | 'none'
197 | displayRule: 'always',
198 | candleStick: {
199 | // 'standard' | 'rect'
200 | showType: 'standard',
201 | labels: ['T', 'O', 'L', 'H', 'C', 'Vol'],
202 | values: null,
203 | rect: {
204 | paddingLeft: 0,
205 | paddingRight: 0,
206 | paddingTop: 0,
207 | paddingBottom: 6,
208 | left: 8,
209 | top: 8,
210 | right: 8,
211 | borderRadius: 4,
212 | borderSize: 1,
213 | borderColor: '#3f4254',
214 | fillColor: 'rgba(17, 17, 17, .3)'
215 | },
216 | text: {
217 | size: 12,
218 | color: '#D9D9D9',
219 | marginLeft: 8,
220 | marginTop: 6,
221 | marginRight: 8,
222 | marginBottom: 0
223 | }
224 | },
225 | technicalIndicator: {
226 | text: {
227 | size: 12,
228 | color: '#D9D9D9',
229 | marginTop: 6,
230 | marginRight: 8,
231 | marginBottom: 0,
232 | marginLeft: 8
233 | },
234 | point: {
235 | display: true,
236 | radius: 3
237 | }
238 | }
239 | }
240 | },
241 | graphicMark: {
242 | line: {
243 | color: '#1e88e5',
244 | size: 1
245 | },
246 | point: {
247 | backgroundColor: '#1e88e5',
248 | borderColor: '#1e88e5',
249 | borderSize: 1,
250 | radius: 4,
251 | activeBackgroundColor: '#1e88e5',
252 | activeBorderColor: '#1e88e5',
253 | activeBorderSize: 1,
254 | activeRadius: 6
255 | },
256 | text: {
257 | color: '#1e88e5',
258 | size: 12,
259 | marginLeft: 2,
260 | marginRight: 2,
261 | marginTop: 2,
262 | marginBottom: 6
263 | }
264 | }
265 | };
266 |
--------------------------------------------------------------------------------
/src/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | Vue.config.productionTip = false
5 |
6 | new Vue({
7 | render: h => h(App),
8 | }).$mount('#app')
9 |
--------------------------------------------------------------------------------