コード例 #1
0
    public string CreateChart1()
    {
        var ds     = _fmsgrph.GetPriorMaintenanceStageGraph();
        var strXml = "";

        strXml += "<graph caption='Vehicles in particular stages' YAxisName='No. of Vehicles' numDivLines='6' formatNumberScale='0' decimalPrecision='0' anchorSides='10' anchorRadius='3' anchorBorderColor='009900' rotateNames='1' animation='1' yAxisMinValue='0'>";
        strXml += "<categories>";
        strXml += "<category name='All Vehicles' /> ";
        strXml += "<category name='Fabricated Vehicles' /> ";
        strXml += "<category name='PreDelInspected Vehicles' /> ";
        strXml += "<category name='Registered Vehicles' /> ";
        strXml += "<category name='HandOvered Vehicles' /> ";
        strXml += "</categories>";
        strXml += "<dataset seriesName='Approved' color='8BBA00' showValues='1'>";
        foreach (DataRow dr in ds.Tables[0].Rows)
        {
            strXml += " <set value='" + dr[0] + "' color='8BBA00' link=''/>";
            strXml += " <set value='" + dr[1] + "' color='DBBA00' link=''/>";
            strXml += " <set value='" + dr[3] + "' color='ACBA00' link=''/>";
            strXml += " <set value='" + dr[4] + "' color='8AAA00' link=''/>";
            strXml += " <set value='" + dr[2] + "' color='CABA00' link=''/>";
        }

        strXml += " </dataset>";
        strXml += "</graph>";
        return(FusionCharts.RenderChartHTML("FusionCharts/FCF_MSColumn3D.swf", "", strXml, "myNext", "700", "500", false));
    }
コード例 #2
0
    /// <summary>
    /// drillDown to show Column2D chart
    /// </summary>
    /// <param name="FacID">Factory Id</param>
    private void drillDown(string FacID)
    {
        //SQL Query for Factory Details for the factory Id passed as parameter
        string strSQL = "select  a.FactoryId,a.FactoryName,b.DatePro,b.Quantity from Factory_Master a,Factory_Output b where a.FactoryId=b.FactoryID and a.FactoryId=" + FacID + " order by b.DatePro";

        // Create data reader
        DbConn oRs = new DbConn(strSQL);

        //strXML for storing XML
        StringBuilder strXML = new StringBuilder();

        //Add Chart element
        strXML.AppendFormat("<chart caption='Factory wise Production' subcaption='Factory {0} : Daily Production' xAxisName='Day' yAxisName='Units' rotateLabels='1' bgAlpha='100' bgColor='ffffff' showBorder='0' showvalues='0' yAxisMaxValue='200'>", FacID);
        //Iterate through database
        while (oRs.ReadData.Read())
        {
            // add set element
            strXML.AppendFormat("<set label='{0}' value='{1}' />", Convert.ToDateTime(oRs.ReadData["DatePro"]).ToString("d/M"), oRs.ReadData["Quantity"].ToString());
        }
        // close data reader
        oRs.ReadData.Close();

        // close chart element
        strXML.Append("</chart>");

        // create Column2D chart and srore it to output string
        string outPut = FusionCharts.RenderChartHTML("../FusionCharts/Column2D.swf", "", strXML.ToString(), "chart2", "450", "350", false);

        // clear the Panel
        Panel1.Controls.Clear();
        //Add chart to the panel
        Panel1.Controls.Add(new LiteralControl(outPut));
    }
コード例 #3
0
    private void CreatePieGraph()
    {
        string strCaption    = "Year wise Sales report";
        string strSubCaption = "2000 - 2008";
        string xAxis         = "No_of_Orders";
        string yAxis         = "Order_Status";

        //strXML will be used to store the entire XML document generated
        string strXML = null;

        //Generate the graph element
        strXML = @"<graph caption='" + strCaption + @"' subCaption='" + strSubCaption + @"' decimalPrecision='0' 
                          pieSliceDepth='30' formatNumberScale='0'
                          xAxisName='" + xAxis + @"' yAxisName='" + yAxis + @"' rotateNames='1'>";

        int i = 0;

        foreach (DataRow DR in dt.Rows)
        {
            strXML += "<set name='" + DR[0].ToString() + "' value='" + DR[1].ToString() + "' color='" + color[i] + @"'  link=&quot;JavaScript:myJS('" + DR["Order_Status"].ToString() + ", " + DR["No_of_Orders"].ToString() + "'); &quot;/>";
            i++;
        }

        //Finally, close <graph> element
        strXML += "</graph>";

        FCLiteral1.Text = FusionCharts.RenderChartHTML(
            "FusionCharts/FCF_Line.swf",       // Path to chart's SWF
            "",                                // Leave blank when using Data String method
            strXML,                            // xmlStr contains the chart data
            "mygraph1",                        // Unique chart ID
            GraphWidth, GraphHeight,           // Width & Height of chart
            false
            );
    }
