예제 #1
0
        public ActionResult Index()
        {
            ViewData["Message"] = "Welcome to ASP.NET MVC!";

            // 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 JSON / XML data document.
            // For a head-start, we've kept this example very simple.

            // Initialize chart - Column 3D Chart with data from Data/Data.json
            Chart sales = new Chart("column3d", "myChart", "600", "350", "xmlurl", "../../Data/Data.xml");

            // Render the chart
            ViewData["Message"] = sales.Render();
            return View();
        }
예제 #2
0
        /// <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;
        }