diff options
| author | Jacob Palecki <[email protected]> | 2020-09-21 00:08:19 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2020-09-21 00:08:19 -0700 |
| commit | ba642cd8c8e63ec3778fa17ecbcd7964074aaba1 (patch) | |
| tree | bb7baaf0e076b64538b7d408cec47045c63a3a8a /grapher/Models/Charts/ChartXY.cs | |
| parent | Attempt to get separate x/y working (diff) | |
| download | rawaccel-ba642cd8c8e63ec3778fa17ecbcd7964074aaba1.tar.xz rawaccel-ba642cd8c8e63ec3778fa17ecbcd7964074aaba1.zip | |
separate x/y mostly works
Diffstat (limited to 'grapher/Models/Charts/ChartXY.cs')
| -rw-r--r-- | grapher/Models/Charts/ChartXY.cs | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/grapher/Models/Charts/ChartXY.cs b/grapher/Models/Charts/ChartXY.cs index 1360409..fdd0258 100644 --- a/grapher/Models/Charts/ChartXY.cs +++ b/grapher/Models/Charts/ChartXY.cs @@ -117,12 +117,17 @@ namespace grapher chart.Titles[0].Font = new System.Drawing.Font(chart.Titles[0].Font.Name, 9.0f, System.Drawing.FontStyle.Italic); } - public static void DrawPoint(Chart chart, PointData point) + public static void DrawPoint(Chart chart, PointData pointOne, PointData pointTwo = null) { if (chart.Visible) { - point.Get(out var x, out var y); + pointOne.Get(out var x, out var y); chart.Series[1].Points.DataBindXY(x, y); + if (pointTwo != null) + { + pointTwo.Get(out x, out y); + chart.Series[3].Points.DataBindXY(x, y); + } chart.Update(); } } @@ -134,11 +139,18 @@ namespace grapher YPointData = y; } - public void DrawLastMovementValue() + public void DrawLastMovementValue(bool twoDotsPerGraph = false) { if(Combined) { - DrawPoint(ChartX, CombinedPointData); + if (twoDotsPerGraph) + { + DrawPoint(ChartX, XPointData, YPointData); + } + else + { + DrawPoint(ChartX, CombinedPointData); + } } else { @@ -164,6 +176,12 @@ namespace grapher ChartY.Series[0].Points.DataBindXY(dataY.Keys, dataY.Values); } + public void BindXYCombined(IDictionary dataX, IDictionary dataY) + { + ChartX.Series[0].Points.DataBindXY(dataX.Keys, dataX.Values); + ChartX.Series[2].Points.DataBindXY(dataY.Keys, dataY.Values); + } + public void SetCombined() { if (!Combined) |