private ChartDashboardItem CreateChart(DashboardObjectDataSource dataSource)
        {
            // Creates a chart dashboard item and specifies its data source.
            ChartDashboardItem chart = new ChartDashboardItem();

            chart.DataSource = dataSource;

            // Specifies the dimension used to provide data for arguments on a chart.
            chart.Arguments.Add(new Dimension("Sales Person", DateTimeGroupInterval.Year));

            // Specifies the dimension that provides data for chart series.
            chart.SeriesDimensions.Add(new Dimension("OrderDate"));

            // Adds a new chart pane to the chart's Panes collection.
            chart.Panes.Add(new ChartPane());
            // Creates a new series of the Bar type.
            SimpleSeries salesAmountSeries = new SimpleSeries(SimpleSeriesType.Bar);

            // Specifies the measure that provides data used to calculate
            // the Y-coordinate of data points.
            salesAmountSeries.Value = new Measure("Extended Price");
            // Adds created series to the pane's Series collection to display within this pane.
            chart.Panes[0].Series.Add(salesAmountSeries);

            chart.Panes.Add(new ChartPane());
            SimpleSeries taxesAmountSeries = new SimpleSeries(SimpleSeriesType.StackedBar);

            taxesAmountSeries.Value = new Measure("Quantity");
            chart.Panes[1].Series.Add(taxesAmountSeries);

            return(chart);
        }
示例#2
0
        private Dashboard CreateDashboard()
        {
            DashboardExcelDataSource excelDataSource = CreateExcelDataSource();
            Dashboard dBoard = new Dashboard();

            dBoard.DataSources.Add(excelDataSource);

            dBoard.BeginUpdate();
            // Create dashboard items.
            ChartDashboardItem chart = CreateChart(excelDataSource);

            dBoard.Items.Add(chart);
            DateFilterDashboardItem dateFilterItem = CreateDateFilterItem(excelDataSource);

            dBoard.Items.Add(dateFilterItem);
            DashboardItemGroup group = CreateGroup();

            dBoard.Groups.Add(group);
            group.AddRange(dateFilterItem, chart);
            // Create layout tree.
            DashboardLayoutItem  dateFilterLayoutItem = new DashboardLayoutItem(dateFilterItem, 30);
            DashboardLayoutItem  chartLayoutItem      = new DashboardLayoutItem(chart, 70);
            DashboardLayoutGroup groupLayoutItem      = new DashboardLayoutGroup(group, 100);

            groupLayoutItem.ChildNodes.AddRange(dateFilterLayoutItem, chartLayoutItem);
            DashboardLayoutGroup rootGroup = new DashboardLayoutGroup(null, 100);

            rootGroup.ChildNodes.Add(groupLayoutItem);
            rootGroup.Orientation = DashboardLayoutGroupOrientation.Vertical;
            dBoard.LayoutRoot     = rootGroup;
            dBoard.EndUpdate();
            return(dBoard);
        }
        public void InitializeDashboard()
        {
            Dashboard dashboard = new Dashboard();
            DashboardJsonDataSource jsonDataSource = CreateJsonDataSourceFromWeb();

            //DashboardJsonDataSource jsonDataSource = CreateJsonDataSourceFromFile();
            //DashboardJsonDataSource jsonDataSource = CreateJsonDataSourceFromString();

            dashboard.DataSources.Add(jsonDataSource);

            PivotDashboardItem pivot = new PivotDashboardItem();

            pivot.DataSource = jsonDataSource;
            pivot.Rows.Add(new Dimension("ContactTitle"));
            pivot.Columns.Add(new Dimension("Country"));
            pivot.Values.Add(new Measure("Id", SummaryType.Count));

            ChartDashboardItem chart = new ChartDashboardItem();

            chart.DataSource = jsonDataSource;
            chart.Arguments.Add(new Dimension("Country"));
            chart.Panes.Add(new ChartPane());
            SimpleSeries theSeries = new SimpleSeries(SimpleSeriesType.Bar);

            theSeries.Value = new Measure("Id", SummaryType.Count);
            chart.Panes[0].Series.Add(theSeries);

            dashboard.Items.AddRange(pivot, chart);
            dashboard.RebuildLayout();
            dashboard.LayoutRoot.Orientation = DashboardLayoutGroupOrientation.Vertical;
            dashboardDesigner1.Dashboard     = dashboard;
        }
示例#4
0
文件: Form1.cs 项目: HongTham06/DoAn
        void InitializeDashboardItems()
        {
            IDashboardDataSource olapDataSource = dashboardDesigner1.Dashboard.DataSources[0];

            // PivotDashboardItem pivot = new PivotDashboardItem();

            /*pivot.DataSource = olapDataSource;
             * pivot.Values.Add(new Measure("[Measures].[Sales Amount]"));
             * pivot.Columns.Add(new Dimension("[Sales Channel].[Sales Channel].[Sales Channel]"));
             * pivot.Rows.AddRange(
             *  new Dimension("[Sales Territory].[Sales Territory].[Group]", 1),
             *  new Dimension("[Sales Territory].[Sales Territory].[Country]", 1),
             *  new Dimension("[Sales Territory].[Sales Territory].[Region]", 1));
             * pivot.AutoExpandRowGroups = true;*/

            ChartDashboardItem chart = new ChartDashboardItem();

            chart.DataSource = olapDataSource;
            chart.Arguments.Add(new Dimension("[Sales Territory].[Sales Territory].[Country]"));
            chart.Panes.Add(new ChartPane());
            SimpleSeries salesAmountSeries = new SimpleSeries(SimpleSeriesType.Bar);

            salesAmountSeries.Value = new Measure("[Measures].[Sales Amount]");
            chart.Panes[0].Series.Add(salesAmountSeries);
            dashboardDesigner1.Dashboard.Items.AddRange(chart);
        }
示例#5
0
        public async Task <IActionResult> PutChartDashboardItem([FromRoute] int?id, [FromBody] ChartDashboardItem chartDashboardItem)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != chartDashboardItem.Id)
            {
                return(BadRequest());
            }

            _context.Entry(chartDashboardItem).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ChartDashboardItemExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(Ok(chartDashboardItem));
        }
示例#6
0
        public void InitializeDashboard()
        {
            Dashboard             dashboard    = new Dashboard();
            DashboardEFDataSource efDataSource = new DashboardEFDataSource();

            efDataSource.ConnectionParameters =
                new EFConnectionParameters(typeof(OrdersContext));
            dashboard.DataSources.Add(efDataSource);

            PivotDashboardItem pivot = new PivotDashboardItem();

            pivot.DataMember = "Orders";
            pivot.DataSource = dashboard.DataSources[0];
            pivot.Rows.AddRange(new Dimension("ShipCountry"), new Dimension("ShipCity"));
            pivot.Columns.Add(new Dimension("OrderDate"));
            pivot.Values.Add(new Measure("Freight"));

            ChartDashboardItem chart = new ChartDashboardItem();

            chart.DataSource = dashboard.DataSources[0];
            chart.DataMember = "Orders";
            chart.Arguments.Add(new Dimension("OrderDate", DateTimeGroupInterval.Year));
            chart.Panes.Add(new ChartPane());
            SimpleSeries freightSeries = new SimpleSeries(SimpleSeriesType.Bar);

            freightSeries.Value = new Measure("Freight");
            chart.Panes[0].Series.Add(freightSeries);

            dashboard.Items.AddRange(pivot, chart);
            dashboardViewer1.Dashboard = dashboard;
        }
        public Form1()
        {
            InitializeComponent();
            dashboardDesigner1.CreateRibbon();

            // Creates a color table containing dimension values, measures and corresponding colors.
            DataTable colorTable = CreateColorTable();
            // Loads a dashboard from the XML file.
            Dashboard            dashboard  = new Dashboard(); dashboard.LoadFromXml(@"..\..\Data\Dashboard.xml");
            IDashboardDataSource dataSource = dashboard.DataSources["dataSource1"];

            // Specifies the coloring mode for the specified pie series, pie measures and chart argument.
            PieDashboardItem   pie1   = (PieDashboardItem)dashboard.Items["pieDashboardItem1"];
            ChartDashboardItem chart1 = (ChartDashboardItem)dashboard.Items["chartDashboardItem1"];

            pie1.SeriesDimensions[0].ColoringMode     = ColoringMode.Hue;
            pie1.ColoringOptions.MeasuresColoringMode = ColoringMode.Hue;
            chart1.Arguments[0].ColoringMode          = ColoringMode.Hue;

            foreach (DataRow row in colorTable.Rows)
            {
                dashboard.ColorScheme.Add(CreateColorSchemeEntry(row, dataSource, false));
                dashboard.ColorScheme.Add(CreateColorSchemeEntry(row, dataSource, true));
            }
            dashboardDesigner1.Dashboard = dashboard;
        }
