static void Main(string[] args) { //获取配置文件中的chartType的值 string type = System.Configuration.ConfigurationManager.AppSettings["chartType"]; IChart chart = ChartFactory.GetChart(type); chart.Display(); }
static void Main(string[] args) { Console.WriteLine("Hello World!"); IChart chart = ChartFactory.GetChart("pie"); chart.Display(); Console.ReadKey(); }
/// <summary> /// 查看报表 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnSelect_Click(object sender, EventArgs e) { IChart chart = ChartFactory.GetChart(comboBox1.SelectedIndex.ToString()); MessageBox.Show(chart.Display()); }