New to Kendo UI for AngularStart a free 30-day trial

BaseUnit

Specifies the baseUnit type of a X or Y axis.

The possible values are:

  • "milliseconds"—Sets the base unit to milliseconds.
  • "seconds"—Sets the base unit to seconds.
  • "minutes"—Sets the base unit to minutes.
  • "hours"—Sets the base unit to hours.
  • "days"—Sets the base unit to days.
  • "weeks"—Sets the base unit to weeks.
  • "months"—Sets the base unit to months.
  • "years"—Sets the base unit to years.
ts
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";

Not finding the help you need?
Contact Support