コード例 #1
0
ファイル: MainPage.cs プロジェクト: bricunni04/csharp-1
 private void chartJS_ChartClick(object sender, ChartClickEventArgs e)
 {
     AlertBox.Show(
         "<br>" + ((Control)sender).Text + ":</b> " + e.Values[0],
         MessageBoxIcon.Information,
         alignment: ContentAlignment.MiddleRight);
 }
コード例 #2
0
 protected void rc_bar_latest_Click(object sender, ChartClickEventArgs args)
 {
     if (args.SeriesItem != null)
     {
         if (args.SeriesItem.Parent.Name == "parent_series")
         {
             // Load latest Sales Book
             Session["loadArea"] = args.SeriesItem.Name;
         }
         Response.Redirect("~/Dashboard/SBInput/SBInput.aspx");
     }
 }
コード例 #3
0
        void RadChartGrafica_Click(object sender, ChartClickEventArgs args)
        {
            //if (args.Series != null)
            //{
            //    if (args.Series.Name.Equals(args.Series.Name))
            //    {
            //        if (args.SeriesItem != null)
            //        {
            //            if (int.Parse(ddlPresentacion.SelectedItem.Value) == 1)
            //            {
            //                string texto = "";
            //                if (args.SeriesItem.Name.IndexOf("[[") >= 0)
            //                    texto = args.SeriesItem.Name.Substring(args.SeriesItem.Name.LastIndexOf("]]") + 2).Trim();
            //                else
            //                    texto = args.SeriesItem.Name;

            //                RespGraf = texto; //Almacena en la variable el valor de la respuesta seleccionada

            //                index = indexPregunta - 1; //Obtine index (posición del arreglo de Respuestas)
            //                ArrayPreguntasRespuestas[index] = RespGraf;
            //                Refrescar(int.Parse(hdnIdEncuesta.Value), int.Parse(args.SeriesItem.ActiveRegion.Attributes), int.Parse(ddlPresentacion.SelectedItem.Value));
            //            }
            //            if (int.Parse(ddlPresentacion.SelectedItem.Value) == 2) //Pregunta
            //            {
            //                divDatos.InnerHtml = "";
            //                //Valida ultima pregunta
            //                if (indexPregunta == GridVPreguntas.Rows.Count - 1)
            //                {
            //                    GridVPreguntas.SelectRow(0); //Selecciona Primera pregunta
            //                }
            //                else
            //                {
            //                    GridVPreguntas.SelectRow(indexPregunta + 1);
            //                }
            //                //btnAtras.Visible = false;
            //            }
            //        }
            //    }
            //}
        }
コード例 #4
0
ファイル: Form1.cs プロジェクト: imaxmunguia/EjemploPracticos
        private void radChart1_Click(object sender, ChartClickEventArgs args)
        {
            if (args.Element.ActiveRegion.Parent is ChartSeriesItem &&
                (args.Element.ActiveRegion.Parent as ChartSeriesItem).Parent.Name == "Years")
            {
                //a bar representing the revenue for a year was clicked
                year = (args.Element as ChartSeriesItem).Index + 2003;
                //fill revenue values for the year whose bar was clicked
                rta.FillByQuarter(this.chartDataSet.Revenue, year);

                //setup chart properties with appopriate axis labels
                radChart1.PlotArea.XAxis.DataLabelsColumn = "Quarter";
                radChart1.Series[0].Clear();
                radChart1.Series[0].DataYColumn = "Revenue";
                radChart1.Series[0].Name        = "Quarters";
                radChart1.DataBind();
            }
            else if (args.Element is ChartSeriesItem &&
                     (args.Element as ChartSeriesItem).Parent.Name == "Quarters")
            {
                //a bar representing the revenue for a year was clicked
                int quarter = (args.Element as ChartSeriesItem).Index + 1;

                //fill revenue values for the year whose bar was clicked
                rta.FillByMonth(this.chartDataSet.Revenue, year, quarter);

                //setup chart properties with appopriate axis labels
                radChart1.PlotArea.XAxis.DataLabelsColumn = "Month";
                radChart1.Series[0].Clear();
                radChart1.Series[0].DataYColumn = "Revenue";
                radChart1.Series[0].Name        = "Months";
                radChart1.DataBind();

                //Detach Click event handler for the innermost chart
#pragma warning disable 618
                radChart1.Click -= new RadChart.ChartClickEventHandler(radChart1_Click);
            }
        }
