diff options
| author | a1xd <[email protected]> | 2021-09-22 20:49:04 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-09-22 20:49:04 -0400 |
| commit | 8a4b6f57758338d5537d4671184099a4728a8cdd (patch) | |
| tree | df36529a344d5d21ff11f5ba021ec80afb4b68a4 /grapher/Models/Charts/ChartXY.cs | |
| parent | Merge pull request #87 from matthewstrasiotto/streamer_mode (diff) | |
| parent | improve converter + docs (diff) | |
| download | rawaccel-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.cs | 18 |
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) |