示例#8
0
        private Dashboard CreateDashboard()
        {
            Dashboard dashBoard = new Dashboard();

            IDashboardDataSource sqlDataSource = CreateSqlDataSource();

            dashBoard.DataSources.Add(sqlDataSource);

            ChartDashboardItem chart = new ChartDashboardItem();

            chart.DataSource = sqlDataSource; chart.DataMember = "MyQuery";
            chart.Arguments.Add(new Dimension("OrderDate", DateTimeGroupInterval.MonthYear));
            chart.Panes.Add(new ChartPane());
            SimpleSeries salesAmountSeries = new SimpleSeries(SimpleSeriesType.SplineArea);

            salesAmountSeries.Value = new Measure("ExtendedPrice");
            chart.Panes[0].Series.Add(salesAmountSeries);

            GridDashboardItem grid = new GridDashboardItem();

            grid.DataSource = sqlDataSource;
            grid.DataMember = "MyQuery";
            grid.Columns.Add(new GridDimensionColumn(new Dimension("SalesPerson")));
            grid.Columns.Add(new GridMeasureColumn(new Measure("ExtendedPrice")));

            dashBoard.Items.AddRange(chart, grid);

            return(dashBoard);
        }
        public void AddFormatRulesToBarSeries(ChartDashboardItem chart)
        {
            SimpleSeries                 series       = chart.Panes[0].Series[0] as SimpleSeries;
            ChartItemFormatRule          gradientRule = new ChartItemFormatRule(series.Value, series);
            FormatConditionRangeGradient condition    = new FormatConditionRangeGradient(FormatConditionRangeGradientPredefinedType.RedBlue);

            gradientRule.Condition    = condition;
            gradientRule.ShowInLegend = false;
            chart.FormatRules.Add(gradientRule);
        }
        public Form1()
        {
            InitializeComponent();
            dashboardDesigner1.CreateRibbon();
            dashboardDesigner1.LoadDashboard("nwindDashboard.xml");
            ChartDashboardItem chart1 = (ChartDashboardItem)dashboardDesigner1.Dashboard.Items["chartDashboardItem1"];
            ChartDashboardItem chart2 = (ChartDashboardItem)dashboardDesigner1.Dashboard.Items["chartDashboardItem2"];

            AddFormatRulesToBarSeries(chart1);
            AddFormatRulesToLineSeries(chart2);
        }
        void OnAllowCollapsingClick(object sender, ItemClickEventArgs e)
        {
            ChartDashboardItem dashboardItem = dashboardDesigner.SelectedDashboardItem as ChartDashboardItem;
            MultiPaneSettings  settings      = MultiPaneSettings.FromJson(dashboardItem.CustomProperties[customPropertyName]);

            settings.AllowPaneCollapsing = !settings.AllowPaneCollapsing;
            string status = settings.AllowPaneCollapsing == true ? "enabled" : "disabled";
            CustomPropertyHistoryItem historyItem = new CustomPropertyHistoryItem(dashboardItem, customPropertyName, settings.ToJson(), $"Pane Collapsing for {dashboardItem.ComponentName} is {status}");

            dashboardDesigner.AddToHistory(historyItem);
            UpdateBarItems();
        }
        private void BarItem_ListItemClick(object sender, ListItemClickEventArgs e)
        {
            ChartDashboardItem dashboardItem = dashboardDesigner.SelectedDashboardItem as ChartDashboardItem;
            MultiPaneSettings  settings      = MultiPaneSettings.FromJson(dashboardItem.CustomProperties[customPropertyName]);

            settings.UseGridLayout = e.Index == 0;
            string status = settings.UseGridLayout == true ? "Grid" : "Linear";
            CustomPropertyHistoryItem historyItem = new CustomPropertyHistoryItem(dashboardItem, customPropertyName, settings.ToJson(), $"Layout Mode for {dashboardItem.ComponentName} is {status}");

            dashboardDesigner.AddToHistory(historyItem);
            UpdateBarItems();
        }
        private void DashboardItemControlUpdated(object sender, DashboardItemControlEventArgs e)
        {
            ChartDashboardItem chartItem = dashboardControl.Dashboard.Items[e.DashboardItemName] as ChartDashboardItem;

            if (chartItem == null || chartItem.Panes.Count > 1)
            {
                return;
            }
            MultiPaneSettings settings = MultiPaneSettings.FromJson(chartItem.CustomProperties[customPropertyName]);

            CustomizeDiagram(e.ChartControl.Diagram as XYDiagram, e.ChartControl.Series, settings);
        }
