Custom Chart API
Getting Started
The custom chart API provides developers with an interface to create interactive charts that integrate with the native Composer chart controls. To get started with the custom chart API, you need to install the Custom Chart CLI. The tool is designed to help you manage all aspects of the custom chart creation process in Composer.
Note: You must be an administrator to configure the chart CLI.
For more detailed step-by-step instructions on getting started, see A Custom Chart Tutorial.
Install Composer’s Custom Chart CLI
npm install composer-chart-cli@latest -g
Use the ComposerCustom Chart CLI
Configure the CLI.
cmp-chart config
Create a new custom chart.
cmp-chart init <some_path>/<your_chart_name>
From the newly created custom chart directory, run
npm install
— This will install your custom chart's development dependencies.Compile the custom chart code that will be pushed to the server
—npm run build
Push the custom chart to the server —
cmp-chart push
Enable the custom chart for a source. Navigate to the Sources page, locate a data source configuration to edit, and select the more menu (
) button. Select Available Visual Types, then locate and enable your chart in the Custom Visual Types list.
Create a new dashboard with your custom chart. You should see a chart widget with a Group and Metric picker.
You are now ready to continue building out your custom chart.
Add Custom Chart Packages
Run cmp-chart import <name> <filepath.zip>
to add the specified custom chart to the Composer server.
For more information about working with custom charts, see these topics:
Comments
0 comments
Please sign in to leave a comment.