コード例 #5
0
        protected void pieChart_Click(object sender, ChartClickEventArgs args)
        {
            if (args.SeriesItem != null)
            {
                SessionObject.TeacherSearchParms.DeleteParm("SchoolType");
                SessionObject.TeacherSearchParms.AddParm("SchoolType", args.SeriesItem.Name.ToString());

                teacherPieChartXmlHttpPanel.Attributes["level"] = teacherSearch_HiddenLevel.Value;
                teacherPieChartXmlHttpPanel.Attributes["levelID"] = teacherSearch_HiddenLevelID.Value;
                teacherPieChartXmlHttpPanel.Attributes["searchTileName"] = "teachers";
                teacherPieChartXmlHttpPanel.Attributes["controlURL"] = "../Controls/Teacher/TeacherSearch_Expanded.aspx";
                teacherPieChartXmlHttpPanel.Value = "{\"EmptyString\":\"\"}";
                /*
                    if (Tile.ParentContainer != null)
                            Tile.ParentContainer.ExpandTile(Tile, "Expand");*/
            }
        }
コード例 #6
0
        protected void pieChart_Click(object sender, ChartClickEventArgs args)
        {
            if (args.SeriesItem != null)
            {
                var pieChartValue = string.Empty;
                switch(_level)
                {
                    case EntityTypes.Teacher:
                    case EntityTypes.School:
                        pieChartValue = args.SeriesItem.XValue.ToString();
                        break;
                    case EntityTypes.District:
                        pieChartValue = args.SeriesItem.Name;
                        break;
                }
                SessionObject.StudentSearchParms.DeleteParm("PieChartValue");
                SessionObject.StudentSearchParms.AddParm("PieChartValue", pieChartValue);

                studentPieChartXmlHttpPanel.Attributes["level"] = studentsearch_hiddenLevel.Value;
                studentPieChartXmlHttpPanel.Attributes["levelID"] = studentsearch_hiddenLevelID.Value;
                studentPieChartXmlHttpPanel.Attributes["searchTileName"] = "students";
                studentPieChartXmlHttpPanel.Attributes["controlURL"] = "../Controls/Student/StudentSearch_Expanded.aspx";
                studentPieChartXmlHttpPanel.Value = "{\"EmptyString\":\"\"}";
                /*
                if (Tile.ParentContainer != null)
                    Tile.ParentContainer.ExpandTile(Tile, "Expand");*/
            }
        }
コード例 #7
0
        protected void pieChart_Click(object sender, ChartClickEventArgs args)
        {
            if (args.SeriesItem != null)
            {
                var pieChartValue = string.Empty;
                switch (_level)
                {
                    case EntityTypes.School:
                        pieChartValue = args.SeriesItem.XValue.ToString();
                        break;
                    case EntityTypes.District:
                        pieChartValue = args.SeriesItem.Name;
                        break;
                }

                _sessionObject.StudentSearchParms.DeleteParm("PieChartValue");
                _sessionObject.StudentSearchParms.AddParm("PieChartValue", pieChartValue);

                #region  Student PieChart XmlHttpPanel - Depricated for the moment, but we should keep here for future enhancements
                //studentPieChartXmlHttpPanel.Attributes["level"] = studentsearch_hiddenLevel.Value;
                //studentPieChartXmlHttpPanel.Attributes["levelID"] = studentsearch_hiddenLevelID.Value;
                //studentPieChartXmlHttpPanel.Attributes["searchTileName"] = "students";
                //studentPieChartXmlHttpPanel.Attributes["controlURL"] = "../Controls/Student/StudentSearch_Expanded.aspx";
                //studentPieChartXmlHttpPanel.Value = "{\"EmptyString\":\"\"}";
                #endregion
            }
        }