示例#14
0
        public async Task <IActionResult> PostChartDashboardItem([FromBody] ChartDashboardItem chartDashboardItem)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _context.ChartDashboardItem.Add(chartDashboardItem);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetChartDashboardItem", new { id = chartDashboardItem.Id }, chartDashboardItem));
        }
        public static void CustomExport(CustomExportWebEventArgs e)
        {
            Dictionary <string, XRControl> controls = e.GetPrintableControls();

            foreach (var control in controls)
            {
                string             componentName = control.Key;
                XRChart            chartControl  = control.Value as XRChart;
                ChartDashboardItem chartItem     = e.GetDashboardItem(componentName) as ChartDashboardItem;
                if (chartControl != null && chartItem != null)
                {
                    string constantLinesJSON = chartItem.CustomProperties["ConstantLineSettings"];
                    if (constantLinesJSON != null)
                    {
                        XYDiagram diagram = chartControl.Diagram as XYDiagram;
                        if (diagram != null)
                        {
                            List <CustomConstantLine> customConstantLines = JsonConvert.DeserializeObject <List <CustomConstantLine> >(constantLinesJSON);
                            customConstantLines.ForEach(customConstantLine =>
                            {
                                ConstantLine line        = new ConstantLine();
                                line.Visible             = true;
                                line.ShowInLegend        = false;
                                line.Color               = ColorTranslator.FromHtml(customConstantLine.color);
                                line.Title.Text          = customConstantLine.labelText;
                                line.LineStyle.DashStyle = DashStyle.Dash;
                                line.LineStyle.Thickness = 2;
                                if (customConstantLine.isBound)
                                {
                                    MultiDimensionalData data = e.GetItemData(componentName);
                                    MeasureDescriptor measure = data.GetMeasures().FirstOrDefault(m => m.ID == customConstantLine.measureId);
                                    if (measure != null)
                                    {
                                        line.AxisValue = data.GetValue(measure).Value;
                                    }
                                }
                                else
                                {
                                    line.AxisValue = customConstantLine.value;
                                }


                                if (diagram.SecondaryAxesY.Count > 0)
                                {
                                    diagram.SecondaryAxesY[0].ConstantLines.Add(line);
                                }
                            });
                        }
                    }
                }
            }
        }
        private Dashboard CreateDashboard()
        {
            Dashboard dBoard = new Dashboard();

            OlapConnectionParameters olapParams = new OlapConnectionParameters();

            olapParams.ConnectionString = @"provider=MSOLAP;
                                  data source=http://demos.devexpress.com/Services/OLAP/msmdpump.dll;
                                  initial catalog=Adventure Works DW Standard Edition;
                                  cube name=Adventure Works;";

            DashboardOlapDataSource olapDataSource = new DashboardOlapDataSource(olapParams);

            dBoard.DataSources.Add(olapDataSource);

            CardDashboardItem cardItem = new CardDashboardItem();

            cardItem.DataSource = olapDataSource;
            cardItem.SeriesDimensions.Add(new Dimension("[Sales Territory].[Sales Territory Country].[Sales Territory Country]"));
            cardItem.SparklineArgument = new Dimension("[Date].[Month of Year].[Month of Year]", DateTimeGroupInterval.MonthYear);
            Card card = new Card();

            card.LayoutTemplate = new CardStretchedLayoutTemplate();
            card.ActualValue    = new Measure("[Measures].[Internet Sales Amount]");
            card.TargetValue    = new Measure("[Measures].[Sales Amount]");
            cardItem.Cards.Add(card);

            ChartDashboardItem chartItem = new ChartDashboardItem();

            chartItem.DataSource = olapDataSource;
            chartItem.Arguments.Add(new Dimension("[Sales Territory].[Sales Territory].[Country]"));
            chartItem.Panes.Add(new ChartPane());
            SimpleSeries salesAmountSeries = new SimpleSeries(SimpleSeriesType.Bar);

            salesAmountSeries.Value = new Measure("[Measures].[Sales Amount]");
            chartItem.Panes[0].Series.Add(salesAmountSeries);
            SimpleSeries salesInernetAmountSeries = new SimpleSeries(SimpleSeriesType.Bar);

            salesInernetAmountSeries.Value = new Measure("[Measures].[Internet Sales Amount]");
            chartItem.Panes[0].Series.Add(salesInernetAmountSeries);
            dBoard.Items.AddRange(cardItem, chartItem);

            DashboardLayoutItem  cardLayoutItem  = new DashboardLayoutItem(cardItem);
            DashboardLayoutItem  chartLayoutItem = new DashboardLayoutItem(chartItem);
            DashboardLayoutGroup rootGroup       = new DashboardLayoutGroup(DashboardLayoutGroupOrientation.Vertical,
                                                                            50D, cardLayoutItem, chartLayoutItem);

            dBoard.LayoutRoot = rootGroup;

            return(dBoard);
        }
        private void ModifyChart()
        {
            // Change the argument's data source field from "Category" to "State" in all chart items.
            Dashboard dBoard = dashboardViewer.Dashboard;

            foreach (DashboardItem item in dBoard.Items.Where(x => x is ChartDashboardItem))
            {
                ChartDashboardItem chart = (ChartDashboardItem)item;
                foreach (var dimension in chart.GetDimensions().Where(d => d.DataMember == "Category"))
                {
                    dimension.DataMember = "State";
                }
            }
        }
