charts()
This function is used to generate a chart of the top users in a guild.
Parametersβ
Parameter | Type | Required | Description |
---|---|---|---|
message | Message | β | The message object. |
options | ChartOptions | β | The options for the chart. |
Returns <MessageAttachment>
β
Throwsβ
new Error()
- if invalid parameters are provided, or if there are not enough users to create a chart.
[JS] Exampleβ
const {charts} = require("simply-xp");
charts(message, options)
.then(console.log) // Returns the chart object
.catch((err) => console.log(err)); // Returns the error
Chart Optionsβ
Options | Type | Required | Default | Description |
---|---|---|---|---|
position | Number | β | 5 | Number of users needed to be in the chart |
background | Hex Code | β | GREY | Background color of the chart |
type | Chart Type | β | bar | Any one from these 'line' (or) 'bar' (or) 'radar' (or) 'doughnut' (or) 'polarArea |