コード例 #8
0
    protected void rc_pie_annual_Click(object sender, ChartClickEventArgs args)
    {
        if (args.SeriesItem != null)
        {
            if (args.SeriesItem.Parent.Name == "parent_series")
            {
                lbl_drill_down.Text = "Click a pie section to load the book";
                String territory = args.SeriesItem.Name;
                btn_back.Enabled = true;

                // Format chart for drill
                rc_pie_annual.Clear();
                rc_pie_annual.PlotArea.XAxis.Items.Clear();
                rc_pie_annual.ChartTitle.Visible        = true;
                rc_pie_annual.ChartTitle.TextBlock.Text = territory + "'s " + dd_annual_year.Text + " Books";
                rc_pie_annual.PlotArea.YAxis.AxisMode   = ChartYAxisMode.Extended;


                // Define and add territory chart series
                ChartSeries territory_series = new ChartSeries(territory, ChartSeriesType.Pie);
                territory_series.Appearance.LegendDisplayMode = Telerik.Charting.ChartSeriesLegendDisplayMode.ItemLabels;
                territory_series.Appearance.TextAppearance.TextProperties.Color = Color.DarkOrange;
                rc_pie_annual.Series.Add(territory_series);

                // Get top two books
                String qry = "SELECT x.IssueName, ROUND(x.originalprice-IFNULL(CONVERT(SUM(db_salesbook.rl_price*Conversion),SIGNED),0)) as total_price, x.StartDate " +
                             "FROM " +
                             "( " +
                             "    SELECT sbh.SalesBookID, IssueName, CONVERT(SUM(Price*Conversion),SIGNED) as originalprice, StartDate " +
                             "    FROM db_salesbook sb, db_salesbookhead sbh " +
                             "    WHERE sb.sb_id = sbh.SalesBookID " +
                             "    AND YEAR(StartDate)=@year " +
                             "    AND deleted=0 AND IsDeleted=0 " +
                             "    AND Office=@office " +
                             "    GROUP BY sbh.SalesBookID " +
                             "    ORDER BY StartDate " +
                             ") as x " +
                             "LEFT JOIN db_salesbook ON " +
                             "x.SalesBookID = db_salesbook.rl_sb_id " +
                             "GROUP BY x.IssueName " +
                             "ORDER BY x.StartDate";
                String[]  pn           = { "@office", "@year" };
                Object[]  pv           = { territory, dd_annual_year.Text };
                DataTable dt_book_data = SQL.SelectDataTable(qry, pn, pv);

                if (dt_book_data.Rows.Count > 0)
                {
                    for (int i = 0; i < dt_book_data.Rows.Count; i++)
                    {
                        if (dt_book_data.Rows[i]["total_price"] != DBNull.Value)
                        {
                            String          bookName = dt_book_data.Rows[i]["IssueName"].ToString();
                            double          price    = Convert.ToDouble(dt_book_data.Rows[i]["total_price"]);
                            Color           colour   = Color.FromArgb(r.Next(256), r.Next(256), r.Next(256));
                            ChartSeriesItem csi_item = new ChartSeriesItem(
                                price,
                                Util.TextToCurrency(price.ToString(), "usd"),
                                colour,
                                false);

                            csi_item.Appearance.FillStyle.SecondColor = colour;
                            csi_item.Name   = bookName;
                            csi_item.Parent = territory_series;
                            territory_series.AddItem(csi_item);

                            if (i == dt_book_data.Rows.Count - 1)
                            {
                                csi_item.Appearance.Exploded = true;
                            }
                        }
                    }
                }

                if (dt_book_data.Rows.Count > 11)
                {
                    rc_pie_annual.Height = 400;
                }
                else
                {
                    rc_pie_annual.Height = 300;
                }
            }
            else
            {
                // Just re-use bar chart transfer
                rc_bar_latest_Click(sender, args);
            }
        }
    }
コード例 #9
0
        protected void pieChart_Click(object sender, ChartClickEventArgs args)
        {
            //if (args.SeriesItem != null)
            //{
            //    SessionObject.TeacherSearchParms.DeleteParm("SchoolType");
            //    SessionObject.TeacherSearchParms.AddParm("SchoolType", args.SeriesItem.XValue.ToString());

            //    staffPieChartXmlHttpPanel.Attributes["level"] = staffSearch_HiddenLevel.Value;
            //    staffPieChartXmlHttpPanel.Attributes["levelID"] = staffSearch_HiddenLevelID.Value;
            //    staffPieChartXmlHttpPanel.Attributes["searchTileName"] = "staff";
            //    staffPieChartXmlHttpPanel.Attributes["controlURL"] = "../Controls/LCO/StaffSearch_Expanded.aspx";
            //    staffPieChartXmlHttpPanel.Value = "{\"EmptyString\":\"\"}";
            //    /*
            //        if (Tile.ParentContainer != null)
            //                Tile.ParentContainer.ExpandTile(Tile, "Expand");*/
            //}
        }
コード例 #10
0
 /// <summary>报表点击事件
 /// </summary>
 protected void GoodsStockTurnOverRadChart_OnClick(object sender, ChartClickEventArgs args)
 {
     RAM.ResponseScripts.Add(string.Format("return GoodsStockTurnOverRadChartClick('{0}','{1}','{2}',{3})", GoodsClassId, PersonnelId, GoodsNameOrCode, State));
 }