Ejemplo n.º 1
0
        public static void PlaceChartInCell(DxChart mychart, TableCell container, int width, int height)
        {
            if (mychart.chart != null)
            {
                if (!mychart.isempty)
                {
                    mychart.chart.Width  = width;
                    mychart.chart.Height = height;

                    string chartname = String.Format("chart{0}", Guid.NewGuid());                     //System.DateTime.Now.Ticks);
                    mychart.chart.ClientInstanceName = chartname;
                    mychart.chart.ID = chartname;

                    //Render the Checkbox here for when selecting specific charts to save.
                    //container.Controls.Add(mychart.chk);
                    container.Controls.Add(mychart.chart);
                }
                else
                {
                    Label lbl = new Label();
                    lbl.Text = (String.IsNullOrEmpty(mychart.emptymsg)) ? "empty chart" : mychart.emptymsg.Replace(Environment.NewLine, "<br/>");
                    container.Controls.Add(lbl);
                }
            }
        }
Ejemplo n.º 2
0
        public static void PlaceChartInCell(DxChart chart, TableCell container, string empty)
        {
            Label lbl = new Label();

            lbl.Text = empty;
            container.Controls.Add(lbl);
        }
Ejemplo n.º 3
0
        public static void PlaceChartInCell(DxChart chart, TableCell container, int chartW, int chartH, double pct_w, double pct_h)
        {
            int w = (int)(chartW * pct_w);
            int h = (int)(chartH * pct_h);

            PlaceChartInCell(chart, container, w, h);
        }
Ejemplo n.º 4
0
        public static Table HorizontalTable(DxChartBatch batch, string obj)
        {
            Table t = new Table();

            int numrow  = (int)(batch.charts.Count / batch.maxCol) + 1;
            int counter = 0;

            for (int i = 0; i < numrow; i++)
            {
                TableRow r = new TableRow();
                for (int j = 0; j < batch.maxCol; j++)
                {
                    TableCell c       = new TableCell();
                    bool      addcell = true;
                    if (counter < batch.charts.Count)
                    {
                        int newW = Convert.ToInt32(batch.charts[counter].W);
                        int newH = Convert.ToInt32(batch.charts[counter].H);

                        DxChart thisdxchart = batch.charts[counter];
                        if (thisdxchart.chart == null | thisdxchart.chart.Series.Count == 0)
                        {
                            addcell = !batch.batchsettings.hideEmptyCharts;
                            //if we want to hideEmptyCharts (=T, that is Not Show It) then we don't want to add the cell.
                            //if we don't want to hideEmptyCharts (=F, that is Show It) then we do want to add the cell.
                            string thisdxchart_info = String.Format("# series={0}   # vars={1}   emptymsg={2} "
                                                                    , thisdxchart.chart.Series.Count, batch.batchsettings.numvars.Count, thisdxchart.emptymsg);

                            PlaceTextInCell(c, thisdxchart_info);
                        }
                        else
                        {
                            if (obj == "chart")
                            {
                                PlaceChartInCell(batch.charts[counter], c, newW, newH);
                            }
                            else if (obj == "datatable")
                            {
                                PlaceTableInCell(batch.datatables[counter], c);
                            }
                            counter++;
                        }
                    }
                    if (addcell)
                    {
                        r.Cells.Add(c);
                    }
                }
                t.Rows.Add(r);
            }

            return(t);
        }