@qfo/qfchart 0.5.0 → 0.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -21,12 +21,14 @@ QFChart is a lightweight, feature-rich financial charting library designed for b
21
21
  - **📈 Overlay Indicators** - Add indicators directly on top of the main chart (SMA, Bollinger Bands, etc.)
22
22
  - **🔍 Interactive Zoom** - Smooth zooming and panning with customizable data range controls
23
23
 
24
- ### Drawing Tools
24
+ ### Drawing Tools (Plugins)
25
+
26
+ A plugin system is used to allow adding custom drawing tools to the charts.
27
+ Currently available plugins :
25
28
 
26
29
  - **✏️ Line Drawing** - Draw trend lines and support/resistance levels
27
30
  - **📏 Fibonacci Retracements** - Interactive Fibonacci levels with automatic ratio calculations
28
31
  - **📐 Measure Tool** - Measure price and time distances between any two points
29
- - **🎨 Customizable Styles** - Full control over colors, line widths, and visual appearance
30
32
 
31
33
  ### Layout & Customization
32
34
 
@@ -47,19 +49,23 @@ QFChart is a lightweight, feature-rich financial charting library designed for b
47
49
  ### Browser (UMD)
48
50
 
49
51
  ```html
50
- <script src="https://unpkg.com/@qfo/qfchart/dist/qfchart.min.browser.js"></script>
52
+ <!-- 1. Include ECharts (Required) -->
53
+ <script src="https://cdn.jsdelivr.net/npm/echarts/dist/echarts.min.js"></script>
54
+
55
+ <!-- 2. Include QFChart -->
56
+ <script src="https://cdn.jsdelivr.net/npm/@qfo/qfchart/dist/qfchart.min.browser.js"></script>
51
57
  ```
52
58
 
53
59
  ### NPM
54
60
 
55
61
  ```bash
56
- npm install @qfo/qfchart
62
+ npm install @qfo/qfchart echarts
57
63
  ```
58
64
 
59
65
  ### Yarn
60
66
 
61
67
  ```bash
62
- yarn add @qfo/qfchart
68
+ yarn add @qfo/qfchart echarts
63
69
  ```
64
70
 
65
71
  ## 🚀 Quick Start
@@ -125,23 +131,24 @@ chart.addIndicator('SMA_20', smaPlots, {
125
131
 
126
132
  // Add separate pane indicator (e.g., MACD)
127
133
  const macdPlots = {
128
- macd: {
134
+ histogram: {
129
135
  data: [
136
+ { time: 1748217600000, value: 513.1184116809054, options: { color: '#26A69A' } },
130
137
  /* ... */
131
138
  ],
132
- options: { style: 'line', color: '#2962FF' },
139
+ options: { style: 'histogram', color: '#26A69A' },
133
140
  },
134
- signal: {
141
+ macd: {
135
142
  data: [
136
143
  /* ... */
137
144
  ],
138
- options: { style: 'line', color: '#FF6D00' },
145
+ options: { style: 'line', color: '#2962FF' },
139
146
  },
140
- histogram: {
147
+ signal: {
141
148
  data: [
142
149
  /* ... */
143
150
  ],
144
- options: { style: 'histogram', color: '#26A69A' },
151
+ options: { style: 'line', color: '#FF6D00' },
145
152
  },
146
153
  };
147
154
 
package/dist/index.d.ts CHANGED
@@ -23,13 +23,16 @@ interface IndicatorPoint {
23
23
  value: number | null;
24
24
  options?: {
25
25
  color?: string;
26
+ offset?: number;
26
27
  };
27
28
  }
28
- type IndicatorStyle = 'line' | 'columns' | 'histogram' | 'circles' | 'cross' | 'background';
29
+ type IndicatorStyle = 'line' | 'step' | 'columns' | 'histogram' | 'circles' | 'cross' | 'background';
29
30
  interface IndicatorOptions {
30
31
  style: IndicatorStyle;
31
32
  color: string;
33
+ offset?: number;
32
34
  linewidth?: number;
35
+ smooth?: boolean;
33
36
  }
34
37
  interface IndicatorPlot {
35
38
  data: IndicatorPoint[];