示例#18
0
        private ChartDashboardItem CreateChart(DashboardExcelDataSource excelDataSource)
        {
            ChartDashboardItem chart = new ChartDashboardItem();

            chart.Name        = string.Empty;
            chart.ShowCaption = false;
            chart.DataSource  = excelDataSource;
            chart.Arguments.Add(new Dimension("OrderDate", DateTimeGroupInterval.DayMonthYear));
            chart.Panes.Add(new ChartPane());
            SimpleSeries salesAmountSeries = new SimpleSeries(SimpleSeriesType.Line);

            salesAmountSeries.Value = new Measure("Extended Price");
            chart.Panes[0].Series.Add(salesAmountSeries);
            return(chart);
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            // Creates a dashboard and sets it as the currently opened dashboard in the dashboard viewer.
            dashboardViewer1.Dashboard = new Dashboard();

            // Creates a data source and adds it to the dashboard data source collection.
            DashboardObjectDataSource dataSource = new DashboardObjectDataSource();

            dataSource.DataSource = (new nwindDataSetTableAdapters.SalesPersonTableAdapter()).GetData();
            dashboardViewer1.Dashboard.DataSources.Add(dataSource);

            // Creates a chart dashboard item with the specified data source
            // and adds it to the Items collection to display within the dashboard.
            ChartDashboardItem chart = CreateChart(dataSource);

            dashboardViewer1.Dashboard.Items.Add(chart);

            // Reloads data in the data sources.
            dashboardViewer1.ReloadData();
        }
        public void AddFormatRulesToLineSeries(ChartDashboardItem chart)
        {
            SimpleSeries         series          = chart.Panes[0].Series[0] as SimpleSeries;
            ChartItemFormatRule  valueRule1      = new ChartItemFormatRule(series.Value, series);
            FormatConditionValue valueCondition1 = new FormatConditionValue(DashboardFormatCondition.Greater, 3000);

            valueCondition1.StyleSettings = new ColorStyleSettings(Color.Green);
            valueRule1.Condition          = valueCondition1;
            valueRule1.ShowInLegend       = true;
            valueRule1.DisplayName        = "UnitPrice is greater than $3K";
            chart.FormatRules.Add(valueRule1);

            ChartItemFormatRule  valueRule2      = new ChartItemFormatRule(series.Value, series);
            FormatConditionValue valueCondition2 = new FormatConditionValue(DashboardFormatCondition.Less, 3000);

            valueCondition2.StyleSettings = new ColorStyleSettings(Color.Red);
            valueRule2.Condition          = valueCondition2;
            valueRule2.ShowInLegend       = true;
            valueRule2.DisplayName        = "UnitPrice is less than $3K";
            chart.FormatRules.Add(valueRule2);
        }
 void UpdateBarItems()
 {
     if (dashboardDesigner.SelectedDashboardItem is ChartDashboardItem)
     {
         ChartDashboardItem chartItem = dashboardDesigner.SelectedDashboardItem as ChartDashboardItem;
         if (chartItem.Panes.Count > 1)
         {
             enableBarItem.Checked = showTitlesBarItem.Checked = allowCollapsingBarItem.Checked = false;
             enableBarItem.Enabled = showTitlesBarItem.Enabled =
                 allowCollapsingBarItem.Enabled = layoutModeBarItem.Enabled = false;
             return;
         }
         MultiPaneSettings settings = MultiPaneSettings.FromJson(chartItem.CustomProperties[customPropertyName]);
         enableBarItem.Enabled = true;
         enableBarItem.Checked = settings.MultiPaneEnabled;
         if (settings.MultiPaneEnabled)
         {
             layoutModeBarItem.Enabled = true;
             showTitlesBarItem.Enabled = true;
             showTitlesBarItem.Checked = settings.ShowPaneTitles;
         }
         else
         {
             layoutModeBarItem.Enabled = false;
             showTitlesBarItem.Enabled = false;
             showTitlesBarItem.Checked = false;
         }
         if (settings.MultiPaneEnabled && settings.ShowPaneTitles)
         {
             allowCollapsingBarItem.Enabled = true;
             allowCollapsingBarItem.Checked = settings.AllowPaneCollapsing;
         }
         else
         {
             allowCollapsingBarItem.Enabled = false;
             allowCollapsingBarItem.Checked = false;
         }
         layoutModeBarItem.ItemIndex = settings.UseGridLayout? 0:1;
     }
 }
