When a JavaScript chart library offers an API, it expands the options for developers. However, a JavaScript API only reaches its true value when a dev understands all the possible events available to work with. In order to help you see all the ways you can use the API with ZingChart, we’ve created an API event playground.

The ZingChart JavaScript API Event Playground showcases and allows you to experiment with the ZingChart API. The playground allows you to toggle events, fire events, and get info, for more than 35 chart events.

playground representing JavaScript API event playground

You can run these events on three types of charts:

  1. Default bar chart
  2. Feed chart with live data
  3. History chart with drilldown functionality

Using the JavaScript API Event Playground

When you interact with the chart, a console view shows you the JSON that is returned and logged from the event.

demo of  javascript api event playground in action

All events return data about the object to which they relate. Interaction events, like nodeclick or plotmouseover, return information about the part of the chart with which you’re interacting. Data manipulation events return information about what was changed on the chart, including the JSON passed to any of the data manipulation methods like setdata or modify.

More JavaScript API For your Buck

What can you do with event data? Just about anything you want. Make AJAX requests, modify DOM elements, even draw new charts. The ZingChart Events API ties nicely with the ZingChart Methods API, allowing for extremely customizable chart interactions. By using the Event Playground, you can determine exactly what events you need to make a fantastic interactive chart.

button to try the javascript api event playground

A Better ZingChart

This is just one way our team has been hard at work to make it easier to include and customize our interactive charts in your projects. You might also be interested in these helpful options: