New to Kendo UI for Angular? Start a free 30-day trial

BaseUnit

The baseUnit type of a X or Y axis.

The possible values are:

  • "milliseconds"—The base unit is milliseconds.
  • "seconds"—The base unit is seconds.
  • "minutes"—The base unit is minutes.
  • "hours"—The base unit is hours.
  • "days"—The base unit is days.
  • "weeks"—The base unit is weeks.
  • "months"—The base unit is months.
  • "years"—The base unit is years.
import { Component } from '@angular/core';
import { BaseUnit } from '@progress/kendo-angular-charts';

@Component({
  selector: 'my-app',
  template: `
    <kendo-chart>
      <kendo-chart-x-axis>
        <kendo-chart-x-axis-item [baseUnit]="baseUnit">
        </kendo-chart-x-axis-item>
      </kendo-chart-x-axis>
      <kendo-chart-series>
        <kendo-chart-series-item type="scatter" [data]="data">
        </kendo-chart-series-item>
      </kendo-chart-series>
    </kendo-chart>
  `
})
class AppComponent {
  public baseUnit: BaseUnit = "months";
  public data: any[] = [[new Date(2000, 0, 1), 1], [new Date(2001, 0, 1), 1]];
}

type BaseUnit = "milliseconds" | "seconds" | "minutes" | "hours" | "days" | "weeks" | "months" | "years";

In this article

Not finding the help you need?