示例#22
0
        public void InitializeDashboard()
        {
            Dashboard dashboard = new Dashboard();
            DashboardSqlDataSource sqliteDataSource = CreateSQLiteDataSource();

            dashboard.DataSources.Add(sqliteDataSource);
            DashboardExcelDataSource exceldataSource = CreateExcelDataSource();

            dashboard.DataSources.Add(exceldataSource);
            DashboardObjectDataSource objectDataSource = CreateObjectDataSource();

            dashboard.DataSources.Add(objectDataSource);
            DashboardFederationDataSource federatedDS = CreateFederatedDataSource(sqliteDataSource, exceldataSource, objectDataSource);

            dashboard.DataSources.Add(federatedDS);

            PivotDashboardItem pivot = new PivotDashboardItem();

            pivot.DataMember = "FDS-Created-by-NodeBulder";
            pivot.DataSource = federatedDS;
            pivot.Rows.AddRange(new Dimension("CategoryName"), new Dimension("ProductName"));
            pivot.Columns.Add(new Dimension("SalesPerson"));
            pivot.Values.Add(new Measure("Extended Price"));

            ChartDashboardItem chart = new ChartDashboardItem();

            chart.DataSource = federatedDS;
            chart.DataMember = "FDS-Created-by-NodeBulder";
            chart.Arguments.Add(new Dimension("SalesPerson"));
            chart.Panes.Add(new ChartPane());
            SimpleSeries theSeries = new SimpleSeries(SimpleSeriesType.Bar);

            theSeries.Value = new Measure("Score");
            chart.Panes[0].Series.Add(theSeries);

            dashboard.Items.AddRange(pivot, chart);
            dashboard.RebuildLayout();
            dashboard.LayoutRoot.Orientation = DashboardLayoutGroupOrientation.Vertical;
            dashboardDesigner1.Dashboard     = dashboard;
        }
 private void CustomExport(object sender, CustomExportEventArgs e)
 {
     foreach (var printControl in e.GetPrintableControls())
     {
         if (printControl.Value is XRChart)
         {
             var chartItemName = printControl.Key;
             IDashboardControl  dashboardControl = (IDashboardControl)sender;
             ChartDashboardItem chartItem        = dashboardControl.Dashboard.Items[chartItemName] as ChartDashboardItem;
             if (chartItem == null || chartItem.Panes.Count > 1)
             {
                 return;
             }
             XRChart xrChart = printControl.Value as XRChart;
             if (xrChart == null)
             {
                 return;
             }
             MultiPaneSettings settings = MultiPaneSettings.FromJson(chartItem.CustomProperties[customPropertyName]);
             CustomizeDiagram(xrChart.Diagram as XYDiagram, xrChart.Series, settings);
         }
     }
 }
示例#24
0
        private static Dashboard CreateDashboard(DashboardSqlDataSource dataSource)
        {
            Dashboard dashboard1 = new Dashboard();

            dashboard1.DataSources.Add(dataSource);

            ComboBoxDashboardItem comboBox1 = new ComboBoxDashboardItem()
            {
                Name         = "Browser",
                DataSource   = dataSource,
                DataMember   = "Statistics",
                ComboBoxType = ComboBoxDashboardItemType.Checked
            };

            comboBox1.FilterDimensions.Add(new Dimension("Browser"));

            ListBoxDashboardItem listBox1 = new ListBoxDashboardItem()
            {
                Name       = "Browser Version",
                DataSource = dataSource,
                DataMember = "Statistics"
            };

            listBox1.FilterDimensions.Add(new Dimension("BrowserDetails"));
            listBox1.InteractivityOptions.IgnoreMasterFilters = false;

            TreeViewDashboardItem treeView1 = new TreeViewDashboardItem()
            {
                Name            = "Date",
                DataSource      = dataSource,
                DataMember      = "Statistics",
                AutoExpandNodes = true
            };

            treeView1.FilterDimensions.AddRange(new Dimension("Date", DateTimeGroupInterval.Year),
                                                new Dimension("Date", DateTimeGroupInterval.Quarter));

            DashboardItemGroup group1 = new DashboardItemGroup()
            {
                Name = "Filters"
            };

            group1.InteractivityOptions.IsMasterFilter = true;
            dashboard1.Groups.Add(group1);
            group1.AddRange(comboBox1, treeView1, listBox1);

            ChartDashboardItem chart1 = new ChartDashboardItem()
            {
                Name       = "Browser Statistics",
                DataSource = dataSource,
                DataMember = "Statistics",
            };

            chart1.Arguments.Add(new Dimension("Date", DateTimeGroupInterval.MonthYear));
            chart1.SeriesDimensions.AddRange(new Dimension("Browser"), new Dimension("BrowserDetails"));
            chart1.Panes.Add(new ChartPane());
            SimpleSeries salesAmountSeries = new SimpleSeries(SimpleSeriesType.SplineArea);

            salesAmountSeries.Value = new Measure("Count");
            chart1.Panes[0].Series.Add(salesAmountSeries);
            dashboard1.Items.Add(chart1);

            return(dashboard1);
        }
