Class WidgetTrends
Represents the WidgetTrends class which extends the WidgetBase class.
Inherited Members
Namespace: DataWeb.Dashboard.Widgets
Assembly: DataWeb.Core.dll
Syntax
public class WidgetTrends : WidgetBase
Constructors
WidgetTrends(IServiceProvider)
Declaration
public WidgetTrends(IServiceProvider serviceProvider)
Parameters
Type | Name | Description |
---|---|---|
IServiceProvider | serviceProvider |
Methods
GetDataAsync(Panel, Dictionary<string, object>, IUser)
Gets the data for the widget.
Declaration
public override Task<BaseData> GetDataAsync(Panel panel, Dictionary<string, object> widgetSettings, IUser user)
Parameters
Type | Name | Description |
---|---|---|
Panel | panel | The Panel that the widget belongs to. |
Dictionary<string, object> | widgetSettings | The widget settings. |
IUser | user | The IUser who is viewing the widget. |
Returns
Type | Description |
---|---|
Task<BaseData> | The widget data. |
Overrides
GetDefaultSettingsAsync(Panel, IUser)
Gets the default settings for the widget.
Declaration
public override Task<Dictionary<string, object>> GetDefaultSettingsAsync(Panel panel, IUser user)
Parameters
Type | Name | Description |
---|---|---|
Panel | panel | The Panel that the widget belongs to. |
IUser | user | The IUser who is viewing the widget. |
Returns
Type | Description |
---|---|
Task<Dictionary<string, object>> | A dictionary of default settings. |
Overrides
GetOptionsAsync(Panel, Dictionary<string, object>, IUser)
Gets the options for the widget.
Declaration
public override Task<BaseOptions> GetOptionsAsync(Panel panel, Dictionary<string, object> widgetSettings, IUser user)
Parameters
Type | Name | Description |
---|---|---|
Panel | panel | The Panel that the widget belongs to. |
Dictionary<string, object> | widgetSettings | The widget settings. |
IUser | user | The IUser who is viewing the widget. |
Returns
Type | Description |
---|---|
Task<BaseOptions> | The widget options. |
Overrides
GetPeriodData(string, DateTime?, DateTime?)
Gets the period data for a given period mode and optional start and end dates.
Declaration
public virtual WidgetTrends.WidgetPeriodData GetPeriodData(string periodMode, DateTime? periodDateStart = null, DateTime? periodDateEnd = null)
Parameters
Type | Name | Description |
---|---|---|
string | periodMode | The period mode as a string (e.g. "Today", "CurrentWeek", "CurrentMonth", etc.). |
DateTime? | periodDateStart | Optional start date for custom period mode. |
DateTime? | periodDateEnd | Optional end date for custom period mode. |
Returns
Type | Description |
---|---|
WidgetTrends.WidgetPeriodData | A WidgetPeriodData object containing the period data, including start and end dates, aggregation mode, and description. |
GetPeriodModes()
Gets a list of period modes for selection in the user interface.
Declaration
public virtual List<List.ListItem> GetPeriodModes()
Returns
Type | Description |
---|---|
List<List.ListItem> | A list of List.ListItem objects representing the available period modes. |
GetStartOfWeek(DateTime, DayOfWeek)
Gets the start date of the week that contains the given date, based on the specified starting day of the week.
Declaration
public DateTime GetStartOfWeek(DateTime date, DayOfWeek startOfWeek)
Parameters
Type | Name | Description |
---|---|---|
DateTime | date | The date for which to find the start of the week. |
DayOfWeek | startOfWeek | The day of the week that represents the start of the week (e.g. DayOfWeek.Monday). |
Returns
Type | Description |
---|---|
DateTime | A DateTime object representing the start date of the week. |
UpdateSettingsAsync(Panel, Dictionary<string, object>, Dictionary<string, object>, IUser)
Updates the widget settings.
Declaration
public override Task UpdateSettingsAsync(Panel panel, Dictionary<string, object> providedSettings, Dictionary<string, object> widgetSettings, IUser user)
Parameters
Type | Name | Description |
---|---|---|
Panel | panel | The Panel that the widget belongs to. |
Dictionary<string, object> | providedSettings | The provided settings. |
Dictionary<string, object> | widgetSettings | The widget settings. |
IUser | user | The IUser who is viewing the widget. |
Returns
Type | Description |
---|---|
Task | A task that represents the asynchronous operation. |
Overrides
ValidateSettingsAsync(Panel, Dictionary<string, object>, Dictionary<string, object>, IUser)
Validates the widget settings.
Declaration
public override Task<List<ValidationError>> ValidateSettingsAsync(Panel panel, Dictionary<string, object> providedSettings, Dictionary<string, object> widgetSettings, IUser user)
Parameters
Type | Name | Description |
---|---|---|
Panel | panel | The Panel that the widget belongs to. |
Dictionary<string, object> | providedSettings | The provided settings. |
Dictionary<string, object> | widgetSettings | The widget settings. |
IUser | user | The IUser who is viewing the widget. |
Returns
Type | Description |
---|---|
Task<List<ValidationError>> | The list of validation errors. |