Aller au contenu principal
Version: v1

charts()

This function is used to generate a chart of the top users in a guild.

Parameters

ParameterTypeRequiredDescription
messageMessageThe message object.
optionsChartOptionsThe options for the chart.

Returns <MessageAttachment>

Image

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

OptionsTypeRequiredDefaultDescription
positionNumber5Number of users needed to be in the chart
backgroundHex CodeGREYBackground color of the chart
typeChart TypebarAny one from these 'line' (or) 'bar' (or) 'radar' (or) 'doughnut' (or) 'polarArea