Let's see step-by-step how to create a Kotlin JS application that uses Charts-kt.

This tutorial will help you understand how to:

  1. Set up a Kotlin Javascript project
  2. Import the libraries you need using your licence keys
  3. Create your first chart and launch it

What do you need?

Creating the Kotlin JS project

IntelliJ IDEA is the editor of choice for a Kotlin project. This tutorial works with the community (free) edition of IDEA as well as the ultimate edition.

Let's start by creating a new Kotlin project, and choose Browser Application.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/1112facc-4384-4440-b2eb-9adeedd57f6d/Untitled.png

Choose the name and location of your project.

As for the build system, Gradle is the preferred option but Maven also works.

We'll choose Gradle Kotlin for this tutorial, you can change it if you're more comfortable with Groovy.

Choose Java 8 or later as your project JDK.

For this tutorial we'll also use kotlinx.html, a convenient DSL to create HTML elements, so check the box:

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/856fb3b0-b86b-40d6-8e54-dc24d177ff77/Untitled.png

Checking the project