summaryrefslogtreecommitdiff
path: root/grapher/Models/Charts/ChartXY.cs
diff options
context:
space:
mode:
authora1xd <[email protected]>2021-09-22 20:49:04 -0400
committerGitHub <[email protected]>2021-09-22 20:49:04 -0400
commit8a4b6f57758338d5537d4671184099a4728a8cdd (patch)
treedf36529a344d5d21ff11f5ba021ec80afb4b68a4 /grapher/Models/Charts/ChartXY.cs
parentMerge pull request #87 from matthewstrasiotto/streamer_mode (diff)
parentimprove converter + docs (diff)
downloadrawaccel-8a4b6f57758338d5537d4671184099a4728a8cdd.tar.xz
rawaccel-8a4b6f57758338d5537d4671184099a4728a8cdd.zip
Merge pull request #105 from a1xd/1.5.x
v1.5
Diffstat (limited to 'grapher/Models/Charts/ChartXY.cs')
-rw-r--r--grapher/Models/Charts/ChartXY.cs18
1 files changed, 17 insertions, 1 deletions
diff --git a/grapher/Models/Charts/ChartXY.cs b/grapher/Models/Charts/ChartXY.cs
index 5bafb94..c74929d 100644
--- a/grapher/Models/Charts/ChartXY.cs
+++ b/grapher/Models/Charts/ChartXY.cs
@@ -7,6 +7,13 @@ namespace grapher
{
public class ChartXY
{
+ #region Fields
+
+ public static ElementPosition DefaultLegendPosition = new ElementPosition(25, 0, 50, 25);
+ public static ElementPosition GainLegendPosition = new ElementPosition(25, -1, 50, 25);
+
+ #endregion Fields
+
#region Constructors
public ChartXY(Chart chartX, Chart chartY, string title)
@@ -166,8 +173,11 @@ namespace grapher
legend.DockedToChartArea = area.Name;
legend.LegendStyle = LegendStyle.Row;
+ legend.IsTextAutoFit = true;
+ legend.MaximumAutoSize = 100;
+ legend.AutoFitMinFontSize = 5;
- ElementPosition legendPosNew = new ElementPosition(25, 0, 50, 25);
+ ElementPosition legendPosNew = DefaultLegendPosition;
legend.Position = legendPosNew;
System.Drawing.Color bgTrans = System.Drawing.Color.Transparent;
@@ -279,6 +289,12 @@ namespace grapher
ChartX.Series[2].IsVisibleInLegend = true;
}
+ public void SetLegendPosition(ElementPosition position)
+ {
+ ChartX.Legends[0].Position = position;
+ ChartY.Legends[0].Position = position;
+ }
+
private void VerifyRange(double min, double max)
{
if (min > max)