Changeset 4636
- Timestamp:
- 10/21/10 14:45:44 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Analysis.Views/3.3/DataTableView.Designer.cs
r4142 r4636 49 49 System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend(); 50 50 System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series(); 51 this.chart = new System.Windows.Forms.DataVisualization.Charting.Chart();51 this.chart = new HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart(); 52 52 this.contextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); 53 53 this.exportChartToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); … … 70 70 // chart 71 71 // 72 this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 73 | System.Windows.Forms.AnchorStyles.Left)74 72 this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 73 | System.Windows.Forms.AnchorStyles.Left) 74 | System.Windows.Forms.AnchorStyles.Right))); 75 75 this.chart.BorderlineColor = System.Drawing.Color.Black; 76 76 this.chart.BorderlineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid; … … 85 85 legend1.Name = "Legend1"; 86 86 this.chart.Legends.Add(legend1); 87 this.chart.EnableDoubleClickResetsZoom = true; 88 this.chart.EnableMiddleClickPanning = true; 87 89 this.chart.Location = new System.Drawing.Point(0, 52); 88 90 this.chart.Name = "chart"; … … 139 141 #endregion 140 142 141 private System.Windows.Forms.DataVisualization.Charting.Chart chart;143 private HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart chart; 142 144 private System.Windows.Forms.ContextMenuStrip contextMenuStrip; 143 145 private System.Windows.Forms.ToolStripMenuItem exportChartToolStripMenuItem; -
trunk/sources/HeuristicLab.Analysis.Views/3.3/DataTableView.cs
r4623 r4636 56 56 valuesRowsTable = new Dictionary<IObservableList<double>, DataRow>(); 57 57 invisibleSeries = new List<Series>(); 58 chart.CustomizeAllChartAreas(); 59 chart.ChartAreas[0].CursorX.Interval = 1; 58 60 } 59 61 -
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionBubbleChartView.cs
r4635 r4636 61 61 colorButton.Image = this.GenerateImage(16, 16, this.colorDialog.Color); 62 62 isSelecting = false; 63 64 chart.CustomizeChartAreas(); 65 chart.EnableMiddleClickPanning = false; 66 chart.ChartAreas[0].CursorX.IsUserSelectionEnabled = true; 67 chart.ChartAreas[0].CursorY.IsUserSelectionEnabled = true; 63 chart.CustomizeAllChartAreas(); 68 64 chart.ChartAreas[0].CursorX.Interval = 1; 69 65 chart.ChartAreas[0].CursorY.Interval = 1; -
trunk/sources/HeuristicLab.Visualization.ChartControlsExtensions/3.3/EnhancedChart.cs
r4635 r4636 20 20 #endregion 21 21 22 using System; 22 23 using System.ComponentModel; 23 24 using System.Drawing; … … 31 32 EnableDoubleClickResetsZoom = true; 32 33 EnableMiddleClickPanning = true; 33 Customize ChartAreas();34 CustomizeAllChartAreas(); 34 35 } 35 36 … … 39 40 public bool EnableMiddleClickPanning { get; set; } 40 41 41 public void CustomizeChartAreas() { 42 public static void CustomizeChartArea(ChartArea chartArea) { 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, 10); 52 } 53 chartArea.CursorX.Interval = 0; 54 chartArea.CursorY.Interval = 0; 55 chartArea.CursorX.IsUserSelectionEnabled = true; 56 chartArea.CursorY.IsUserSelectionEnabled = true; 57 chartArea.CursorX.IsUserEnabled = false; 58 chartArea.CursorY.IsUserEnabled = false; 59 chartArea.CursorX.SelectionColor = SystemColors.GradientActiveCaption; 60 chartArea.CursorY.SelectionColor = SystemColors.GradientActiveCaption; 61 } 62 63 public void CustomizeAllChartAreas() { 42 64 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 } 53 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; 65 CustomizeChartArea(chartArea); 60 66 } 61 67 } … … 122 128 protected override void OnMouseMove(MouseEventArgs e) { 123 129 if (panning != null) { 124 panning.ChartArea.AxisX.ScaleView.Scroll(panning.ChartX(e.Location.X)); 125 panning.ChartArea.AxisY.ScaleView.Scroll(panning.ChartY(e.Location.Y)); 130 double x = panning.ChartX(e.Location.X); 131 double y = panning.ChartY(e.Location.Y); 132 if (panning.ChartArea.CursorX.Interval > 0) { 133 x = Math.Round(x * panning.ChartArea.CursorX.Interval) / panning.ChartArea.CursorX.Interval; 134 y = Math.Round(y * panning.ChartArea.CursorY.Interval) / panning.ChartArea.CursorY.Interval; 135 } 136 panning.ChartArea.AxisX.ScaleView.Scroll(x); 137 panning.ChartArea.AxisY.ScaleView.Scroll(y); 126 138 } 127 139 base.OnMouseMove(e);
Note: See TracChangeset
for help on using the changeset viewer.