O'Reilly logo

Mastering Angular Components by Gion Kunz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating an activity chart

It's time to create our first chart component using Chartist! However, before we get into our component, we need to make sure that Chartist is installed within our project. Let's use npm to install Chartist as a dependency:

npm install chartist@0.11.0 @types/chartist@0.9.40 --save

Chartist is currently written in pure JavaScript. Luckily, the community created a very sophisticated type definition for Chartist, so you can benefit from typed interfaces when using Chartist with TypeScript.

Okay; that's all it takes to get us going with Chartist. Now, let's create our activity chart using the Angular CLI:

ng generate component --spec false -ve none -cd onpush projects-dashboard/activity-chart

Let's open the generated ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required