namespace InfoSoftGlobal.BluePrintApp.FC_ASP.UserControls
{
using System;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
///
/// Summary description for main.
///
public class main : System.Web.UI.UserControl
{
protected System.Web.UI.WebControls.Literal Literal1;
protected System.Web.UI.WebControls.Literal Literal2;
protected System.Web.UI.WebControls.Literal Literal3;
protected System.Web.UI.WebControls.Literal Literal4;
private void Page_Load(object sender, System.EventArgs e)
{
}
public string GetYearlySalesChartHtml()
{
string xmlDataYear = "";
xmlDataYear += DataGeneration.GetSalesByYear();
//Add some styles to increase caption font size
xmlDataYear += "";
xmlDataYear += "";
return FusionCharts.RenderChart("FusionCharts/MSColumn3DLineDY.swf", "",xmlDataYear,"SalesByYear", "450", "325", false, true);
}
public string GetEmployeeChartHtml()
{
string xmlDataEmployee;
xmlDataEmployee = "";
xmlDataEmployee += DataGeneration.GetSalePerEmpXML(getSelectedYear(),"5",false,false,false);
//Add some styles to increase caption font size
xmlDataEmployee += "";
xmlDataEmployee += "";
return FusionCharts.RenderChart("FusionCharts/Pie3D.swf", "",xmlDataEmployee, "TopEmployees", "400", "225", false, true);
}
public string GetCategoryChartHtml()
{
//For the "Sales by category" chart, we request data from Data_SalesByCategory.asp.
//So, create the dataURL for it and pass the year to it. We create the dataURL in noCache format.
string strCatChartDataURL;
strCatChartDataURL = FusionCharts.EncodeDataURL("Data_SalesByCategory.aspx?year=" + getSelectedYear().ToString(),true);
return FusionCharts.RenderChart("FusionCharts/MSColumn3D.swf", strCatChartDataURL,"","SalesByCat", "875", "350", false, true);
}
public string GetProductChartHtml()
{
//MSColumn3DLineDY.swf Chart with changed "No data to display" message
//We initialize the chart with
return FusionCharts.RenderChart("FusionCharts/MSColumn3DLineDY.swf?ChartNoDataText=Please select a product category in the above chart to see product-wise sales.", "","","SalesByProd", "875", "350", false, true);
}
private string getSelectedYear()
{
string selectedYear = Request.Form["Year"];
if (selectedYear != null)
return selectedYear;
else
return "1996";
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}