Skip to content

Commit

Permalink
create UTs
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 0061719
Show file tree
Hide file tree
Showing 3 changed files with 434 additions and 0 deletions.
53 changes: 53 additions & 0 deletions e2e/Sandbox/DashboardCreators/LineChartDashboard.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
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 LineChartDashboard : IDashboardCreator
{
public string Name => "Line Chart 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 LineChartVisualization("Line", excelDataSourceItem)
{
IsTitleVisible = true,
Description = "Create Line Visualization"
}
.SetLabel(new DateDataField("Date") { AggregationType = DateAggregationType.Month })
.SetValues("Paid Traffic", "Organic Traffic", "Other Traffic")
.ConfigureSettings(settings =>
{
settings.Trendline = TrendlineType.LinearFit;
settings.ShowLegend = true;
settings.ZoomLevel = 1;
settings.AutomaticLabelRotation = true;
settings.SyncAxis = true;
}));

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 @@ -50,6 +50,7 @@ public partial class MainWindow : Window
new DashboardLinkingDashboard(),
new GoogleBigQueryDashboard(),
new GoogleSheetDashboard(),
new LineChartDashboard(),
new HealthcareDashboard(),
new ManufacturingDashboard(),
new MarketingDashboard(),
Expand Down
Loading

0 comments on commit 0061719

Please sign in to comment.