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

CategoryBaseUnit

The baseUnit type of the category axis.

The possible values are:

  • BaseUnit—The base time interval for the axis labels.
  • "auto"—The base unit is automatically determined by the minimum difference between subsequent categories.
  • "fit"—The categoryAxis.baseUnitStep and base unit are adjusted so that the number of categories does not exceed categoryAxis.maxDateGroups, and the series.aggregate function is used to aggregate data based on the selected base unit.
ts
import { Component } from '@angular/core';
import { CategoryBaseUnit } from '@progress/kendo-angular-charts';

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

type CategoryBaseUnit = "milliseconds" | "seconds" | "minutes" | "hours" | "days" | "weeks" | "months" | "years" | "auto" | "fit";

Not finding the help you need?
Contact Support