chartjs / chartjs/Chart.js

TimePoint support for time series

Open
#11,611 2 comments 3 reactions 0 assignees View on GitHub
type: enhancement type: types
Dominant language
JavaScript
Stars
67.7k
Forks
11.9k
Avg merge
7h 39m
Merged PRs (30d)
5

Description

### Feature Proposal

Time series are so common, it seems like a TimePoint or something similar should be a standard point type with a structure like { date: Date | string, y: number }.

As I understand it, you currently have to define a custom data point type and discover this syntax for the chart data: ChartData<'line', TimePoint[]>.

The chart options don't seem to be aware of the custom data point type. The tooltip label callback doesn't know about the custom data point type, so I had to use a ts-ignore in my code to ignore the issue.

I'm not a full TS or chart.js expert, so I may have missed something, but that's kind of the point. Time series is one of the most common chart types and should be easy to use with TypeScript.

### Possible Implementation

Similar to BubblePoint, add a TimePoint type that supports Date objects and parsable date strings.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.