Skip to content
EliteChart

Resolution

Documentation


Documentation / @elitechart/core / Resolution

code
type Resolution = 
  | {
  kind: "seconds";
  value: number;
}
  | {
  kind: "minutes";
  value: number;
}
  | {
  kind: "hours";
  value: number;
}
  | {
  kind: "days";
  value: number;
}
  | {
  kind: "weeks";
  value: number;
}
  | {
  kind: "months";
  value: number;
};

Defined in: data/types.ts:65

Bar resolution, as a tagged union. Use resolutionToMs to project to an approximate millisecond duration for axis math.

Example

code
const r: Resolution = { kind: 'minutes', value: 5 };
const oneDay: Resolution = { kind: 'days', value: 1 };