Themes and presentation

Light and dark themes, palettes, and responsive rules.

Custom content

Project ncChartTitle, ncChartTooltip, ncChartLegend, ncChartAxisLabel or ncChartDataLabel templates. Use [content] for text retained on the server, for accessibility and on export. Label templates contain SVG tspan elements.

Customization with portable content
SlotContentBoundary
title / tooltip / legendTyped text and presentation template.Text remains available for SSR, accessibility and export.
axisLabel / dataLabelSVG tspanNo arbitrary HTML inside SVG.
contentA port separate from data and options.The library retains ownership of focus, buttons and cleanup.
chart-with-tooltip.ts
import { Component, input } from '@angular/core';
import {
  NeuralChart, NeuralChartTooltipTemplate, type ChartData, type ChartOptions,
} from '@neural-charts/angular';

@Component({
  selector: 'app-chart-with-tooltip',
  imports: [NeuralChart, NeuralChartTooltipTemplate],
  template: `
    <nc-chart [data]="data()" [options]="options" instanceId="tooltip-example">
      <ng-template ncChartTooltip let-tip><strong>{{ tip.text }}</strong></ng-template>
    </nc-chart>
  `,
})
export class ChartWithTooltip {
  readonly data = input.required<ChartData>();
  readonly options: ChartOptions = { tooltip: { enabled: true } };
}

Open template examples →

ChartContentSlotName

Import this enum to choose the part of the chart you customize. Each member retains the key used in content and selects its typed context.

TypeScript
import { ChartContentSlotName } from "@neural-charts/angular";
Title
title
Legend
legend
Tooltip
tooltip
AxisLabel
axisLabel
DataLabel
dataLabel

Applied theme

Choose the theme through options in your application. Heatmap and Tilemap colors encode a value scale; they are different from a series’ primary color.

Example
const options = { theme: 'dark', appearance: { colors: ['#2c6dcd', '#9a3b72'] } };

Contrast

Palettes accept validated HEX colors. Review custom combinations. Tables, labels and focus provide additional access; interpretation must not rely exclusively on color.

Styles by identity

appearance.series assigns color, dash and markers by stable series ID without putting presentation in data. circle, square, diamond and triangle markers distinguish lines and Scatter. diagonal, dots and crosshatch patterns distinguish fills beyond color and survive SVG/PNG export. fillOpacity controls areas. Legend options include reverse, interactive, maxLabelCharacters and itemSpacing while retaining full names and series colors.

series-appearance.ts
import type { ChartOptions } from '@neural-charts/angular';

export const options: ChartOptions = {
  "appearance": {
    "series": [
      {
        "id": "current",
        "color": "#2563eb",
        "dash": "dashed",
        "marker": "diamond",
        "pattern": "diagonal"
      }
    ]
  },
  "legend": {
    "interactive": true,
    "maxLabelCharacters": 32,
    "itemSpacing": 16
  }
};

Responsive rules

Charts fit the width of their container by default. Use responsive breakpoints to customize options at specific widths. The responsive field applies inclusive minWidth/maxWidth rules in declaration order against the owning container. Later matching fields win. Rules override height, legend, axes, appearance and tooltip with nested merging; arrays replace. Partial number formats inherit their same style, while an explicitly different style starts a complete formatter. Effective options are validated before application. Widening restores base options. Rules cannot change data, viewport, selection or observed width. SSR uses configured width or640px; the browser resolves against its real container.

Responsive without hidden settings
StepRule
1Start with base options.
2Match minWidth and maxWidth against the container, including boundaries.
3Merge matching rules in order; the last wins per field.
4When widening, restore the base when no rule matches.
responsive.ts
import type { ChartOptions } from '@neural-charts/angular';

export const options: ChartOptions = {
  "height": 420,
  "tooltip": {
    "enabled": true,
    "content": "shared"
  },
  "legend": {
    "position": "bottom"
  },
  "responsive": [
    {
      "maxWidth": 430,
      "options": {
        "height": 300,
        "tooltip": {
          "placement": "docked"
        },
        "axes": {
          "x": {
            "labels": {
              "maxCharacters": 12,
              "maxLines": 2
            }
          }
        },
        "appearance": {
          "dataLabels": false
        }
      }
    }
  ]
};