protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Chart sales = new Chart(); sales.SetChartParameter(Chart.ChartParameter.chartId, "myChart"); string param = sales.GetChartParameter(Chart.ChartParameter.chartId); // Setting chart type to Column 3D chart sales.SetChartParameter(Chart.ChartParameter.chartType, "column3d"); // Setting chart width to 500px sales.SetChartParameter(Chart.ChartParameter.chartWidth, "600"); // Setting chart height to 400px sales.SetChartParameter(Chart.ChartParameter.chartHeight, "350"); // Setting chart data as XML URL sales.SetData("Data/Data.aspx", Chart.DataFormat.xmlurl); Label1.Text = sales.Render(); } }
/// <summary> /// Public method to clone an exiting FusionCharts instance /// To make the chartId unique, this function will add "_clone" as suffix in the clone chart's Id. /// </summary> public object Clone() { Chart ChartClone = new Chart(); ChartClone.__CONFIG__ = (Hashtable)this.__CONFIG__.Clone(); ChartClone.SetChartParameter("id", ((Hashtable)ChartClone.__CONFIG__["params"])["id"].ToString() + "_clone"); return ChartClone; }