Exemplo n.º 1
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            //default
            Type        = StackedType.No;
            YAxisSuffix = "%";
            System.Drawing.Font myFont = new System.Drawing.Font("Arial", 9);
            this.Font = myFont;

            this.Gallery = Gallery.Bar;
            this.Width   = 580;
            this.Height  = 370;

            this.LegendBox.Dock          = ChartFX.WebForms.DockArea.Bottom;
            this.LegendBox.Border        = 0;
            this.LegendBox.ContentLayout = ChartFX.WebForms.ContentLayout.Center;
            this.LegendBox.AutoSize      = true;
//            this.LegendBox.Height = 60;
//            this.LegendBox.Width = 530;
            this.LegendBox.MarginX = 0;
            this.LegendBox.MarginY = 0;
            // plotareaonly = false means that the legend box will not flow outside of the chart area
            // however this doesn't mean that the legend itself will not flow outside of the legendbox
            // and therefore have hidden legend items.

            this.LegendBox.PlotAreaOnly = false;



            // this.AxisY.LabelsFormat.IsPercentage.Equals(true);
            // this.Font.Bold.Equals(true);
            // this.LegendBox.Border.Equals(1);
            //this.LegendBox.Height = 60;
            //this.LegendBox.Width = 600;
            //this.LegendBox.MarginX = 38;
            //this.LegendBox.ContentLayout = ChartFX.WebForms.ContentLayout.Near;
            //this.LegendBox.PlotAreaOnly = false;
            //end ht test
            this.AxisX.Grids.Major.Visible = false;

            ChartFX.WebForms.Adornments.SolidBackground solidBackground =
                new ChartFX.WebForms.Adornments.SolidBackground();
            solidBackground.Color = System.Drawing.Color.White;

            ChartFX.WebForms.Adornments.SimpleBorder simpleBorder =
                new ChartFX.WebForms.Adornments.SimpleBorder();
            simpleBorder.Color = System.Drawing.Color.Black;

            this.Background = solidBackground;
            this.Border     = simpleBorder;

            GraphHorizBarChart.SetSeriesColors(this.Series, null);
        }
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            this.Gallery = Gallery.Scatter;
            this.Width   = 580;
            this.Height  = 370;

            System.Drawing.Font myFont = new System.Drawing.Font("Arial", 9);
            this.Font = myFont;

            this.MainPane.AxisY.LabelTrimming = System.Drawing.StringTrimming.EllipsisCharacter;

            this.LegendBox.Dock          = ChartFX.WebForms.DockArea.Bottom;
            this.LegendBox.PlotAreaOnly  = false;
            this.LegendBox.Border        = 0;
            this.LegendBox.ContentLayout = ContentLayout.Spread;
            this.LegendBox.Height        = 60;
            this.LegendBox.Width         = 460;
            this.LegendBox.MarginX       = 0;
            this.LegendBox.MarginY       = 5;
            this.LegendBox.AutoSize      = false;
            System.Drawing.Font legendFont = new System.Drawing.Font("Arial", 8);
            this.LegendBox.Font            = legendFont;
            this.AxisX.Grids.Major.Visible = false;

            /*
             * //ht: commented out but do not delete
             * //since this code might be useful later in some other cases.
             * CustomLegendItem custLegItem = new CustomLegendItem();
             * custLegItem.Attributes.MarkerShape = MarkerShape.Diamond;
             * custLegItem.Attributes.Color = System.Drawing.Color.Gray;
             * custLegItem.Text = "Other Schools";
             * LegendBox.CustomItems.Add(custLegItem);
             *
             * CustomLegendItem custLegItem1 = new CustomLegendItem();
             * custLegItem1.Text = "Current School";
             * custLegItem1.Attributes.Color = System.Drawing.Color.Red;
             * custLegItem1.Attributes.MarkerShape = MarkerShape.Diamond;
             * LegendBox.CustomItems.Add(custLegItem1);
             */
            // RollOverSeriesSeqInLengendBox();

            ChartFX.WebForms.Adornments.SolidBackground solidBackground =
                new ChartFX.WebForms.Adornments.SolidBackground();
            solidBackground.Color = System.Drawing.Color.White;
            ChartFX.WebForms.Adornments.SimpleBorder simpleBorder =
                new ChartFX.WebForms.Adornments.SimpleBorder();
            simpleBorder.Color = System.Drawing.Color.Black;

            this.Background = solidBackground;
            this.Border     = simpleBorder;
        }