-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Tan Phat VO
authored and
Tan Phat VO
committed
Dec 24, 2024
1 parent
7ca4dd1
commit 0061719
Showing
3 changed files
with
434 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.