Skip to content

Commit ae4232e

Browse files
committed
Moved legend inside the chart to make it take less chart space
1 parent bb5906b commit ae4232e

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

ChildAllowanceManager/Components/Pages/ChildrenListPage.razor.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System.Collections.ObjectModel;
12
using ChildAllowanceManager.Common.Interfaces;
23
using ChildAllowanceManager.Common.Models;
34
using Microsoft.AspNetCore.Components;
@@ -6,10 +7,13 @@
67
using Plotly.Blazor;
78
using Plotly.Blazor.ConfigLib;
89
using Plotly.Blazor.LayoutLib;
10+
using Plotly.Blazor.LayoutLib.LegendLib;
911
using Plotly.Blazor.LayoutLib.YAxisLib;
1012
using Plotly.Blazor.Traces;
1113
using Plotly.Blazor.Traces.ScatterLib;
14+
using Font = Plotly.Blazor.LayoutLib.Font;
1215
using Margin = Plotly.Blazor.LayoutLib.Margin;
16+
using OrientationEnum = Plotly.Blazor.Traces.ScatterLib.OrientationEnum;
1317
using Title = Plotly.Blazor.LayoutLib.YAxisLib.Title;
1418

1519
namespace ChildAllowanceManager.Components.Pages;
@@ -82,6 +86,16 @@ public partial class ChildrenListPage : CancellableComponentBase, IDisposable
8286
},
8387
AutoSize = true,
8488
Margin = new Margin() { T = 40, R = 40, B = 40, L = 40},
89+
Legend = new List<Legend>()
90+
{
91+
new Legend()
92+
{
93+
X = 0,
94+
Y = 1,
95+
XAnchor = XAnchorEnum.Left,
96+
YAnchor = YAnchorEnum.Top
97+
}
98+
},
8599
};
86100

87101
private PlotlyChart _plotlyChart = null!; // referenced in razor page

0 commit comments

Comments
 (0)