ChartWindow: Make gebunden type fixed more user friendly

This commit is contained in:
lorenz.stechauner committed 2024-01-21 12:48:40 +01:00
1 parent 182b367811
commit 89d20f4c42
5 files changed
+112 -76

No files matched your search

+12
View File
@@ -28,6 +28,14 @@ namespace Elwig.Helpers.Billing {
DataY = DataX.Select(i => (double)BillingData.GetCurveValueAt(data, i)).ToArray();
}
public Graph(double[] values, int precision, int minX, int maxX) {
Precision = precision;
MinX = minX;
MaxX = maxX;
DataX = Enumerable.Range(MinX, MaxX - MinX + 1).Select(i => (double)i).ToArray();
DataY = values;
}
private Graph(double[] dataX, double[] dataY, int precision, int minX, int maxX) {
Precision = precision;
MinX = minX;
@@ -52,6 +60,10 @@ namespace Elwig.Helpers.Billing {
return DataY[index];
}
public double GetPriceAtOe(double oe) {
return DataY[Array.IndexOf(DataX, oe)];
}
private void FlattenGraph(int begin, int end, double value) {
for (int i = begin; i <= end; i++) {
DataY[i] = value;