/// <summary> /// Creates a bar graph user control with default properties /// </summary> public BarGraph() { // This call is required by the Windows.Forms Form Designer. InitializeComponent(); // TODO: Add any initialization after the InitComponent call basicBar = new BasicBar(); SetStyle( ControlStyles.DoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true); UpdateStyles(); }
/// <summary> /// Creates a stacked bar graph user control with default properties /// </summary> public StackedBarGraph() { // This call is required by the Windows.Forms Form Designer. InitializeComponent(); // TODO: Add any initialization after the InitComponent call basicBar = new BasicBar(); basicBar.ShowRangeLines = false; basicBar.ShowRangeValues = false; basicBar.BarGraduation = Graduation.None; gridline = new Gridline(this); axisLineXandY = new AxisLine(this); barCollection = new BarCollection(); for (int i = 0;i < BarCount;i ++) { Bars.Add(new Bar(i.ToString(CultureInfo.CurrentUICulture), 50)); } SetStyle( ControlStyles.DoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true); UpdateStyles(); GraphArea = new Rectangle(ClientRectangle.Left + graphMarginLeft, ClientRectangle.Top + graphMarginTop, ClientRectangle.Width - graphMarginRight - graphMarginLeft, ClientRectangle.Height - graphMarginBottom - graphMarginTop); Debug.Assert(GraphArea.Height == (GraphArea.Bottom - GraphArea.Top), "Problem Ctor"); }