- Timestamp:
- 10/21/10 11:37:51 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Visualization.ChartControlsExtensions/3.3/EnhancedChart.cs
r4630 r4635 31 31 EnableDoubleClickResetsZoom = true; 32 32 EnableMiddleClickPanning = true; 33 CustomizeChartAreas(); 33 34 } 34 35 35 36 [DefaultValue(true)] 36 37 public bool EnableDoubleClickResetsZoom { get; set; } 37 38 38 [DefaultValue(true)] 39 39 public bool EnableMiddleClickPanning { get; set; } 40 40 41 public void InitializeChartAreas() { 42 ChartAreas.Clear(); 43 ChartAreas.Add(CreateDefaultChartArea("ChartArea1")); 44 } 41 public void CustomizeChartAreas() { 42 foreach (ChartArea chartArea in ChartAreas) { 43 foreach (Axis axis in chartArea.Axes) { 44 axis.MajorGrid.LineColor = SystemColors.GradientInactiveCaption; 45 axis.MajorTickMark.TickMarkStyle = TickMarkStyle.AcrossAxis; 46 axis.ScrollBar.BackColor = Color.Transparent; 47 axis.ScrollBar.LineColor = Color.Transparent; 48 axis.ScrollBar.ButtonColor = SystemColors.GradientInactiveCaption; 49 axis.ScrollBar.ButtonStyle = ScrollBarButtonStyles.SmallScroll; 50 axis.ScrollBar.Size = 12; 51 axis.TitleFont = new Font(axis.TitleFont.FontFamily, 12); 52 } 45 53 46 public static ChartArea CreateDefaultChartArea(string name) { 47 ChartArea chartArea = new ChartArea(name); 48 chartArea.AxisX.MajorGrid.LineColor = SystemColors.GradientInactiveCaption; 49 chartArea.AxisY.MajorGrid.LineColor = SystemColors.GradientInactiveCaption; 50 chartArea.AxisX.MajorTickMark.TickMarkStyle = TickMarkStyle.AcrossAxis; 51 chartArea.AxisY.MajorTickMark.TickMarkStyle = TickMarkStyle.AcrossAxis; 52 chartArea.AxisX.ScrollBar.BackColor = Color.Transparent; 53 chartArea.AxisY.ScrollBar.BackColor = Color.Transparent; 54 chartArea.AxisX.ScrollBar.LineColor = Color.Transparent; 55 chartArea.AxisY.ScrollBar.LineColor = Color.Transparent; 56 chartArea.AxisX.ScrollBar.ButtonColor = SystemColors.GradientInactiveCaption; 57 chartArea.AxisY.ScrollBar.ButtonColor = SystemColors.GradientInactiveCaption; 58 chartArea.AxisX.ScrollBar.ButtonStyle = ScrollBarButtonStyles.SmallScroll; 59 chartArea.AxisY.ScrollBar.ButtonStyle = ScrollBarButtonStyles.SmallScroll; 60 chartArea.AxisX.ScrollBar.Size = 12; 61 chartArea.AxisY.ScrollBar.Size = 12; 62 chartArea.CursorX.Interval = 0; 63 chartArea.CursorY.Interval = 0; 64 chartArea.CursorX.IsUserSelectionEnabled = true; 65 chartArea.CursorY.IsUserSelectionEnabled = true; 66 chartArea.CursorX.SelectionColor = SystemColors.GradientActiveCaption; 67 chartArea.CursorY.SelectionColor = SystemColors.GradientActiveCaption; 68 return chartArea; 54 chartArea.CursorX.Interval = 0; 55 chartArea.CursorY.Interval = 0; 56 chartArea.CursorX.IsUserSelectionEnabled = true; 57 chartArea.CursorY.IsUserSelectionEnabled = true; 58 chartArea.CursorX.SelectionColor = SystemColors.GradientActiveCaption; 59 chartArea.CursorY.SelectionColor = SystemColors.GradientActiveCaption; 60 } 69 61 } 70 62 … … 83 75 84 76 #region panning 85 86 77 private class PanningSupport { 87 78 public ChartArea ChartArea { get; private set; } … … 107 98 return ChartStartPosition.X - (pixelX - PixelStartPosition.X) * Pixel2ChartScale.Width; 108 99 } 109 110 100 public double ChartY(double pixelY) { 111 101 return ChartStartPosition.Y + (pixelY - PixelStartPosition.Y) * Pixel2ChartScale.Height; … … 137 127 base.OnMouseMove(e); 138 128 } 139 140 129 #endregion 141 130
Note: See TracChangeset
for help on using the changeset viewer.