|
5 | 5 | <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
6 | 6 | <title>QFChart - Demo</title> |
7 | 7 |
|
8 | | - <style> |
9 | | - body { |
10 | | - background-color: #0f172a; |
11 | | - margin: 0; |
12 | | - display: flex; |
13 | | - flex-direction: column; |
14 | | - align-items: center; |
15 | | - justify-content: center; |
16 | | - min-height: 100vh; |
17 | | - color: #cbd5e1; |
18 | | - font-family: 'Segoe UI', system-ui, sans-serif; |
19 | | - } |
20 | | - |
21 | | - #container { |
22 | | - width: 100%; |
23 | | - max-width: 90vw; |
24 | | - margin: 0 auto; |
25 | | - padding: 1.5rem; |
26 | | - background-color: #1e293b; |
27 | | - border: 1px solid #334155; |
28 | | - border-radius: 8px; |
29 | | - box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2); |
30 | | - } |
31 | | - |
32 | | - h1 { |
33 | | - color: #5eead4; |
34 | | - font-size: 2rem; |
35 | | - margin-bottom: 1rem; |
36 | | - text-align: center; |
37 | | - } |
38 | | - |
39 | | - #main-chart { |
40 | | - width: 100%; |
41 | | - height: 100%; |
42 | | - } |
43 | | - a { |
44 | | - color: #5eead4; |
45 | | - } |
46 | | - </style> |
| 8 | + <link rel="stylesheet" href="styles.css" /> |
47 | 9 | </head> |
48 | 10 |
|
49 | 11 | <body> |
| 12 | + <nav> |
| 13 | + <a href="https://quantforgeorg.github.io/QFChart/" target="_blank"> |
| 14 | + <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> |
| 15 | + <path |
| 16 | + d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z" |
| 17 | + /> |
| 18 | + </svg> |
| 19 | + QFChart on GitHub |
| 20 | + </a> |
| 21 | + </nav> |
50 | 22 | <div id="container"> |
51 | | - <!-- <h1>QFChart Library Demo</h1> --> |
| 23 | + <h1>Full featured Demo</h1> |
52 | 24 | <p> |
53 | | - This is a demo of the QFChart library. It uses the |
54 | | - <a href="https://github.com/QuantForgeOrg/PineTS" target="_blank">PineTS</a> library to get the data and the indicators. |
| 25 | + This demo uses the |
| 26 | + <a href="https://github.com/QuantForgeOrg/PineTS" target="_blank">PineTS</a> library to load the maret data and calculate multiple |
| 27 | + indicators. |
55 | 28 | </p> |
56 | 29 | <hr /> |
57 | 30 | <div id="main-chart"><center>Loading...</center></div> |
|
102 | 75 | const chartContainer = document.getElementById('main-chart'); |
103 | 76 | window.chart = new QFChart.QFChart(chartContainer, { |
104 | 77 | title: 'BTC/USDT', // Custom title |
105 | | - height: '840px', |
| 78 | + height: '800px', |
106 | 79 | padding: 0.2, |
107 | 80 | databox: { |
108 | 81 | position: 'right', |
|
137 | 110 | // Group plots into one indicator |
138 | 111 | chart.addIndicator('MACD', macdPlots, { |
139 | 112 | isOverlay: false, |
140 | | - height: 16, |
| 113 | + height: 14, |
141 | 114 | titleColor: '#ff9900', |
142 | 115 | controls: { collapse: true, maximize: true }, |
143 | 116 | }); |
144 | 117 |
|
145 | 118 | chart.addIndicator('SQZMOM', sqzmomPlots, { |
146 | 119 | isOverlay: false, |
147 | | - height: 16, |
| 120 | + height: 14, |
148 | 121 | controls: { collapse: true, maximize: true }, |
149 | 122 | }); |
150 | 123 |
|
|
0 commit comments