Skip to main content
cngx-src documentation

CngxChartSlotContext

Interface

projects/common/chart/chart/template-slots.ts

Referenced by#

Import#

import { CngxChartSlotContext } from '@cngx/common/chart'

Description#

Common context shape passed into every chart slot template (loading, empty, error). Carries the chart's current rendered dimensions plus a small discriminator so consumers can switch between a compact and a richer fallback in the same template:

<ng-template cngxChartEmpty let-small="small">
  @if (small) {
    <span class="cngx-empty-compact">No data</span>
  } @else {
    <cngx-empty-state title="No telemetry yet" description="..." />
  }
</ng-template>

The small flag is true when the chart's rendered width is below the threshold defined by the --cngx-chart-small-width-px CSS custom property (read from the chart at first render via the CHART_SMALL_BREAKPOINT_PX constant; default 400). Container-size based, not viewport-based, so it works correctly inside dashboard cells of any size.

Index#

Instance Properties#

height#number
Readonly
Readonly
width#number
Readonly