Skip to content
Browse files

Kinda undo last change

  • Loading branch information...
1 parent 06a5f1d commit 8fd51288895ea78e20e7fabf90b421f85c313de0 @jschementi committed
View
2 Schementi.Controls.Demos.Sparkline/MainWindow.xaml.cs
@@ -14,7 +14,7 @@ public partial class MainWindow {
var random = new Random();
timer.Tick += (s, e) => {
foreach (var sparkline in sparklines) {
- var x = random.Next(20, 61);
+ var x = random.Next(10, 61);
Console.WriteLine(x);
sparkline.AddTimeValue(x);
}
View
60 Schementi.Controls.Sparkline/Sparkline.xaml.cs
@@ -158,18 +158,18 @@ private void OnShowWatermarksPropertyChanged()
}
#endregion
- #region MinYRange
- public static DependencyProperty MinYRangeProperty = DependencyProperty.Register(
- "MinYRange",
- typeof(double),
- typeof(Sparkline),
- new PropertyMetadata(25.0));
-
- public double MinYRange {
- get { return (double)GetValue(MinYRangeProperty); }
- set { SetValue(MinYRangeProperty, value); }
- }
- #endregion
+ //#region MinYRange
+ //public static DependencyProperty MinYRangeProperty = DependencyProperty.Register(
+ // "MinYRange",
+ // typeof(double),
+ // typeof(Sparkline),
+ // new PropertyMetadata(25.0));
+
+ //public double MinYRange {
+ // get { return (double)GetValue(MinYRangeProperty); }
+ // set { SetValue(MinYRangeProperty, value); }
+ //}
+ //#endregion
#endregion
#region Fields
@@ -196,7 +196,7 @@ private void OnShowWatermarksPropertyChanged()
new Binding("Foreground") { Mode = BindingMode.TwoWay, Source = this });
BindingOperations.SetBinding(_polyline, Shape.StrokeThicknessProperty,
new Binding("StrokeThickness") { Mode = BindingMode.TwoWay, Source = this });
- Canvas.MinHeight = this.MinYRange;
+ //Canvas.MinHeight = this.MinYRange;
Canvas.Children.Add(_polyline);
}
@@ -262,19 +262,19 @@ private void OnShowWatermarksPropertyChanged()
SetCanvasHeight(point.Y);
if (PointRadius > 0.0)
Canvas.Children.Add(DrawDot(point));
-#if DEBUG
- var textbox = new TextBlock {
- Text = Convert.ToString(point.Y),
- FontSize = 3,
- Foreground = this.Foreground,
- Opacity = 0.25,
- Padding = new Thickness(2.0, 0, 0, 0),
- Margin = new Thickness(point.X, point.Y + 1, 0, 0),
- RenderTransform = new ScaleTransform { ScaleY = -1.0 },
- RenderTransformOrigin = new Point(0.0,0.0),
- };
- Canvas.Children.Add(textbox);
-#endif
+//#if DEBUG
+// var textbox = new TextBlock {
+// Text = Convert.ToString(point.Y),
+// FontSize = 3,
+// Foreground = this.Foreground,
+// Opacity = 0.25,
+// Padding = new Thickness(2.0, 0, 0, 0),
+// Margin = new Thickness(point.X, point.Y + 1, 0, 0),
+// RenderTransform = new ScaleTransform { ScaleY = -1.0 },
+// RenderTransformOrigin = new Point(0.0,0.0),
+// };
+// Canvas.Children.Add(textbox);
+//#endif
_nextXValue++;
}
@@ -301,10 +301,10 @@ private void OnShowWatermarksPropertyChanged()
}
private void SetCanvasHeight(double y) {
- if (TimeSeries.Count < 2) {
- Canvas.Height = y*2;
- return;
- }
+ //if (TimeSeries.Count < 2) {
+ // Canvas.Height = y*2;
+ // return;
+ //}
var highwater = HighWaterMark.HasValue ? HighWaterMark.Value + 2 : 0;
if (highwater > Canvas.ActualHeight || highwater > Canvas.Height) Canvas.Height = highwater;
}

0 comments on commit 8fd5128

Please sign in to comment.
Something went wrong with that request. Please try again.