コード例 #1
0
        public override void DataBind()
        {
            if (!Visible)   // don't databind if we aren't going to use it.
            {
                return;
            }
            DataTable table = getTableFromObject(DataSource);

            //Normalize RaceLabelNames: Replace Old Race Labels with New labels:
            ReplaceOldRaceLabelsWithNew(table);

            //backwards compatibility
            if (SeriesColumnName == ColumnPicker.CommonGraphNames.OrgSchoolTypeLabel.ToString() &&
                !table.Columns.Contains(ColumnPicker.CommonGraphNames.OrgSchoolTypeLabel.ToString()))
            {
                SeriesColumnName = "OrgLevelLabel";
            }

            SaveOriginalAxisAndSeriesLabels(table);
            table = SortDataSource(table);
            table = TransformDataSource(table);
            GraphBarChart.OverrideSeriesColumnNames(table, customSeriesLabelsMap);
            GraphBarChart.ReplaceColumnValues(table, LabelColumnName, OverrideAxisXLabels);

            DataSource = table;

            base.DataBind();
            GraphHorizBarChart.SetSeriesColors(this.Series, SeriesColors);
            SetSeriesPatterns(this.Series, OverrideSeriesPatterns);
        }
コード例 #2
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);
        }