示例#25
0
    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent()
    {
        string resourceFileName = "RequestDashboard.resx";

        DevExpress.DashboardCommon.ChartPane            chartPane1            = new DevExpress.DashboardCommon.ChartPane();
        DevExpress.DashboardCommon.ChartPane            chartPane2            = new DevExpress.DashboardCommon.ChartPane();
        DevExpress.DashboardCommon.ChartPane            chartPane3            = new DevExpress.DashboardCommon.ChartPane();
        DevExpress.DashboardCommon.DashboardLayoutGroup dashboardLayoutGroup1 = new DevExpress.DashboardCommon.DashboardLayoutGroup();
        DevExpress.DashboardCommon.DashboardLayoutGroup dashboardLayoutGroup2 = new DevExpress.DashboardCommon.DashboardLayoutGroup();
        DevExpress.DashboardCommon.DashboardLayoutItem  dashboardLayoutItem1  = new DevExpress.DashboardCommon.DashboardLayoutItem();
        DevExpress.DashboardCommon.DashboardLayoutItem  dashboardLayoutItem2  = new DevExpress.DashboardCommon.DashboardLayoutItem();
        DevExpress.DashboardCommon.DashboardLayoutGroup dashboardLayoutGroup3 = new DevExpress.DashboardCommon.DashboardLayoutGroup();
        DevExpress.DashboardCommon.DashboardLayoutItem  dashboardLayoutItem3  = new DevExpress.DashboardCommon.DashboardLayoutItem();
        DevExpress.DashboardCommon.DashboardLayoutItem  dashboardLayoutItem4  = new DevExpress.DashboardCommon.DashboardLayoutItem();
        DevExpress.DashboardCommon.DashboardLayoutItem  dashboardLayoutItem5  = new DevExpress.DashboardCommon.DashboardLayoutItem();
        this.chartDashboardItem1       = new DevExpress.DashboardCommon.ChartDashboardItem();
        this.chartDashboardItem2       = new DevExpress.DashboardCommon.ChartDashboardItem();
        this.pieDashboardItem1         = new DevExpress.DashboardCommon.PieDashboardItem();
        this.chartDashboardItem3       = new DevExpress.DashboardCommon.ChartDashboardItem();
        this.rangeFilterDashboardItem1 = new DevExpress.DashboardCommon.RangeFilterDashboardItem();
        ((System.ComponentModel.ISupportInitialize)(this.chartDashboardItem1)).BeginInit();
        ((System.ComponentModel.ISupportInitialize)(this.chartDashboardItem2)).BeginInit();
        ((System.ComponentModel.ISupportInitialize)(this.pieDashboardItem1)).BeginInit();
        ((System.ComponentModel.ISupportInitialize)(this.chartDashboardItem3)).BeginInit();
        ((System.ComponentModel.ISupportInitialize)(this.rangeFilterDashboardItem1)).BeginInit();
        ((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
        //
        // chartDashboardItem1
        //
        this.chartDashboardItem1.AxisX.TitleVisible = false;
        this.chartDashboardItem1.ComponentName      = "chartDashboardItem1";
        this.chartDashboardItem1.DataItemRepository.Clear();
        this.chartDashboardItem1.InteractivityOptions.IgnoreMasterFilters = false;
        this.chartDashboardItem1.Name = "Chart 1";
        chartPane1.Name = "Pane 1";
        chartPane1.PrimaryAxisY.ShowGridLines   = true;
        chartPane1.PrimaryAxisY.TitleVisible    = true;
        chartPane1.SecondaryAxisY.ShowGridLines = false;
        chartPane1.SecondaryAxisY.TitleVisible  = true;
        this.chartDashboardItem1.Panes.AddRange(new DevExpress.DashboardCommon.ChartPane[] {
            chartPane1
        });
        this.chartDashboardItem1.ShowCaption = true;
        //
        // chartDashboardItem2
        //
        this.chartDashboardItem2.AxisX.TitleVisible = false;
        this.chartDashboardItem2.ComponentName      = "chartDashboardItem2";
        this.chartDashboardItem2.DataItemRepository.Clear();
        this.chartDashboardItem2.InteractivityOptions.IgnoreMasterFilters = false;
        this.chartDashboardItem2.Name = "Chart 2";
        chartPane2.Name = "Pane 1";
        chartPane2.PrimaryAxisY.ShowGridLines   = true;
        chartPane2.PrimaryAxisY.TitleVisible    = true;
        chartPane2.SecondaryAxisY.ShowGridLines = false;
        chartPane2.SecondaryAxisY.TitleVisible  = true;
        this.chartDashboardItem2.Panes.AddRange(new DevExpress.DashboardCommon.ChartPane[] {
            chartPane2
        });
        this.chartDashboardItem2.ShowCaption = true;
        //
        // pieDashboardItem1
        //
        this.pieDashboardItem1.ComponentName = "pieDashboardItem1";
        this.pieDashboardItem1.DataItemRepository.Clear();
        this.pieDashboardItem1.InteractivityOptions.IgnoreMasterFilters = false;
        this.pieDashboardItem1.Name        = "Pies 1";
        this.pieDashboardItem1.ShowCaption = true;
        //
        // chartDashboardItem3
        //
        this.chartDashboardItem3.AxisX.TitleVisible = false;
        this.chartDashboardItem3.ComponentName      = "chartDashboardItem3";
        this.chartDashboardItem3.DataItemRepository.Clear();
        this.chartDashboardItem3.InteractivityOptions.IgnoreMasterFilters = false;
        this.chartDashboardItem3.Name = "Chart 3";
        chartPane3.Name = "Pane 1";
        chartPane3.PrimaryAxisY.ShowGridLines   = true;
        chartPane3.PrimaryAxisY.TitleVisible    = true;
        chartPane3.SecondaryAxisY.ShowGridLines = false;
        chartPane3.SecondaryAxisY.TitleVisible  = true;
        this.chartDashboardItem3.Panes.AddRange(new DevExpress.DashboardCommon.ChartPane[] {
            chartPane3
        });
        this.chartDashboardItem3.ShowCaption = true;
        //
        // rangeFilterDashboardItem1
        //
        this.rangeFilterDashboardItem1.ComponentName = "rangeFilterDashboardItem1";
        this.rangeFilterDashboardItem1.DataItemRepository.Clear();
        this.rangeFilterDashboardItem1.InteractivityOptions.IgnoreMasterFilters = true;
        this.rangeFilterDashboardItem1.Name        = "Range Filter 1";
        this.rangeFilterDashboardItem1.ShowCaption = false;
        //
        // RequestDashboard
        //
        this.Items.AddRange(new DevExpress.DashboardCommon.DashboardItem[] {
            this.chartDashboardItem1,
            this.chartDashboardItem2,
            this.pieDashboardItem1,
            this.chartDashboardItem3,
            this.rangeFilterDashboardItem1
        });
        dashboardLayoutItem1.DashboardItem = this.chartDashboardItem1;
        dashboardLayoutItem1.Weight        = 42.533185840707965D;
        dashboardLayoutItem2.DashboardItem = this.chartDashboardItem2;
        dashboardLayoutItem2.Weight        = 57.466814159292035D;
        dashboardLayoutGroup2.ChildNodes.AddRange(new DevExpress.DashboardCommon.DashboardLayoutNode[] {
            dashboardLayoutItem1,
            dashboardLayoutItem2
        });
        dashboardLayoutGroup2.DashboardItem = null;
        dashboardLayoutGroup2.Weight        = 50.0503524672709D;
        dashboardLayoutItem3.DashboardItem  = this.pieDashboardItem1;
        dashboardLayoutItem3.Weight         = 27.876106194690266D;
        dashboardLayoutItem4.DashboardItem  = this.chartDashboardItem3;
        dashboardLayoutItem4.Weight         = 72.123893805309734D;
        dashboardLayoutGroup3.ChildNodes.AddRange(new DevExpress.DashboardCommon.DashboardLayoutNode[] {
            dashboardLayoutItem3,
            dashboardLayoutItem4
        });
        dashboardLayoutGroup3.DashboardItem = null;
        dashboardLayoutGroup3.Weight        = 24.974823766364551D;
        dashboardLayoutItem5.DashboardItem  = this.rangeFilterDashboardItem1;
        dashboardLayoutItem5.Weight         = 24.974823766364551D;
        dashboardLayoutGroup1.ChildNodes.AddRange(new DevExpress.DashboardCommon.DashboardLayoutNode[] {
            dashboardLayoutGroup2,
            dashboardLayoutGroup3,
            dashboardLayoutItem5
        });
        dashboardLayoutGroup1.DashboardItem = null;
        dashboardLayoutGroup1.Orientation   = DevExpress.DashboardCommon.DashboardLayoutGroupOrientation.Vertical;
        this.LayoutRoot = dashboardLayoutGroup1;
        this.Title.ImageDataSerializable = "";
        this.Title.Text = "Dashboard";
        ((System.ComponentModel.ISupportInitialize)(this.chartDashboardItem1)).EndInit();
        ((System.ComponentModel.ISupportInitialize)(this.chartDashboardItem2)).EndInit();
        ((System.ComponentModel.ISupportInitialize)(this.pieDashboardItem1)).EndInit();
        ((System.ComponentModel.ISupportInitialize)(this.chartDashboardItem3)).EndInit();
        ((System.ComponentModel.ISupportInitialize)(this.rangeFilterDashboardItem1)).EndInit();
        ((System.ComponentModel.ISupportInitialize)(this)).EndInit();
    }