Skip to content

interface for time scatter point #9215

Answered by etimberg
fab313 asked this question in Q&A
Mar 28, 2021 · 4 comments · 3 replies
Discussion options

You must be logged in to vote

The Chart type has a type parameter that lets you override this

import { DateTime } from 'luxon';
interface TimeDataPoint {
  x: DateTime;
  y: number;
};

const timeChart = new Chart<"line", TimeDataPoint>(ctx, {
  type: 'line',
  data: data,
  options: {
    scales: {
      x: { type: 'time' },
    }
  }
});

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@elvince
Comment options

@kurkle
Comment options

@elvince
Comment options

Answer selected by kurkle
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants
Converted from issue

This discussion was converted from issue #8746 on June 01, 2021 15:40.