Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/21/10 11:37:51 (14 years ago)
Author:
mkommend
Message:

Minor changes to EnhancedChart and the adapation of the RunCollectionBubbleChart (ticket #1237).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Visualization.ChartControlsExtensions/3.3/EnhancedChart.cs

    r4630 r4635  
    3131      EnableDoubleClickResetsZoom = true;
    3232      EnableMiddleClickPanning = true;
     33      CustomizeChartAreas();
    3334    }
    3435
    3536    [DefaultValue(true)]
    3637    public bool EnableDoubleClickResetsZoom { get; set; }
    37 
    3838    [DefaultValue(true)]
    3939    public bool EnableMiddleClickPanning { get; set; }
    4040
    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        }
    4553
    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      }
    6961    }
    7062
     
    8375
    8476    #region panning
    85 
    8677    private class PanningSupport {
    8778      public ChartArea ChartArea { get; private set; }
     
    10798        return ChartStartPosition.X - (pixelX - PixelStartPosition.X) * Pixel2ChartScale.Width;
    10899      }
    109 
    110100      public double ChartY(double pixelY) {
    111101        return ChartStartPosition.Y + (pixelY - PixelStartPosition.Y) * Pixel2ChartScale.Height;
     
    137127      base.OnMouseMove(e);
    138128    }
    139 
    140129    #endregion
    141130
Note: See TracChangeset for help on using the changeset viewer.