Added moving average computation
This commit is contained in:
23
README.md
23
README.md
@@ -16,17 +16,18 @@ Lightweight, canvas‑based charting library written in TypeScript, designed for
|
||||
|
||||
The `createChartElement(seriesList, options)` function supports the following options:
|
||||
|
||||
| Option | Type | Description |
|
||||
|------------------|-------------------------------------|-----------------------------------------------------------------------------|
|
||||
| `width` | `number` | Fixed chart width in pixels (optional, defaults to container width) |
|
||||
| `height` | `number` | Fixed chart height in pixels (optional, defaults to container height) |
|
||||
| `min` | `number` | Minimum Y-axis value (optional, auto-computed if not set) |
|
||||
| `max` | `number` | Maximum Y-axis value (optional, auto-computed if not set) |
|
||||
| `showYAxis` | `boolean` | Whether to render Y-axis ticks and labels |
|
||||
| `yTicks` | `number` | Number of Y-axis ticks (default: `5`) |
|
||||
| `backgroundColor`| `string` | Optional background fill color |
|
||||
| `maxTimeDelta` | `number \| null` | Gap in ms that breaks line continuity (default: `600`) |
|
||||
| `dateFormat` | `(ts: number) => string` | Custom formatter for the cursor timestamp label |
|
||||
| Option | Type | Description |
|
||||
|-------------------|--------------------------|----------------------------------------------------------------------------|
|
||||
| `width` | `number` | Fixed chart width in pixels (optional, defaults to container width) |
|
||||
| `height` | `number` | Fixed chart height in pixels (optional, defaults to container height) |
|
||||
| `min` | `number` | Minimum Y-axis value (optional, auto-computed if not set) |
|
||||
| `max` | `number` | Maximum Y-axis value (optional, auto-computed if not set) |
|
||||
| `showYAxis` | `boolean` | Whether to render Y-axis ticks and labels |
|
||||
| `yTicks` | `number` | Number of Y-axis ticks (default: `5`) |
|
||||
| `backgroundColor` | `string` | Optional background fill color |
|
||||
| `maxTimeDelta` | `number \| null` | Gap in ms that breaks line continuity (default: `600`) |
|
||||
| `dateFormat` | `(ts: number) => string` | Custom formatter for the cursor timestamp label |
|
||||
| `averageData` | `number` | Compute simple moving average of lasy n data to smooth out line (optional) |
|
||||
|
||||
```ts
|
||||
// Example: format timestamp to full Czech date+time
|
||||
|
||||
Reference in New Issue
Block a user