chartsVersion: v1.2
On this page
charts()
This function is used to generate a chart of the top users in a guild.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
| message | Message | ✅ | The message object. |
| options | ChartOptions | ❌ | The options for the chart. |
Returns
Section titled “Returns”- Promise<
MessageAttachment>

Throws
Section titled “Throws”new Error()- if the guild ID is missing.
[JS] Example
Section titled “[JS] Example”const { charts } = require("simply-xp");
charts(message, { type: "bar" }) .then((chart) => message.reply({ files: [chart] })) // Send the chart .catch((err) => console.log(err)); // Returns the errorChart Options
Section titled “Chart Options”| Options | Type | Required | Default | Description |
|---|---|---|---|---|
background |
Hex Code | ❌ | #2F3136 |
Background color of the chart |
type |
Chart Type | ❌ | bar | Any one from these 'bar' (or) 'line' (or) 'radar' (or) 'doughnut' (or) 'pie' (or) 'polarArea' |