hyperprop-charting-library 0.1.44 → 0.1.45

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/docs/API.md CHANGED
@@ -65,6 +65,7 @@ Top-level options:
65
65
  - `priceLines?: PriceLineOptions[]`
66
66
  - `orderLines?: OrderLineOptions[]`
67
67
  - `tickerLine?: TickerLineOptions`
68
+ - `labels?: LabelsOptions` (TradingView-style price-scale/indicator label controls)
68
69
  - `dashPatterns?: Partial<DashPatternOptions>` (controls dotted/dashed spacing)
69
70
  - `indicators?: IndicatorInstanceOptions[]` (initial indicator instances, built-in includes `"volume"`)
70
71
 
@@ -150,6 +151,46 @@ watermark: {
150
151
  - `labelTextColor` (default `#0b1220`)
151
152
  - `labelBorderRadius` (default `3`)
152
153
 
154
+ ### `LabelsOptions`
155
+
156
+ TradingView-style labels can be controlled from a single top-level object:
157
+
158
+ - `visible` (default `true`, master switch for this label layer)
159
+ - `symbolName` (text for the symbol-name label)
160
+ - `showSymbolName` (default `false`)
161
+ - `showLastPrice` (default `true`; controls the ticker price tag, while `tickerLine.visible` still controls the line)
162
+ - `showPreviousClose` (default `false`)
163
+ - `previousClosePrice` (optional; falls back to the prior candle close)
164
+ - `showHighLow` (default `false`; labels visible-range high/low)
165
+ - `showBidAsk` (default `false`)
166
+ - `bidPrice`, `askPrice` (optional market data values for bid/ask labels)
167
+ - `showIndicatorNames` (default `false`; draws active indicator names in the chart)
168
+ - `showIndicatorValues` (default `false`; appends simple indicator input values)
169
+ - `showCountdownToBarClose` (default `false`; draws a bottom-axis countdown based on candle time spacing)
170
+ - `noOverlapping` (default `true`; stacks price-scale labels so they do not cover each other)
171
+ - Style fields: `backgroundColor`, `textColor`, `mutedTextColor`, `symbolNameBackgroundColor`, `symbolNameTextColor`, `previousCloseColor`, `highLowColor`, `bidColor`, `askColor`, `indicatorTextColor`, `borderRadius`, `labelHeight`, `labelPaddingX`
172
+
173
+ Example:
174
+
175
+ ```ts
176
+ createChart(root, {
177
+ labels: {
178
+ symbolName: "ESH6",
179
+ showSymbolName: true,
180
+ showPreviousClose: true,
181
+ previousClosePrice: 5231.25,
182
+ showHighLow: true,
183
+ showBidAsk: true,
184
+ bidPrice: 5234.75,
185
+ askPrice: 5235.0,
186
+ showIndicatorNames: true,
187
+ showIndicatorValues: true,
188
+ showCountdownToBarClose: true,
189
+ noOverlapping: true
190
+ }
191
+ });
192
+ ```
193
+
153
194
  ### `DashPatternOptions`
154
195
 
155
196
  - `dotted` (default `[2, 2]`)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hyperprop-charting-library",
3
- "version": "0.1.44",
3
+ "version": "0.1.45",
4
4
  "description": "Lightweight TypeScript charting core",
5
5
  "type": "module",
6
6
  "main": "./dist/hyperprop-charting-library.cjs",