Create a Custom Chart Using the CLI
A complete example of creating a custom chart using the custom chart CLI can be found in A Custom Chart Tutorial.
Custom chart CLI version 5 only supports the use of
vnd.composer.v2+json as the
Content-Type for API routes. CLI version 4 only supports the use of
To create a custom chart locally using the custom chart CLI:
- Open the Composer CLI.
Run the following command to create the visual.
$ zd-chart init <path-to-visual>
Optionally, you can provide a type parameter. Valid values are
raw. The default is
single-group. For example:
$ zd-chart init -t multi-group <path-to-visual>
zd-chart init command creates a directory in the specified path containing the files you need to get started. Here is a preview of the directory tree:
The following table describes the function of each file in the tree:
|Lists the packages your visual depends on. For more information, see https://docs.npmjs.com/creating-a-package-json-file.|
|Your visual's CSS (style sheet) code.|
|Contains the name, controls, and variables of your visual.|
|The webpack configuration. Webpack is used in visuals to bundle your code into a single file.|