Installation
Install Neural Charts Native, configure the Angular Native host and render your first chart with typed data.
Data and grouped options
The data input carries the original values and structure for the selected chart. Import its public type, such as NativeLineData, and use satisfies to check your object. Cartesian data includes the axis definitions that interpret its coordinates. Visual settings such as axis titles, colours and tooltips belong to options.
Before you start
Start with Angular 22.2 or later in the 22.x series, Angular Native 0.25.0, Expo SDK 58 (58.0.16 or later within 58.0.x), React Native 0.88.x and react-native-svg 15.15.4. These requirements also let you install Neural Native 0.1.0-beta.9 in the same app. Expo Go for SDK 58 ships with SVG 15.16.0, so create an Expo development build with SVG 15.15.4 on iOS and Android.
Install with npm
Run this in the root of your app. npm installs the Core version required by this beta automatically.
npm install @neural-charts/native@0.1.0-beta.7Configure the native host
Add this configuration to metro.config.js at the application root, beside package.json. If the file already exists, merge it with your current configuration. Wrap the app with GestureRoot as shown in the component below.
const { getDefaultConfig } = require('expo/metro-config');
const { withAngularNative } = require('@ng-native/metro/config.cjs');
module.exports = withAngularNative(getDefaultConfig(__dirname));Create the chart screen
This complete component contains the imports, sample data, template and ChartScreen class. Use its chart-screen.ts file as the screen in your existing Angular Native app. If GestureRoot already wraps your app, keep that root and place only neu-c-chart inside the screen template.
import {Component, signal} from '@angular/core';
import {GestureRoot} from '@ng-native/components/gestures';
import {NativeDataChart, NativeChartType, type NativeLineData, type NativeChartOptions}
from '@neural-charts/native';
const visits = {
type: NativeChartType.Line,
axes: {
x: {type:'category', values:[{id:'mon',label:'Mon'},{id:'tue',label:'Tue'}]},
y: {type:'linear'},
},
series: [{id:'visits',name:'Visits',data:[
{id:'mon',x:'mon',y:29}, {id:'tue',x:'tue',y:0},
]}],
} as const satisfies NativeLineData;
@Component({
imports: [GestureRoot, NativeDataChart],
template: '<gesture-root><neu-c-chart [data]="data()" [options]="options" /></gesture-root>',
})
export class ChartScreen {
readonly data = signal<NativeLineData>(visits);
readonly options = {
title: 'Weekly visits',
axes: {y: {title:'Visits'}},
legend: {position:'bottom'},
tooltip: {content:'shared', pinnable:true},
} as const satisfies NativeChartOptions<NativeChartType.Line>;
}If iOS cannot resolve ExpoModulesCore
If Xcode reports “Unable to resolve module dependency: ExpoModulesCore” in NgNativeExpo, Expo SDK 58 lets you compile its modules from source. Run npx expo install expo-build-properties and set ios.usePrecompiledModules to false. Then run npx expo prebuild --platform ios and rebuild the app.
["expo-build-properties", {"ios": {"usePrecompiledModules": false}}]