Skip to content

Commit

Permalink
create UTs and sandbox example
Browse files Browse the repository at this point in the history
  • Loading branch information
Tan Phat VO authored and Tan Phat VO committed Dec 24, 2024
1 parent 7ca4dd1 commit 8a99056
Show file tree
Hide file tree
Showing 3 changed files with 429 additions and 0 deletions.
51 changes: 51 additions & 0 deletions e2e/Sandbox/DashboardCreators/AreaVisualizationDashboard.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
using Reveal.Sdk.Dom;
using Reveal.Sdk.Dom.Data;
using Reveal.Sdk.Dom.Filters;
using Reveal.Sdk.Dom.Visualizations;
using Sandbox.DashboardFactories;
using Sandbox.Helpers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Sandbox.DashboardCreators
{
internal class AreaVisualizationDashboard : IDashboardCreator
{
public string Name => "Area Visualization";

public RdashDocument CreateDashboard()
{
var document = new RdashDocument("My Dashboard");

var excelDataSourceItem = new RestDataSourceItem("Marketing Sheet")
{
Subtitle = "Excel Data Source Item",
Url = "http://dl.infragistics.com/reportplus/reveal/samples/Samples.xlsx",
IsAnonymous = true,
Fields = DataSourceFactory.GetMarketingDataSourceFields(),
};
excelDataSourceItem.UseExcel("Marketing");

document.Visualizations.Add(new AreaChartVisualization("Area", excelDataSourceItem)
{
IsTitleVisible = true,
Description = "Create Area Visualization"
}
.SetLabel(new DateDataField("Date") { AggregationType = DateAggregationType.Month })
.SetValues("Paid Traffic", "Organic Traffic", "Other Traffic")
.ConfigureSettings(settings =>
{
settings.Trendline = TrendlineType.LinearFit;
settings.ShowLegend = true;
}));

document.Filters.Add(new DashboardDataFilter("Spend", excelDataSourceItem));
document.Filters.Add(new DashboardDateFilter("My Date Filter"));

return document;
}
}
}
1 change: 1 addition & 0 deletions e2e/Sandbox/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public partial class MainWindow : Window
{
new AmazonAthenaDashboard(),
new AmazonRedshiftDashboard(),
new AreaVisualizationDashboard(),
new CampaignsDashboard(),
new CustomDashboard(),
new DashboardLinkingDashboard(),
Expand Down
Loading

0 comments on commit 8a99056

Please sign in to comment.