コード例 #4
0
        protected void BindSectorPiaChart(DataTable dtSectorPiaChart)
        {
            int           count   = 0;
            StringBuilder strXML2 = new StringBuilder();

            strXML2.Append(@"<chart caption='Fund Sector' chartTopMargin='0' bgcolor='#ffffff' showHoverEffect='1' showLegend='0' exportenabled='1' captionPadding='0' chartLeftMargin='0'
                        chartRightMargin='0' chartBottomMargin='0' showborder='0' use3dlighting='0' showshadow='0'  showLabels='0'> ");
            if (dtSectorPiaChart.Rows.Count > 0)
            {
                foreach (DataRow dr in dtSectorPiaChart.Rows)
                {
                    strXML2.AppendFormat(@"<set label='{0}' value='{1}' />", dr["sector"].ToString().Replace("&", "and"), dr["holdingpercentage"]);
                    count++;
                    if (count > 5)
                    {
                        break;
                    }
                }
                strXML2.Append(@"</chart>");
                ltrSector.Text = FusionCharts.RenderChartHTML("../FusionCharts/Pie2D.swf", "", strXML2.ToString(), "FactorySum2", "100%", "150", false, true, false);
            }
            else
            {
                ltrSector.Text = "No record found";
            }
        }
コード例 #5
0
        protected void BindAssetsPiaChart(DataTable dtAssetsPiaChart)
        {
            int count = 0;

            StringBuilder strXML3 = new StringBuilder();

            strXML3.Append(@"<chart caption='Assets Allocation' chartTopMargin='0' bgcolor='#ffffff' showLegend='1' showHoverEffect='1' captionPadding='0' chartLeftMargin='0'
                        chartRightMargin='0' chartBottomMargin='0' showborder='0' use3dlighting='0' showshadow='0' showLabels='0' > ");
            if (dtAssetsPiaChart.Rows.Count > 0)
            {
                foreach (DataRow dr in dtAssetsPiaChart.Rows)
                {
                    strXML3.AppendFormat(@"<set label='{0}' value='{1}' />", dr["asset"].ToString().Replace("&", "and"), dr["assetvalue"]);
                    count++;
                    if (count > 5)
                    {
                        break;
                    }
                }
                strXML3.Append(@"</chart>");
                raj.Text = FusionCharts.RenderChartHTML("../FusionCharts/Pie2D.swf", "", strXML3.ToString(), "FactorySum3", "100%", "150", false, true, false);
            }
            else
            {
                raj.Text = "No record found";
            }
            //ltrAssets.Text = FusionCharts.RenderChartHTML("../FusionCharts/Pie3D.swf", "", strXML3.ToString(), "FactorySum3", "100%", "150", false, true, false);
        }
コード例 #6
0
        protected void BindHoldingPiaChart(DataTable dtHoldingPiaChart)
        {
            StringBuilder strXML1 = new StringBuilder();
            int           count   = 0;

            strXML1.Append(@"<chart caption='Fund Holding' chartTopMargin='0' bgcolor='#ffffff' showHoverEffect='1' captionPadding='0' chartLeftMargin='0'
                        chartRightMargin='0' chartBottomMargin='0' showborder='0' use3dlighting='0' showshadow='0'  showLabels='0'  showlegend='1' legendbgcolor='#ffffff' legendborderalpha='0' legendshadow='0' legenditemfontsize='10' legenditemfontcolor='#666666' legendPosition='RIGHT'> ");
            if (dtHoldingPiaChart.Rows.Count > 0)
            {
                foreach (DataRow dr in dtHoldingPiaChart.Rows)
                {
                    strXML1.AppendFormat(@"<set label='{0}' value='{1}'  />", dr["co_name"].ToString().Replace("&", "and"), dr["perc_hold"]);
                    count++;
                    if (count > 5)
                    {
                        break;
                    }
                }
                strXML1.Append(@"</chart>");
                ltrHolding.Text = FusionCharts.RenderChartHTML("../FusionCharts/Pie2D.swf", "", strXML1.ToString(), "FactorySum1", "100%", "150", false, true, false);
            }
            else
            {
                ltrHolding.Text = "No record found";
            }
        }
コード例 #7
0
    public string GetMonthlySalesChartHtml()
    {
        //This page demonstrates the ease of generating charts using FusionCharts.
        //For this chart, we've used a string variable to contain our entire XML data.

        //Ideally, you would generate XML data documents at run-time, after interfacing with
        //forms or databases etc.Such examples are also present.
        //Here, we've kept this example very simple.

        //Create an XML data document in a string variable
        StringBuilder xmlData = new StringBuilder();

        xmlData.Append("<chart caption='Monthly Unit Sales' xAxisName='Month' yAxisName='Units' showValues='0' formatNumberScale='0' showBorder='1'>");
        xmlData.Append("<set label='Jan' value='462' />");
        xmlData.Append("<set label='Feb' value='857' />");
        xmlData.Append("<set label='Mar' value='671' />");
        xmlData.Append("<set label='Apr' value='494' />");
        xmlData.Append("<set label='May' value='761' />");
        xmlData.Append("<set label='Jun' value='960' />");
        xmlData.Append("<set label='Jul' value='629' />");
        xmlData.Append("<set label='Aug' value='622' />");
        xmlData.Append("<set label='Sep' value='376' />");
        xmlData.Append("<set label='Oct' value='494' />");
        xmlData.Append("<set label='Nov' value='761' />");
        xmlData.Append("<set label='Dec' value='960' />");
        xmlData.Append("</chart>");

        //Create the chart - Column 3D Chart with data from xmlData variable using dataXML method
        return(FusionCharts.RenderChartHTML("../FusionCharts/Column3D.swf", "", xmlData.ToString(), "myNext", "600", "300", false));
    }
コード例 #8
0
    public string CreateCharts()
    {
        //This page demonstrates the ease of generating charts using FusionCharts.
        //For this chart, we've used a string variable to contain our entire XML data.

        //Ideally, you would generate XML data documents at run-time, after interfacing with
        //forms or databases etc.Such examples are also present.
        //Here, we've kept this example very simple.

        //Create an XML data document in a string variable

        string strXML;

        strXML  = "";
        strXML += "<graph caption='Monthly Unit Sales' xAxisName='Month' yAxisName='Units' decimalPrecision='0' formatNumberScale='0'>";
        strXML += "<set name='Jan' value='462' color='AFD8F8' />";
        strXML += "<set name='Feb' value='857' color='F6BD0F' />";
        strXML += "<set name='Mar' value='671' color='8BBA00' />";
        strXML += "<set name='Apr' value='494' color='FF8E46'/>";
        strXML += "<set name='May' value='761' color='008E8E'/>";
        strXML += "<set name='Jun' value='960' color='D64646'/>";
        strXML += "<set name='Jul' value='629' color='8E468E'/>";
        strXML += "<set name='Aug' value='622' color='588526'/>";
        strXML += "<set name='Sep' value='376' color='B3AA00'/>";
        strXML += "<set name='Oct' value='494' color='008ED6'/>";
        strXML += "<set name='Nov' value='761' color='9D080D'/>";
        strXML += "<set name='Dec' value='960' color='A186BE'/>";
        strXML += "</graph>";

        //Create the chart - Column 3D Chart with data from strXML variable using dataXML method
        return(FusionCharts.RenderChartHTML("../FusionCharts/FCF_Column3D.swf", "", strXML, "myNext", "600", "300", false));
    }
コード例 #9
0
        protected void BindAssetsPiaChart(DataTable dtAssetsPiaChart)
        {
            int count = 0;

            StringBuilder strXML3 = new StringBuilder();

            strXML3.Append(@"<chart caption='Assets Allocation' chartTopMargin='0' bgcolor='FFFFFF' showvalues='1' showpercentvalues='1'  showLegend='1' showHoverEffect='1' captionPadding='0' chartLeftMargin='0'
                        chartRightMargin='0' chartBottomMargin='0' showborder='0' use3dlighting='0' showshadow='0' showLabels='1' legendborder='0' legendposition='bottom' enablesmartlabels='1' legendbgcolor='#CCCCCC' legendbgalpha='20' legendborderalpha='0' legendshadow='0' legendnumcolumns='3'> ");
            if (dtAssetsPiaChart.Rows.Count > 0)
            {
                foreach (DataRow dr in dtAssetsPiaChart.Rows)
                {
                    strXML3.AppendFormat(@"<set label='{0}' value='{1}' />", dr["WAC_AssetClassification"].ToString(), dr["AllocationPercentage"]);
                    count++;
                    if (count > 5)
                    {
                        break;
                    }
                }
                strXML3.Append(@"</chart>");
                ltrAssets.Text = FusionCharts.RenderChartHTML("../Content/Pie2D.swf", "", strXML3.ToString(), "asst", "100%", "350", false, true, true);
            }
            else
            {
                ltrAssets.Text = "No record found";
            }
        }
コード例 #10
0
 /// <summary>
 /// Creates chart based on search results.
 /// </summary>
 /// <returns></returns>
 private void CreateChart(object sender, ChartCreationEventArgs e)
 {
     try
     {
         e.ChartXml = FusionCharts.RenderChartHTML(ChartXmlDefinition, "", GetGraphXml(), "Report", Size.Width.ToString("#0"), Size.Heigth.ToString("#0"), false);
     }
     catch (Exception ex) { ShowError(ex); }
 }
コード例 #11
0
    private void CreateLineGraph()
    {
        string strCaption    = ddl_PlantName.SelectedItem.Text;
        string Def           = "     " + "From:" + txt_FromDate.Text + "   " + "To:" + txt_ToDate.Text;
        string strSubCaption = ddl_AgentNAme.SelectedItem.Text + "  " + "Datewise Milk report" + Def;

        string xAxis = "Date";
        string yAxis = "Milk_kg";

        //strXML will be used to store the entire XML document generated
        string strXML = null;

        //Generate the graph element
        strXML = @"                
            <graph caption='" + strCaption + @"'            
            subcaption='" + strSubCaption + @"'          
           
            hovercapbg='FFECAA' hovercapborder='F47E00' formatNumberScale='0' decimalPrecision='2' 
            showvalues='0' numdivlines='3' numVdivlines='0' yaxisminvalue='80.00' yaxismaxvalue='80.00'  
            rotateNames='1'
            showAlternateHGridColor='1' AlternateHGridColor='ff5904' divLineColor='ff5904' 
            divLineAlpha='20' alternateHGridAlpha='5' 
            xAxisName='" + xAxis + @"' yAxisName='" + yAxis + @"' 
            >        
            ";

        string tmp = null;

        tmp = @"<categories font='Arial' fontSize='11' fontColor='000000'>";
        foreach (DataRow DR in dt.Rows)
        {
            tmp += @"<category name='" + DR["year"].ToString().Trim() + @"' />";
        }
        tmp += @"</categories>";

        strXML += tmp;

        tmp = @"<dataset seriesName='Procurement' color='1D8BD1' anchorBorderColor='1D8BD1' anchorBgColor='1D8BD1'>";
        foreach (DataRow DR in dt.Rows)
        {
            tmp += @"<set value='" + DR["sales"].ToString().Trim() + @"'  link=&quot;JavaScript:myJS('" + DR["year"].ToString() + ", " + DR["sales"].ToString() + "'); &quot; />";
        }

        tmp += @"</dataset>";

        strXML += tmp;

        strXML += "</graph>";

        FCLiteral1.Text = FusionCharts.RenderChartHTML(
            "FusionCharts/FCF_MSLine.swf",   // Path to chart's SWF
            "",                              // Leave blank when using Data String method
            strXML,                          // xmlStr contains the chart data
            "mygraph4",                      // Unique chart ID
            GraphWidth, GraphHeight,         // Width & Height of chart
            false
            );
    }
コード例 #12
0
    /// <summary>
    /// update FusionCharts and gridview with as per selected factory name
    /// </summary>
    private void updateChart()
    {
        //Get factory details depending on FactoryID from selected Radio Button
        string strSQL = "select DatePro, Quantity from Factory_Output where FactoryId=" + RadioButtonList1.SelectedValue.ToString() + " order by DatePro";

        //Create data reader to bind data with GridView
        DbConn rs = new DbConn(strSQL);

        //Fillup gridview with data from datareader
        GridView1.DataSource = rs.ReadData;
        // binding the data
        GridView1.DataBind();

        //Create database connection to get data for chart
        DbConn oRs = new DbConn(strSQL);

        //Create FusionCharts XML
        StringBuilder strXML = new StringBuilder();

        //Create chart element
        strXML.AppendFormat("<chart caption='Factory {0}' showborder='0' bgcolor='FFFFFF' bgalpha='100' subcaption='Daily Production' xAxisName='Day' yAxisName='Units' rotateLabels='1'  placeValuesInside='1' rotateValues='1' >", RadioButtonList1.SelectedValue.ToString());

        //Iterate through database
        while (oRs.ReadData.Read())
        {
            //Create set element
            //Also set date into d/M format
            strXML.AppendFormat("<set label='{0}' value='{1}' />", Convert.ToDateTime(oRs.ReadData["DatePro"]).ToString("d/M"), oRs.ReadData["Quantity"].ToString());
        }

        //Close chart element
        strXML.Append("</chart>");


        //outPut will store the HTML of the chart rendered as string
        string outPut = "";

        if (IsPostBack)
        {
            //when an ajax call is made we use RenderChartHTML method
            outPut = FusionCharts.RenderChartHTML("../FusionCharts/Column2D.swf", "", strXML.ToString(), "chart1", "445", "350", false, false);
        }
        else
        {
            //When the page is loaded for the first time, we call RenderChart() method to avoid IE's 'Click here to Acrtivate...' message
            outPut = FusionCharts.RenderChart("../FusionCharts/Column2D.swf", "", strXML.ToString(), "chart1", "445", "350", false, false);
        }

        //Clear panel which will contain the chart
        Panel1.Controls.Clear();

        //Add Litaral control to Panel which adds the chart from outPut string
        Panel1.Controls.Add(new LiteralControl(outPut));

        // close Data Reader
        oRs.ReadData.Close();
    }
コード例 #13
0
 protected void ClickMes(object sender, EventArgs e)
 {
     try
     {
         var index = Convert.ToInt32((string)hidMes.Value);
         var fecha = DateTime.Parse("01/" + IndicesMeses[index]);
         divChartDias.InnerHtml = FusionCharts.RenderChartHTML(ChartXmlDefinition, "", GetGraphXmlDias(fecha), "Report", Size.Width.ToString(), Size.Heigth.ToString(), false);
     }
     catch (Exception ex) { ShowError(ex); }
 }
コード例 #14
0
    public string CreateChart2()
    {
        string strXml = "";

        strXml += "<graph  caption='Fuel Consumption by Vehicle Types' animation='1' isSliced='1' formatNumberScale='0' numberSufix='Lit' numberPrefix='' pieSliceDepth='30' decimalPrecision='0' shownames='1'>";
        strXml += "<set name='ALS' value='1000' color='AFD8F8' link=''/>";
        strXml += "<set name='BLS' value='660' color='F6BD0F' link='' isSliced='1' />";
        strXml += "<set name='RLS' value='980' color='D64646' link=''/>";
        strXml += "</graph>";
        return(FusionCharts.RenderChartHTML("FusionCharts/FCF_Pie3D.swf ", "", strXml, "myNext", "560", "400", false));
    }
コード例 #15
0
        public string GetMonthlySalesChartHtml()
        {
            //This page demonstrates the ease of generating charts using FusionCharts.
            //For this chart, we've used a pre-defined Data.xml (contained in /Data/ folder)
            //Ideally, you would NOT use a physical data file. Instead you'll have
            //your own ASP.NET scripts virtually relay the XML data document. Such examples are also present.
            //For a head-start, we've kept this example very simple.


            //'Create the chart - Column 3D Chart with data from Data/Data.xml
            return(FusionCharts.RenderChartHTML("../../FusionCharts/Column3D.swf", "Data/Data.xml", "", "myFirst", "600", "300", false));
        }
コード例 #16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //This page demonstrates the ease of generating charts using FusionCharts.
        //For this chart, we've used a pre-defined Data.xml (contained in /Data/ folder)
        //Ideally, you would NOT use a physical data file. Instead you'll have
        //your own ASP.NET scripts virtually relay the XML data document. Such examples are also present.
        //For a head-start, we've kept this example very simple.


        //'Create the chart - Column 3D Chart with data from Data/Data.xml
        Literal1.Text = FusionCharts.RenderChartHTML("../FusionCharts/Column3D.swf", "Data/Data.xml", "", "myFirst", "600", "300", false);
    }
コード例 #17
0
ファイル: FunsionChart.aspx.cs プロジェクト: siqianyu/cttx
    public void BindChart()
    {
        string xml = "";

        string[] _xArray = null;
        string[] _yArray = null;
        if (!string.IsNullOrEmpty(x) && !string.IsNullOrEmpty(y))
        {
            _xArray = x.Trim().Split(',');
            _yArray = y.Trim().Split(',');



            int _xlength = _xArray.Length;
            int _ylength = _yArray.Length;

            decimal _xmaxvalue = GetMaxValue(_xArray);
            decimal _ymaxvalue = GetMaxValue(_yArray);

            int _xvalue = Convert.ToInt32((_xmaxvalue + Convert.ToDecimal(_xmaxvalue * Convert.ToDecimal(0.3))).ToString("F0"));
            int _yvalue = Convert.ToInt32((_ymaxvalue + Convert.ToDecimal(_ymaxvalue * Convert.ToDecimal(0.4))).ToString("F0"));
            //palette--调色板,caption--标题,yaxisname--Y轴说明,xaxisname--X轴说明,xaxismaxvalue--X轴最大值,xaxisminvalue--X轴最小值,bgcolor--背景颜色,legendshadow--阴影(估计),legendborderalpha--边线(估计),canvasborderthickness--边框厚度,canvasborderalpha--边框,divlinealpha--div线,showregressionline--显示回归线,yaxisminvalue--Y轴最小值,numbersuffix--数字后缀,animation--动画方案

            xml = @"<?xml version='1.0' encoding='utf-8'?><chart palette='2' yaxisname='' caption='' xaxisname='' xaxismaxvalue='" + _xvalue.ToString() + "' xaxisminvalue='0' bgcolor='FFFFFF' legendshadow='1' legendborderalpha='1' canvasborderthickness='1' canvasborderalpha='1' divlinealpha='2' showregressionline='1' yaxisminvalue='0' yaxismaxvalue='" + _yvalue.ToString() + "' numbersuffix='' animation='0'>";

            //X轴位数
            xml += @"<categories verticallinethickness='1' verticallinealpha='10'>";
            string s = "";
            for (int i = 1; i < 11; i++)
            {
                s += "<category label='" + (_xvalue * Convert.ToDecimal(0.1 * i)) + "' x='" + (_xvalue * Convert.ToDecimal(0.1 * i)) + "' showverticalline='1' />";
            }



            xml += s + "</categories>";
            //X,Y数据位置id为ID,X为X轴坐标,Y为Y轴坐标,toolText为鼠标滑过显示的文本
            xml += @"<dataset seriesname=''  color='#1790E1' showplotborder='1' anchorSides='4' anchorRadius='4' anchorBgColor='#F8BD19' anchorBorderColor='#F8BD19'>";
            for (int i = 0; i < _xlength; i++)
            {
                xml += "<set y='" + _yArray[i] + "' x='" + _xArray[i] + "' />";
            }

            xml += "</dataset>";

            xml += @"</chart>";

            XmlDocument xdoc = new XmlDocument();
            xdoc.LoadXml(xml);
            xdoc.Save(Server.MapPath("/FusionChartsFlash/FusionCharts.XML"));
            this.divimg1.InnerHtml = FusionCharts.RenderChartHTML("/FusionChartsFlash/Scatter.swf", "/FusionChartsFlash/FusionCharts.XML", "", "MyChart1", "600", "300", false);
        }
    }
コード例 #18
0
    private void CreateRemarksCountSummaryGraph()
    {
        string strCaption    = ddl_reportname.SelectedItem.Text + "Report";
        string strSubCaption = "For the Period From" + txt_frmdate.Text + " To  " + txt_todate.Text;
        string xAxis         = "Route Name";
        string yAxis         = "Sum Remarkscount";

        //strXML will be used to store the entire XML document generated
        string strXML = null;

        //Generate the graph element
        strXML = @"<graph caption='" + strCaption + @"' subCaption='" + strSubCaption + @"' decimalPrecision='0' 
                          pieSliceDepth='10' formatNumberScale='0'
                          xAxisName='" + xAxis + @"' yAxisName='" + yAxis + @"' rotateNames='1'
                    >";

        int i = 0;

        foreach (DataRow dr2 in dt.Rows)
        {
            strXML += "<set name='" + dr2[0].ToString() + "' value='" + dr2[1].ToString() + "' color='" + color[i] + @"'  link=&quot;JavaScript:myJS('" + "\tRid:" + dr2[0].ToString() + " + , +" + "\tRemarkscounts: " + dr2[1].ToString() + "'); &quot;/>";
            i++;
        }

        //Finally, close <graph> element
        strXML += "</graph>";

        if (ddl_charttype.SelectedItem.Value == "1")
        {
            FCLiteral1.Text = FusionCharts.RenderChartHTML(
                "FusionCharts/FCF_Column3D.swf", // Path to chart's SWF
                "",                              // Leave blank when using Data String method
                strXML,                          // xmlStr contains the chart data
                "mygraph1",                      // Unique chart ID
                GraphWidth, GraphHeight,         // Width & Height of chart
                false
                );
        }
        else
        {
            FCLiteral1.Text = FusionCharts.RenderChartHTML(
                "FusionCharts/FCF_Pie3D.swf", // Path to chart's SWF
                "",                           // Leave blank when using Data String method
                strXML,                       // xmlStr contains the chart data
                "mygraph1",                   // Unique chart ID
                GraphWidth, GraphHeight,      // Width & Height of chart
                false
                );
        }
    }
コード例 #19
0
        public string CreateChart1()
        {
            string strXML = "";


            strXML += "<graph caption='Region-Wise Fuel Consumption' YAxisName='Fuel Consumption' numDivLines='6' formatNumberScale='0' decimalPrecision='0' anchorSides='10' anchorRadius='3' anchorBorderColor='009900' rotateNames='1' animation='1' yAxisMinValue='0'>";
            strXML += "<categories>";

            strXML += "<category name='Hyderabad' /> ";
            strXML += "<category name='Nizamabad' /> ";
            strXML += "<category name='Tirupati' /> ";
            strXML += "<category name='Vizag' /> ";
            strXML += "<category name='Vijayawada' /> ";
            strXML += "<category name='Warangal' /> ";

            strXML += "</categories>";


            strXML += "<dataset seriesName='Kilo Meters Traveled' color='8BBA00' showValues='1'>";
            strXML += " <set value='123' color='' link=''/>";
            strXML += " <set value='148' color='' link=''/>";
            strXML += " <set value='223' color='' link=''/>";
            strXML += " <set value='100' color='' link=''/>";
            strXML += " <set value='125' color='' link=''/>";
            strXML += " <set value='178' color='' link=''/>";
            strXML += " </dataset>";

            strXML += "<dataset seriesName='Qty in Lit' color='F6BD0F' showValues='1'>";
            strXML += " <set value='60' color='' link=''/>";
            strXML += " <set value='48' color='' link=''/>";
            strXML += " <set value='72' color='' link=''/>";
            strXML += " <set value='39' color='' link=''/>";
            strXML += " <set value='88' color='' link=''/>";
            strXML += " <set value='78' color='' link=''/>";
            strXML += " </dataset>";

            strXML += "<dataset seriesName='Total Amount' color='AFD8F8' showValues='1'>";
            strXML += " <set value='1980' color='' link=''/>";
            strXML += " <set value='1248' color='' link=''/>";
            strXML += " <set value='972' color='' link=''/>";
            strXML += " <set value='1239' color='' link=''/>";
            strXML += " <set value='1188' color='' link=''/>";
            strXML += " <set value='1578' color='' link=''/>";
            strXML += " </dataset>";

            strXML += "</graph>";

            return(FusionCharts.RenderChartHTML("FusionCharts/FCF_MSColumn3D.swf", "", strXML, "myNext", "560", "400", false));
        }
コード例 #20
0
        /// <summary>
        /// Creates the charts as needed for its printed version.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CreateChartPrint(object sender, ChartCreationEventArgs e)
        {
            try
            {
                if (ReportObjectsList.Count <= 0)
                {
                    return;
                }

                var graphXml = GetGraphXml();

                graphXml = graphXml.Replace("<graph", "<graph animation='0'");

                e.ChartXml = FusionCharts.RenderChartHTML(ChartXmlDefinition, "", graphXml, "ReportPrint", "800", "350", false);
            }
            catch (Exception ex) { ShowError(ex); }
        }
コード例 #21
0
        public static string GenerarGraficoBarraDoble3D(List <Indicadores> Datos, string Titulo, string EjeX, string EjeY, string Categoria1, string Categoria2, int Ancho = 600, int Alto = 300)
        {
            try
            {
                StringBuilder xmlData = new StringBuilder();
                //xmlData.Append("<chart caption='" + Titulo + "' xAxisName='" + EjeX + "' yAxisName='" + EjeY + "' showValues='1' formatNumberScale='0' showBorder='1' decimals ='3' showLegend='1'>");
                xmlData.Append("<chart palette='3' caption='" + Titulo + "' yaxisname='" + EjeY + "' showvalues='1' numvdivlines='10' divlinealpha='30' drawanchors='0' labelpadding='10' yaxisvaluespadding='10' useroundedges='1' legendborderalpha='0' showborder='0'>");
                //SE CARGAN LAS CATEGORIAS
                xmlData.Append("<categories>");

                foreach (var Dato in Datos)
                {
                    xmlData.Append("<category label='" + Dato.NombreIndicador + "' />");
                }
                xmlData.Append("</categories>");
                //SE LLENA LA CATEGORIA1
                xmlData.Append("<dataset seriesname='" + Categoria1 + "'>");
                foreach (var Dato in Datos)
                {
                    xmlData.Append("<set value='" + Dato.ValorIndicador1.ToString().Replace(",", ".") + "' />");
                }
                xmlData.Append("</dataset>");


                //SE LLENA LA CATEGORIA2
                xmlData.Append("<dataset seriesname='" + Categoria2 + "'>");
                foreach (var Dato in Datos)
                {
                    xmlData.Append("<set value='" + Dato.ValorIndicador2.ToString().Replace(",", ".") + "' />");
                }
                xmlData.Append("</dataset>");
                //_________________________________________________-
                xmlData.Append("</chart>");
                var Resultado = FusionCharts.RenderChartHTML(RutaGraficos + "MSColumn3D.swf", "", xmlData.ToString(), "myNext", Ancho.ToString(), Alto.ToString(), false, false);

                return(Resultado);
            }
            catch (Exception ex)
            {
                return("ERROR#" + ex.Message);

                throw;
            }
        }
コード例 #22
0
        protected void BindndReturn()
        {
            StringBuilder strXML = new StringBuilder();

            strXML.Append(@"<chart caption='Scheme Return' >
              <categories>
              <category label='Return 1st yr'/>
              <category label='Return 3rd yr' />
              <category label='Return 5th yr' />
              </categories>"
                          );
            strXML.Append(@"<dataset seriesname='BenchMark-" + onlineMFSchemeDetailsVo.schemeBanchMark.Replace("&", "and") + "'>");
            if (!string.IsNullOrEmpty(onlineMFSchemeDetailsVo.benchmarkReturn1stYear))
            {
                strXML.AppendFormat(@"<set value ='{0}' />", onlineMFSchemeDetailsVo.benchmarkReturn1stYear);
            }
            if (!string.IsNullOrEmpty(onlineMFSchemeDetailsVo.benchmark3rhYear))
            {
                strXML.AppendFormat(@"<set value ='{0}'  />", onlineMFSchemeDetailsVo.benchmark3rhYear);
            }
            if (!string.IsNullOrEmpty(onlineMFSchemeDetailsVo.benchmark5thdYear))
            {
                strXML.AppendFormat(@"<set value ='{0}'  />", onlineMFSchemeDetailsVo.benchmark5thdYear);
            }
            strXML.Append(@"</dataset>");
            strXML.Append(@"<dataset seriesname='Return'>");
            if (!string.IsNullOrEmpty(onlineMFSchemeDetailsVo.SchemeReturn3Year))
            {
                strXML.AppendFormat(@"<set value ='{0}' />", onlineMFSchemeDetailsVo.SchemeReturn3Year.ToString());
            }
            if (!string.IsNullOrEmpty(onlineMFSchemeDetailsVo.SchemeReturn5Year))
            {
                strXML.AppendFormat(@"<set value ='{0}'  />", onlineMFSchemeDetailsVo.SchemeReturn5Year.ToString());
            }
            if (!string.IsNullOrEmpty(onlineMFSchemeDetailsVo.SchemeReturn10Year))
            {
                strXML.AppendFormat(@"<set value ='{0}' />", onlineMFSchemeDetailsVo.SchemeReturn10Year.ToString());
            }
            strXML.Append(@"</dataset>");

            strXML.Append(@"</chart>");

            ltrReturn.Text = FusionCharts.RenderChartHTML("../FusionCharts/MSColumn3D.swf", "", strXML.ToString(), "FactorySum", "100%", "400", false, true, false);
        }
コード例 #23
0
ファイル: Inventory.aspx.cs プロジェクト: gvkemrifms/NTPC
    public string CreateChart1()
    {
        var ds     = _fmsgrph.GetInventoryGraph();
        var strXml = "";

        strXml += "<graph caption='Approved and Rejected Requisitions' YAxisName='No. of Requisitions' numDivLines='6' formatNumberScale='0' decimalPrecision='0' anchorSides='10' anchorRadius='3' anchorBorderColor='009900' rotateNames='1' animation='1' yAxisMinValue='0'>";
        strXml += "<categories>";
        strXml += "<category name='Tyre Requisition' /> ";
        strXml += "<category name='Battery Requisition' /> ";
        strXml += "<category name='Spare Parts Requisition' /> ";
        strXml += "</categories>";
        strXml += "<dataset seriesName='Total Requests' color='0000FF' showValues='1'>";
        foreach (DataRow dr in ds.Tables[0].Rows)
        {
            strXml += " <set value='" + dr[6] + "' color='' link=''/>";
            strXml += " <set value='" + dr[7] + "' color='' link=''/>";
            strXml += " <set value='" + dr[8] + "' color='' link=''/>";
        }

        strXml += " </dataset>";
        strXml += "<dataset seriesName='Approved' color='8BBA00' showValues='1'>";
        foreach (DataRow dr in ds.Tables[0].Rows)
        {
            strXml += " <set value='" + dr[0] + "' color='' link=''/>";
            strXml += " <set value='" + dr[2] + "' color='' link=''/>";
            strXml += " <set value='" + dr[4] + "' color='' link=''/>";
        }

        strXml += " </dataset>";
        strXml += "<dataset seriesName='Rejected' color='F6BD0F' showValues='1'>";
        foreach (DataRow dr in ds.Tables[0].Rows)
        {
            strXml += " <set value='" + dr[1] + "' color='' link=''/>";
            strXml += " <set value='" + dr[3] + "' color='' link=''/>";
            strXml += " <set value='" + dr[5] + "' color='' link=''/>";
        }

        strXml += " </dataset>";
        strXml += "</graph>";
        var myChart = FusionCharts.RenderChartHTML("FusionCharts/FCF_MSColumn3D.swf", "", strXml, "myNext", "700", "500", false);

        return(myChart);
    }
コード例 #24
0
        public string CreateCharts(List <VersionFieldsReport> Items)
        {
            //Create an XML data document in a string variable
            string strXML = string.Empty;

            strXML += "<graph  caption='Version Trafic Report' animation='1'  formatNumberScale='0'   pieSliceDepth='30'  decimalPrecision='0' shownames='1' >";
            Random rnd = new Random();

            foreach (VersionFieldsReport Item in Items)
            {
                Color RandomColor = Color.FromArgb(rnd.Next(0, 255), rnd.Next(0, 255), rnd.Next(0, 255));
                strXML += "<set name='" + Item.ShortName + "' value='" + Item.TotalOrders + "' color='" + RandomColor.Name + "' />";
            }

            strXML += "</graph>";

            //Create the chart - Column 3D Chart with data from strXML variable using dataXML method
            return(FusionCharts.RenderChartHTML("../../FusionCharts/FCF_pie3D.swf", "", strXML, "versionChart", "600", "300", false));
        }
コード例 #25
0
        public void LoadNAVHistoryChat(DataTable dtNavDetails)
        {
            divChart.Visible = true;
            StringBuilder strXML = new StringBuilder();

            strXML.Append(@"<chart  chartTopMargin='0' xAxisName='Date' toolText='NAV' flatscrollbars='1' scrollshowbuttons='0' scrollshowbuttons='0' useCrossLine='1' yAxisName='NAV' anchorBgColor='FFFFFF' bgColor='FFFFFF' showBorder='0'  canvasBgColor='FFFFFF' lineColor='2480C7' >");
            strXML.Append(@" <categories>");
            foreach (DataRow dr in dtNavDetails.Rows)
            {
                strXML.AppendFormat("<category label ='{0}'/>", dr["PSP_Date"]);
            }
            strXML.AppendFormat(@" </categories> <dataset seriesName='{0}'>", ViewState["schemeName"]);
            foreach (DataRow dr in dtNavDetails.Rows)
            {
                strXML.AppendFormat("<set value ='{0}'  />", dr["PSP_NetAssetValue"].ToString());
            }
            strXML.Append("</dataset>");

            strXML.Append(@"<vTrendlines>  <line startValue='895' color='FF0000' toolText='NAV' displayValue='Average' showOnTop='1' /></vTrendlines> </chart>");
            Literal1.Text = FusionCharts.RenderChartHTML("../FusionCharts/ZoomLine.swf", "", strXML.ToString(), "FactorySum", "100%", "400", false, true, false);
        }
コード例 #26
0
    protected void Page_Load(object sender, EventArgs e)
    {
        StringBuilder xmlData = new StringBuilder();

        xmlData.Append("<chart caption='Monthly Unit Sales' xAxisName='Month' yAxisName='Units' showValues='0' formatNumberScale='0' showBorder='1'>");
        xmlData.Append("<set label='Jan' value='462' />");
        xmlData.Append("<set label='Feb' value='857' />");
        xmlData.Append("<set label='Mar' value='671' />");
        xmlData.Append("<set label='Apr' value='494' />");
        xmlData.Append("<set label='May' value='761' />");
        xmlData.Append("<set label='Jun' value='960' />");
        xmlData.Append("<set label='Jul' value='629' />");
        xmlData.Append("<set label='Aug' value='622' />");
        xmlData.Append("<set label='Sep' value='376' />");
        xmlData.Append("<set label='Oct' value='494' />");
        xmlData.Append("<set label='Nov' value='761' />");
        xmlData.Append("<set label='Dec' value='960' />");
        xmlData.Append("</chart>");

        //Create the chart - Column 3D Chart with data from xmlData variable using dataXML method
        Literal1.Text = FusionCharts.RenderChartHTML("../FusionCharts/Column3D.swf", "", xmlData.ToString(), "myNext", "600", "300", false);
    }
コード例 #27
0
        public void xuanze(string value, string s1, string s2, string s3, string s4)
        {
            try
            {
                StringBuilder xmlData = new StringBuilder();
                xmlData.Append("<chart showNames='" + GetLangStr("DeviceStatistics9", "设备信息运维统计") + "' decimalPrecision='0' baseFont='Arial' baseFontSize='12'>");
                xmlData.AppendFormat("<set label='" + GetLangStr("DeviceStatistics12", "领用") + "' value='{0}' />", s1);
                xmlData.AppendFormat("<set label='" + GetLangStr("DeviceStatistics13", "维修") + "' value='{0}' />", s2);
                xmlData.AppendFormat("<set label='" + GetLangStr("DeviceStatistics14", "入库") + "' value='{0}' />", s3);
                xmlData.AppendFormat("<set label='" + GetLangStr("DeviceStatistics15", "归还") + "' value='{0}' />", s4);

                xmlData.Append("</chart>");
                if (value == "01")
                {
                    panel.Html = FusionCharts.RenderChartHTML("../FusionCharts/Pie2D.swf", "", xmlData.ToString(), "chartid", "500", "400", false, false);
                }
                if (value == "02")
                {
                    panel.Html = FusionCharts.RenderChartHTML("../FusionCharts/Line.swf", "", xmlData.ToString(), "Sales", "500", "400", false, false);
                }
                if (value == "03")
                {
                    panel.Html = FusionCharts.RenderChartHTML("../FusionCharts/Column3D.swf", "", xmlData.ToString(), "chartid", "500", "400", false, false);
                }
                if (value == "04")
                {
                    // xmlData.Append("<chart showNames='设备信息运维统计' decimalPrecision='0' baseFont='Arial' baseFontSize='12'>");
                    // xmlData.Append("<chart caption='Weather Report' subcaption='Temperature' xaxisname='Places' yaxisname='Degree  Fahrenheit' clustered='0'  zeroplanemesh='0'  zeroplanecolor='68BDFFzeroplanealpha='50 palette='3' bgcolor='66D6FF,FFFFFF,ffffff'bgratio='20,60,20'bgalpha='10,10,40' divlineeffect='none'numdivlines='3'legendbgalpha='90' legendshadow='0'intensity='02'startangx='4.5'startangy='-6.6'endangx='4.5'endangy='-6.6'exetime='2'numbersuffix='°'>");

                    panel.Html = FusionCharts.RenderChartHTML("../FusionCharts/Pie3D.swf", "", xmlData.ToString(), "Sales", "500", "400", false, false);
                }
            }
            catch (Exception ex)
            {
                ILog.WriteErrorLog(ex);
                logManager.InsertLogError("DeviceStatistics.aspx-xuanze", ex.Message + ";" + ex.StackTrace, "xuanze has an exception");
            }
        }
コード例 #28
0
        public void tubiao(string s1, string s2, string s3, string s4)
        {
            try
            {
                this.comyangshi.Value = "01";
                StringBuilder xmlData = new StringBuilder();

                xmlData.Append("<chart showNames='" + GetLangStr("DeviceStatistics9", "设备信息运维统计") + "' decimalPrecision='0' baseFont='Arial' baseFontSize='12'>");

                xmlData.AppendFormat("<set label='" + GetLangStr("DeviceStatistics12", "领用") + "' value='{0}' />", s1);
                xmlData.AppendFormat("<set label='" + GetLangStr("DeviceStatistics13", "维修") + "' value='{0}' />", s2);
                xmlData.AppendFormat("<set label='" + GetLangStr("DeviceStatistics14", "入库") + "' value='{0}' />", s3);
                xmlData.AppendFormat("<set label='" + GetLangStr("DeviceStatistics15", "归还") + "' value='{0}' />", s4);

                xmlData.Append("</chart>");

                panel.Html = FusionCharts.RenderChartHTML("../FusionCharts/Pie2D.swf", "", xmlData.ToString(), "chartid", "500", "400", false, false);
            }
            catch (Exception ex)
            {
                ILog.WriteErrorLog(ex);
                logManager.InsertLogError("DeviceStatistics.aspx-tubiao", ex.Message + ";" + ex.StackTrace, "tubiao has an exception");
            }
        }
コード例 #29
0
        public string CreateChart2()
        {
            string strXML = "";

            strXML += "<graph  caption='Fuel Consumption by Vehicle Types' animation='1' isSliced='1' formatNumberScale='0' numberSufix='Lit' numberPrefix='' pieSliceDepth='30' decimalPrecision='0' shownames='1'>";


            strXML += "<set name='ALS' value='1000' color='AFD8F8' link=''/>";
            strXML += "<set name='BLS' value='660' color='F6BD0F' link='' isSliced='1' />";
            strXML += "<set name='RLS' value='980' color='D64646' link=''/>";



            strXML += "</graph>";



            //Create the chart - Column 3D Chart with data from strXML variable using dataXML method



            return(FusionCharts.RenderChartHTML("FusionCharts/FCF_Pie3D.swf ", "", strXML, "myNext", "560", "400", false));
            //return FusionCharts.RenderChartHTML("../FusionCharts/FCF_Funnel.swf ", "", strXML, "myNext", "560", "400", false);
        }
コード例 #30
0
    public string CreateChart1()
    {
        _fmsgrph.UserDistrictId = Convert.ToInt32(Session["UserdistrictId"].ToString());
        var ds     = _fmsgrph.GetStatutoryComplianceGraph();
        var strXml = "";

        strXml += "<graph caption='Valid Expired Vehicles' YAxisName='No. of Vehicles' numDivLines='6' formatNumberScale='0' decimalPrecision='0' anchorSides='10' anchorRadius='3' anchorBorderColor='009900' rotateNames='1' animation='1' yAxisMinValue='0'>";
        strXml += "<categories>";
        strXml += "<category name='Vehicle Insurance' /> ";
        strXml += "<category name='Road Tax' /> ";
        strXml += "<category name='Pollution Under Control' /> ";
        strXml += "<category name='Fitness Renewal' /> ";
        strXml += "</categories>";
        strXml += "<dataset seriesName='No. of Valid Vehicles' color='8BBA00' showValues='1'>";
        foreach (DataRow dr in ds.Tables[0].Rows)
        {
            strXml += " <set value='" + dr[0] + "' color='' link=''/>";
            strXml += " <set value='" + dr[2] + "' color='' link=''/>";
            strXml += " <set value='" + dr[4] + "' color='' link=''/>";
            strXml += " <set value='" + dr[6] + "' color='' link=''/>";
        }

        strXml += " </dataset>";
        strXml += "<dataset seriesName='No. of Expired Vehicles' color='F6BD0F' showValues='1'>";
        foreach (DataRow dr in ds.Tables[0].Rows)
        {
            strXml += " <set value='" + dr[1] + "' color='' link=''/>";
            strXml += " <set value='" + dr[3] + "' color='' link=''/>";
            strXml += " <set value='" + dr[5] + "' color='' link=''/>";
            strXml += " <set value='" + dr[7] + "' color='' link=''/>";
        }

        strXml += " </dataset>";
        strXml += "</graph>";
        return(FusionCharts.RenderChartHTML("FusionCharts/FCF_MSColumn3D.swf", "", strXml, "myNext", "700", "500", false));
    }