Create a table chart

Our first Smart Chart example will be a simple table: however you may choose to make it as complex and customized as you wish.

We will code it in three steps:

  1. Creating the chart in your agent (so that the data can be dynamically loaded)

  2. Loading that data inside of the component (and passing it down to the template)

  3. Writing a template

agent.addChart('myTableChart', async (context, resultBuilder) => {
  // You may want to load the data dynamically
  // [...]

  return resultBuilder.smart([
    { username: 'Darth Vador', points: 1500000 },
    { username: 'Luke Skywalker', points: 2 },
  ]);
});

Last updated

Revision created on 5/31/2023