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

CategoryBaseUnit

Specifies the baseUnit type of the category axis.

The possible values are:

  • BaseUnit—Sets the base time interval for the axis labels.
  • "auto"—Automatically determines the base unit by the minimum difference between subsequent categories.
  • "fit"—Adjusts the categoryAxis.baseUnitStep and base unit so that the number of categories does not exceed categoryAxis.maxDateGroups, and uses the series.aggregate function 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