protected void GVBarChart1_Click(object sender, EventArgs e) { Random num = new Random(Environment.TickCount); System.Data.DataTable barchart = new System.Data.DataTable("Company Performance"); barchart.Columns.Add("Year", typeof(string)); barchart.Columns.Add("Sales", typeof(int)); barchart.Columns.Add("Expenses", typeof(int)); barchart.Rows.Add(new object[] { "2004", num.Next(100, 1000), num.Next(100, 400) }); barchart.Rows.Add(new object[] { "2005", num.Next(100, 1170), num.Next(100, 460) }); barchart.Rows.Add(new object[] { "2006", num.Next(100, 660), num.Next(100, 1120) }); barchart.Rows.Add(new object[] { "2007", num.Next(100, 1030), num.Next(100, 540) }); //this.GVBarChart1.GviVAxis = "{title: 'Year', titleTextStyle: {color: 'red'} }"; GoogleChartsNGraphsControls.hAxis hx = new GoogleChartsNGraphsControls.hAxis(); hx.SlantedText = true; hx.Title = "Hoz Axis Title"; this.GVAreaChart2.GviHAxisClass = hx; GoogleChartsNGraphsControls.Animation an = new GoogleChartsNGraphsControls.Animation(); an.Easing = GoogleChartsNGraphsControls.AnimationEasing.Out; an.Duration = 1000; this.GVAreaChart2.GviAnimationClass = an; hx = new GoogleChartsNGraphsControls.hAxis(); hx.Title = "In Thousands"; hx.Formatted = GoogleChartsNGraphsControls.AxisFormat.Currency; hx.SlantedText = true; this.GVBarChart1.GviHAxisClass = hx; this.GVBarChart1.GviColors = new System.Drawing.Color?[] { Color.MediumAquamarine, Color.LightCyan }; this.GVBarChart1.DataSource = barchart; }
private void scatterChart() { System.Data.DataTable scatter = new System.Data.DataTable("Scatter Example"); scatter.Columns.AddRange( new System.Data.DataColumn[] { new System.Data.DataColumn("Age", typeof(int)), new System.Data.DataColumn("Male-Weight", typeof(int)), new System.Data.DataColumn("Female-Weight", typeof(int)) }); scatter.Rows.Add(new object[] { 8, 72, null }); scatter.Rows.Add(new object[] { 4, 46, null }); scatter.Rows.Add(new object[] { 6, 55, null }); scatter.Rows.Add(new object[] { 9, 78, null }); scatter.Rows.Add(new object[] { 12, 92, null }); scatter.Rows.Add(new object[] { 5, 50, null }); scatter.Rows.Add(new object[] { 8, null, 72 }); scatter.Rows.Add(new object[] { 4, null, 48 }); scatter.Rows.Add(new object[] { 6, null, 56 }); scatter.Rows.Add(new object[] { 9, null, 76 }); scatter.Rows.Add(new object[] { 12, null, 98 }); scatter.Rows.Add(new object[] { 5, null, 53 }); this.GVScatterChart1.GviTitle = "Age vs Weight Comparison"; GoogleChartsNGraphsControls.TrendLine trend = new GoogleChartsNGraphsControls.TrendLine() { Color = Color.MediumPurple, Opacity = 0.4f, LineWidth = 10, VisibleInLegend = true, LabelInLegend = "Trend Line", Type = GoogleChartsNGraphsControls.TrendLineType.Exponential }; this.GVScatterChart1.GviTrendLine = new GoogleChartsNGraphsControls.TrendLine[] { trend }; //this.GVScatterChart1.GviHAxis = "{title: 'Age', minValue: 0, maxValue: 15}"; GoogleChartsNGraphsControls.hAxis hx = new GoogleChartsNGraphsControls.hAxis(); hx.Title = "Child Age"; hx.ShowTextEvery = 1; hx.SlantedText = true; //this.GVScatterChart1.GviVAxis = "{title: 'Weight', minValue: 0, maxValue: 100}"; this.GVScatterChart1.GviHAxisClass = hx; GoogleChartsNGraphsControls.Animation an = new GoogleChartsNGraphsControls.Animation(GoogleChartsNGraphsControls.AnimationEasing.InAndOut, 1000); this.GVScatterChart1.GviAnimationClass = an; this.GVScatterChart1.DataSource = scatter; }
protected void Page_Init() { chart_timeline(); chart_histogram(); chart_calendar(); chart_annotation(); chart_Roles(); // Map Test this.GVMap2.ChartData("Duvall, WA", "Home Sweet Home"); this.GVMap2.ChartData("Bothell, WA", "Work"); // AnnotatedTimeline Test List<GoogleChartsNGraphsControls.TimelineEvent> evts = new List<GoogleChartsNGraphsControls.TimelineEvent>(); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Pencils", new DateTime(2008,1,1), 30000)); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Pencils", new DateTime(2008, 1, 2), 14045)); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Pencils", new DateTime(2008, 1, 3), 55022)); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Pencils", new DateTime(2008, 1, 4), 75284)); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Pencils", new DateTime(2008, 1, 5), 41476)); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Pencils", new DateTime(2008, 1, 6), 33322)); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Pens", new DateTime(2008, 1, 1), 40645)); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Pens", new DateTime(2008, 1, 2), 20374)); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Pens", new DateTime(2008, 1, 3), 50766)); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Pens", new DateTime(2008, 1, 4), 14334, "Out of Stock", "Ran out of stock on pens at 4pm")); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Pens", new DateTime(2008, 1, 5), 66467, "Bought Pens", "Bought 200k pens")); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Pens", new DateTime(2008, 1, 6), 39463)); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Erasers", new DateTime(2008, 1, 1), 0, "No Erasers", "What was i thinking?")); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Erasers", new DateTime(2008, 1, 2), 1254, "Bought Erasers", "Bought 200k erasers for all the mistakes")); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Erasers", new DateTime(2008, 1, 3), 4596)); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Erasers", new DateTime(2008, 1, 4), 14334)); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Erasers", new DateTime(2008, 1, 5), 26004)); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Erasers", new DateTime(2008, 1, 6), 39001)); this.GVAnnotatedTimeline1.GviDisplayAnnotations = GoogleChartsNGraphsControls.TrippleStateBool.True; this.GVAnnotatedTimeline1.ChartData(evts.ToArray()); this.GVAnnotatedTimeline2.ChartData(evts.Where(d => d.EventCategory == "Sold Erasers").ToArray()); System.Data.DataTable candlestick = new System.Data.DataTable("Stock"); candlestick.Columns.AddRange(new System.Data.DataColumn[]{ new System.Data.DataColumn("DayOfWeek", typeof(String)), new System.Data.DataColumn("Morning", typeof(int)), new System.Data.DataColumn("Afternoon", typeof(int)), new System.Data.DataColumn("Evening", typeof(int)), new System.Data.DataColumn("Night", typeof(int)) }); candlestick.Rows.Add(new object[] { "Mon", 20, 28, 38, 45 }); candlestick.Rows.Add(new object[] { "Tues", 31, 38, 55, 66 }); candlestick.Rows.Add(new object[] { "Wed", 50, 55, 77, 80}); candlestick.Rows.Add(new object[] { "Thurs", 50, 77, 66, 77}); candlestick.Rows.Add(new object[] { "Fri", 15, 66, 22, 68}); this.GVCandlestickChart1.GviTitle = "Stock Value over Week"; this.GVCandlestickChart1.DataSource = candlestick; this.GVCandlestickChart1.DataBind(); System.Data.DataTable dt = new System.Data.DataTable("Work Day"); dt.Columns.Add("Activity"); dt.Columns.Add("Daily Percentage", typeof(int)); dt.Rows.Add(new object[] {"Engineering",5}); dt.Rows.Add(new object[] { "Programming", 3 }); dt.Rows.Add(new object[] { "Sleeping", 1 }); dt.Rows.Add(new object[] { "Lunch", 1 }); dt.Rows.Add(new object[] { "Meetings", 1 }); this.GVPieChart1.DataSource = dt; this.GVDonutChart1.DataSource = dt; this.GVDonutChart1.DataBind(); this.GVPieChart2.GviTitle = "Where I Spend My Time"; this.GVPieChart2.GviLegendClass = new GoogleChartsNGraphsControls.Legend() { LegendPosition = GoogleChartsNGraphsControls.LegendPostion.Bottom }; this.GVPieChart2.GviIs3D = true; this.GVPieChart2.GviOptionsOverride = "{\"is3D\":true,\"title\":\"Where I Spend My Time\",\"legend\":{position: 'left', textStyle: {color: 'blue', fontSize: 16}}}"; this.GVPieChart2.DataSource = dt; System.Data.DataTable dt2 = new System.Data.DataTable("Company Sales/Expenses"); dt2.Columns.Add("Year"); dt2.Columns.Add("Expenses", typeof(int)); dt2.Columns.Add("Sales", typeof(int)); dt2.Rows.Add(new object[] { "2004", 215000, 225000}); dt2.Rows.Add(new object[] { "2005", 300000, 320000}); dt2.Rows.Add(new object[] { "2006", 326000, 356000}); dt2.Rows.Add(new object[] { "2007", 485000, 490000}); dt2.Rows.Add(new object[] { "2008", 410000, 442000 }); dt2.Rows.Add(new object[] { "2009", 466000, 422000 }); dt2.Rows.Add(new object[] { "2010", 480000, 435000}); //this.GVAreaChart2.GviLegend = new GoogleChartsNGraphsControls.Legend() { LegendPosition = GoogleChartsNGraphsControls.LegendPostion.Bottom }; this.GVAreaChart2.DataSource = dt2; this.GVLineChart1.DataSource = dt2; this.GVLineChart22.GviIsStacked = true; this.GVLineChart22.DataSource = dt2; GoogleChartsNGraphsControls.hAxis hx = new GoogleChartsNGraphsControls.hAxis(); hx.SlantedText = true; hx.Title = "Hoz Axis Title"; this.GVAreaChart2.GviHAxisClass = hx; GoogleChartsNGraphsControls.Animation an = new GoogleChartsNGraphsControls.Animation(); an.Easing = GoogleChartsNGraphsControls.AnimationEasing.Out; an.Duration = 1000; this.GVAreaChart2.GviAnimationClass = an; System.Data.DataTable barchart = new System.Data.DataTable("Company Performance"); barchart.Columns.Add("Year", typeof(string)); barchart.Columns.Add("Sales", typeof(int)); barchart.Columns.Add("Expenses", typeof(int)); barchart.Rows.Add(new object[] { "2004", 1000, 400 }); barchart.Rows.Add(new object[] { "2005", 1170, 460 }); barchart.Rows.Add(new object[] { "2006", 660, 1120 }); barchart.Rows.Add(new object[] { "2007", 1030, 540 }); //this.GVBarChart1.GviVAxis = "{title: 'Year', titleTextStyle: {color: 'red'} }"; hx = new GoogleChartsNGraphsControls.hAxis(); hx.Title = "In Thousands"; hx.Formatted = GoogleChartsNGraphsControls.AxisFormat.Currency; hx.SlantedText = true; this.GVBarChart1.GviHAxisClass = hx; this.GVBarChart1.GviColors = new System.Drawing.Color?[] { Color.MediumAquamarine, Color.LightCyan }; this.GVBarChart1.DataSource = barchart; //this.GVColumnChart1.GviVAxis = "{title: 'Year', titleTextStyle: {color: 'red'} }"; GoogleChartsNGraphsControls.vAxis vx = new GoogleChartsNGraphsControls.vAxis(); vx.BaselineColor = Color.Green; vx.Formatted = GoogleChartsNGraphsControls.AxisFormat.Euro; vx.Title = "By Year"; GoogleChartsNGraphsControls.TrendLine tl1 = new GoogleChartsNGraphsControls.TrendLine() { Color = Color.MediumPurple, Type = GoogleChartsNGraphsControls.TrendLineType.Exponential, LabelInLegend = "Year Trend", Opacity = 0.3f, LineWidth = 10, VisibleInLegend = true }; GoogleChartsNGraphsControls.TrendLine tl2 = new GoogleChartsNGraphsControls.TrendLine() { Color = Color.Maroon, Type = GoogleChartsNGraphsControls.TrendLineType.Linear, LabelInLegend = "Sales Trend", Opacity = 0.3f, LineWidth = 5, VisibleInLegend = true }; this.GVColumnChart1.GviTrendLine = new GoogleChartsNGraphsControls.TrendLine[] { tl1, tl2 }; this.GVColumnChart1.GviVAxisClass = vx; this.GVColumnChart1.DataSource = barchart; this.GVBarChartEvents.DataSource = barchart; // stacked chart this.GVBarChartStacked.DataSource = barchart; this.GVBarChartStacked.DataBind(); /* * var data = google.visualization.arrayToDataTable([ ['Month', 'Bolivia', 'Ecuador', 'Madagascar', 'Papua New Guinea', 'Rwanda', 'Average'], ['2004/05', 165, 938, 522, 998, 450, 614.6], ['2005/06', 135, 1120, 599, 1268, 288, 682], ['2006/07', 157, 1167, 587, 807, 397, 623], ['2007/08', 139, 1110, 615, 968, 215, 609.4], ['2008/09', 136, 691, 629, 1026, 366, 569.6] ]); */ DataTable combo = new DataTable("Monthly Coffee Production by Country"); combo.Columns.Add("Year", typeof(DateTime)); combo.Columns.Add("Bolivia", typeof(int)); combo.Columns.Add("Ecuador", typeof(int)); combo.Columns.Add("Madagascar", typeof(int)); combo.Columns.Add("Papua New Guinea", typeof(int)); combo.Columns.Add("Rwanda", typeof(int)); combo.Columns.Add("Average", typeof(int)); combo.Rows.Add(new object[] { new DateTime(2004, 5, 1), 165, 938, 522, 998, 450, 614 }); combo.Rows.Add(new object[] { new DateTime(2004, 6, 1), 135, 1120, 599, 1268, 288, 682 }); combo.Rows.Add(new object[] { new DateTime(2004, 7, 1), 157, 1167, 587, 807, 397, 623 }); combo.Rows.Add(new object[] { new DateTime(2004, 8, 1), 139, 1110, 615, 968, 215, 609 }); combo.Rows.Add(new object[] { new DateTime(2004, 9, 1), 136, 691, 629, 1026, 366, 569 }); //this.GVComboChart1.GviOptionsOverride = "{ seriesType:'bars', series:{5:{type:'line'}} }"; this.GVComboChart1.GviComboChartLine.Add( new GoogleChartsNGraphsControls.ComboChartLineSeries() { Column = 5, LineType = GoogleChartsNGraphsControls.SeriesType.Line }); GoogleChartsNGraphsControls.vAxis vxx = new GoogleChartsNGraphsControls.vAxis(); vxx.MinValue = 0; vxx.MaxValue = 2000; this.GVComboChart1.GviVAxisClass = vxx; this.GVComboChart1.DataSource = combo; this.GVComboChart1.DataBind(); //DataTable combo2 = new DataTable("Monthly Coffee Production by Country"); //combo2.Columns.Add("Year", typeof(DateTime)); //combo2.Columns.Add("Bolivia", typeof(int)); //combo2.Columns.Add("Ecuador", typeof(int)); //combo2.Columns.Add("Madagascar", typeof(int)); //combo2.Columns.Add("Papua New Guinea", typeof(int)); //combo2.Columns.Add("Rwanda", typeof(int)); //// NOTE: This will be a calculated column as part of the ComboChart features ////combo2.Columns.Add("Average", typeof(int)); //combo2.Rows.Add(new object[] { new DateTime(2004, 5, 1), 165, 938, 522, 998, 450 }); //combo2.Rows.Add(new object[] { new DateTime(2004, 6, 1), 135, 1120, 599, 1268, 288 }); //combo2.Rows.Add(new object[] { new DateTime(2004, 7, 1), 157, 1167, 587, 807, 397 }); //combo2.Rows.Add(new object[] { new DateTime(2004, 8, 1), 139, 1110, 615, 968, 215 }); //combo2.Rows.Add(new object[] { new DateTime(2004, 9, 1), 136, 691, 629, 1026, 366}); //this.GVComboChart2.GviOptionsOverride = "{ seriesType:'bars', series:{4:{type:'line'}} }"; //this.GVComboChart2.DataSource = combo2; //this.GVComboChart2.DataBind(); //System.Data.DataTable gnattchart = new System.Data.DataTable("Something Performance"); //gnattchart.Columns.Add("Year", typeof(string)); //gnattchart.Columns.Add("Something", typeof(int)); //gnattchart.Rows.Add(new object[] { "2004", 400 }); //gnattchart.Rows.Add(new object[] { "2005", 460 }); //gnattchart.Rows.Add(new object[] { "2006", 1120 }); //gnattchart.Rows.Add(new object[] { "2007", 540 }); //this.GVGanttChart1.GviVAxis = "{title: 'Year', titleTextStyle: {color: 'blue'} }"; //this.GVGanttChart1.GviColors = new System.Drawing.Color?[] { Color.DeepPink, Color.Violet, Color.Turquoise, Color.Salmon }; //this.GVGanttChart1.DataSource = gnattchart; System.Data.DataTable motionchart = new System.Data.DataTable("Example"); motionchart.Columns.AddRange(new System.Data.DataColumn[] { new System.Data.DataColumn("Fruit", typeof(string)), new System.Data.DataColumn("Date", typeof(DateTime)), new System.Data.DataColumn("Sales", typeof(int)), new System.Data.DataColumn("Expenses", typeof(int)), new System.Data.DataColumn("Location", typeof(string)) }); motionchart.Rows.Add(new object[] { "Apples", new DateTime(1988,1,1), 1000, 300, "East"} ); motionchart.Rows.Add(new object[] { "Oranges", new DateTime(1988, 1, 1), 1150, 311, "West" }); motionchart.Rows.Add(new object[] { "Bananas", new DateTime(1988, 1, 1), 300, 200, "West" }); motionchart.Rows.Add(new object[] { "Apples", new DateTime(1989, 6, 1), 1200, 250, "East" }); motionchart.Rows.Add(new object[] { "Oranges", new DateTime(1989, 6, 1), 750, 150, "West" }); motionchart.Rows.Add(new object[] { "Bananas", new DateTime(1989, 6, 1), 788, 617, "West" }); this.GVMotionChart1.DataSource = motionchart; System.Data.DataTable scatter = new System.Data.DataTable("Scatter Example"); scatter.Columns.AddRange( new System.Data.DataColumn[]{ new System.Data.DataColumn("Age",typeof(int)), new System.Data.DataColumn("Weight",typeof(int)) }); scatter.Rows.Add(new object[] { 8, 72}); scatter.Rows.Add(new object[] { 4, 46 }); scatter.Rows.Add(new object[] { 6, 55 }); scatter.Rows.Add(new object[] { 9, 78 }); scatter.Rows.Add(new object[] { 12, 92 }); scatter.Rows.Add(new object[] { 5, 50 }); this.GVScatterChart1.GviTitle = "Age vs Weight Comparison"; GoogleChartsNGraphsControls.TrendLine trend = new GoogleChartsNGraphsControls.TrendLine() { Color = Color.MediumPurple, Opacity = 0.4f, LineWidth = 10, VisibleInLegend = true, LabelInLegend = "Trend Line", Type = GoogleChartsNGraphsControls.TrendLineType.Exponential }; this.GVScatterChart1.GviTrendLine = new GoogleChartsNGraphsControls.TrendLine[] { trend }; //this.GVScatterChart1.GviHAxis = "{title: 'Age', minValue: 0, maxValue: 15}"; hx = new GoogleChartsNGraphsControls.hAxis(); hx.Title = "Child Age"; hx.ShowTextEvery = 1; hx.SlantedText = true; //this.GVScatterChart1.GviVAxis = "{title: 'Weight', minValue: 0, maxValue: 100}"; this.GVScatterChart1.GviHAxisClass = hx; an = new GoogleChartsNGraphsControls.Animation(GoogleChartsNGraphsControls.AnimationEasing.InAndOut, 1000); this.GVScatterChart1.GviAnimationClass = an; this.GVScatterChart1.DataSource = scatter; //System.Data.DataTable projs = new System.Data.DataTable("US Projects"); //projs.Columns.AddRange(new System.Data.DataColumn[] { // new System.Data.DataColumn("City",typeof(string)), // new System.Data.DataColumn("Completion",typeof(int)), // new System.Data.DataColumn("Comments",typeof(string)) //}); //projs.Rows.Add(new object[] { "Astoria, NY", 95, "Astoria: Almost Done" }); //projs.Rows.Add(new object[] { "Novato, CA", 35, "Novato: Just Starting" }); //projs.Rows.Add(new object[] { "Duvall, WA", 10, "Duvall: Just Starting" }); //this.GVGeoMap3.GviOptionsOverride = "{'region':'US','colors':[0xFF8747, 0xFFB581, 0xc06000], 'dataMode':'markers'}"; //this.GVGeoMap3.DataSource = projs; System.Data.DataTable gauge = new System.Data.DataTable("Computer"); gauge.Columns.AddRange(new System.Data.DataColumn[] { new System.Data.DataColumn("Label",typeof(string)), new System.Data.DataColumn("Value",typeof(int)) }); gauge.Rows.Add(new object[] { "Memory", 80 }); gauge.Rows.Add(new object[] { "CPU", 55 }); gauge.Rows.Add(new object[] { "Network", 68 }); this.GVGauge1.GviRedFrom = 90; this.GVGauge1.GviRedTo = 100; this.GVGauge1.GviYellowFrom = 75; this.GVGauge1.GviYellowTo = 90; this.GVGauge1.DataSource = gauge; System.Data.DataTable tblArrow = new System.Data.DataTable("DataTable - Arrow Formatter"); tblArrow.Columns.AddRange(new System.Data.DataColumn[] { new System.Data.DataColumn("Department",typeof(string)), new System.Data.DataColumn("Revenue Change",typeof(float)) }); tblArrow.Rows.Add(new object[] { "Sports", 12f }); tblArrow.Rows.Add(new object[] { "Toys", -7.3f}); tblArrow.Rows.Add(new object[] { "Electronics", -2.1f }); tblArrow.Rows.Add(new object[] { "Food", 22.0f }); this.GVTableArrowFormat1.GviOptionsOverride = "{allowHtml: true, showRowNumber: true}"; this.GVTableArrowFormat1.DataSource = tblArrow; System.Data.DataTable tblBar = new System.Data.DataTable("DataTable - Bar + Arrow Formatter"); tblBar.Columns.AddRange(new System.Data.DataColumn[] { new System.Data.DataColumn("Department",typeof(string)), new System.Data.DataColumn("Manager",typeof(string)), new System.Data.DataColumn("Revenue",typeof(int)), new System.Data.DataColumn("Revenue Change",typeof(float)) }); tblBar.Rows.Add(new object[] { "Shoes", "Lady Gaga",10700, 12f }); tblBar.Rows.Add(new object[] { "Sports", "Reggie Bush",-15200, -7.3f }); tblBar.Rows.Add(new object[] { "Toys", "Reggie Bush", 12500, 2.1f }); tblBar.Rows.Add(new object[] { "Electronics", "Daft Punk",-2100, -6.3}); tblBar.Rows.Add(new object[] { "Food", "Wolfgang Puck", 22600, 5.3f }); tblBar.Rows.Add(new object[] { "Art", "Leo Davinci",1100, 44.3f }); this.GVTableBarFormat1.GviFormatColumn = 2; this.GVTableBarFormat1.GviOptionsOverride = "{allowHtml: true, showRowNumber: true}"; this.GVTableBarFormat1.GviFormatter.Add( new GoogleChartsNGraphsControls.TableFormatter() { Formatter = GoogleChartsNGraphsControls.TableFormatter.FormatType.ArrowFormat, GviFormatColumn = 3 }); this.GVTableBarFormat1.DataSource = tblBar; this.GVOrgChart1.ChartData("Mike R", "", "President/CEO"); this.GVOrgChart1.ChartData("Helen B", "Mike R", "CFO"); this.GVOrgChart1.ChartData("Tom N", "Mike R", "VP Construction"); this.GVOrgChart1.ChartData("Patrick S", "Mike R", "VP Project Management"); this.GVOrgChart1.ChartData("Greg T", "Mike R", "VP Procurement"); this.GVOrgChart1.ChartData("Carl Q", "Mike R", "VP Engineering"); this.GVOrgChart1.ChartData("Sunny R", "Helen B", "IT Manager"); this.GVOrgChart1.ChartData("Kim C", "Helen B", "Accounting Manager"); this.GVOrgChart1.ChartData("Sam Fagih", "Carl Q", "Sr. Engineering Manager"); this.GVOrgChart1.ChartData("Tony M", "Sunny R", "Sr. Software Analyst"); this.GVOrgChart1.ChartData("Jeff L", "Sunny R", "Sr. Desktop Support"); this.GVOrgChart1.ChartData("Isaac P", "Sunny R", "Information Systems"); this.GVOrgChart1.ChartData("Paul L", "Sunny R", "Information Systems"); this.GVOrgChart1.ChartData("Connie B", "Sunny R", "IT Specialist"); this.GVOrgChart1.ChartData("David H", "Jeff L", "Desktop Support"); this.GVOrgChart1.ChartData("Chad T", "Jeff L", "Desktop Support"); this.GVOrgChart1.ChartData("Julian K", "Tony M", "Jr. Software Analyst"); // this.GVOrgChart2.GviAllowHtml = true; ' this is turned on automatically by the templating ChartData call this.GVOrgChart2.ChartData(quickTemplate("Mike R", "", "President/CEO", false)); this.GVOrgChart2.ChartData(quickTemplate("Helen B", "Mike R", "CFO", true)); this.GVOrgChart2.ChartData(quickTemplate("Tom N", "Mike R", "VP Construction", false)); this.GVOrgChart2.ChartData(quickTemplate("Patrick S", "Mike R", "VP Project Management", false)); this.GVOrgChart2.ChartData(quickTemplate("Greg T", "Mike R", "VP Procurement", false)); this.GVOrgChart2.ChartData(quickTemplate("Carl Q", "Mike R", "VP Engineering", false)); this.GVOrgChart2.ChartData(quickTemplate("Sunny R", "Helen B", "IT Manager", true)); this.GVOrgChart2.ChartData(quickTemplate("Kim C", "Helen B", "Accounting Manager", true)); this.GVOrgChart2.ChartData(quickTemplate("Sam Fagih", "Carl Q", "Sr. Engineering Manager", false)); this.GVOrgChart2.ChartData(quickTemplate("Tony M", "Sunny R", "Sr. Software Analyst", false)); this.GVOrgChart2.ChartData(quickTemplate("Jeff L", "Sunny R", "Sr. Desktop Support", false)); this.GVOrgChart2.ChartData(quickTemplate("Isaac P", "Sunny R", "Information Systems", false)); this.GVOrgChart2.ChartData(quickTemplate("Paul L", "Sunny R", "Information Systems", false)); this.GVOrgChart2.ChartData(quickTemplate("Connie B", "Sunny R", "IT Specialist", true)); this.GVOrgChart2.ChartData(quickTemplate("David H", "Jeff L", "Desktop Support", false)); this.GVOrgChart2.ChartData(quickTemplate("Chad T", "Jeff L", "Desktop Support", false)); this.GVOrgChart2.ChartData(quickTemplate("Julian K", "Tony M", "Jr. Software Analyst", false)); }
protected void Page_Init() { chart_timeline(); chart_histogram(); chart_calendar(); chart_annotation(); chart_Roles(); chart_gantt(); // Map Test this.GVMap2.ChartData("Duvall, WA", "Home Sweet Home"); this.GVMap2.ChartData("Bothell, WA", "Work"); // AnnotatedTimeline Test List <GoogleChartsNGraphsControls.TimelineEvent> evts = new List <GoogleChartsNGraphsControls.TimelineEvent>(); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Pencils", new DateTime(2008, 1, 1), 30000)); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Pencils", new DateTime(2008, 1, 2), 14045)); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Pencils", new DateTime(2008, 1, 3), 55022)); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Pencils", new DateTime(2008, 1, 4), 75284)); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Pencils", new DateTime(2008, 1, 5), 41476)); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Pencils", new DateTime(2008, 1, 6), 33322)); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Pens", new DateTime(2008, 1, 1), 40645)); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Pens", new DateTime(2008, 1, 2), 20374)); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Pens", new DateTime(2008, 1, 3), 50766)); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Pens", new DateTime(2008, 1, 4), 14334, "Out of Stock", "Ran out of stock on pens at 4pm")); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Pens", new DateTime(2008, 1, 5), 66467, "Bought Pens", "Bought 200k pens")); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Pens", new DateTime(2008, 1, 6), 39463)); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Erasers", new DateTime(2008, 1, 1), 0, "No Erasers", "What was i thinking?")); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Erasers", new DateTime(2008, 1, 2), 1254, "Bought Erasers", "Bought 200k erasers for all the mistakes")); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Erasers", new DateTime(2008, 1, 3), 4596)); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Erasers", new DateTime(2008, 1, 4), 14334)); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Erasers", new DateTime(2008, 1, 5), 26004)); evts.Add(new GoogleChartsNGraphsControls.TimelineEvent("Sold Erasers", new DateTime(2008, 1, 6), 39001)); this.GVAnnotatedTimeline1.GviDisplayAnnotations = GoogleChartsNGraphsControls.TrippleStateBool.True; this.GVAnnotatedTimeline1.ChartData(evts.ToArray()); this.GVAnnotatedTimeline2.ChartData(evts.Where(d => d.EventCategory == "Sold Erasers").ToArray()); System.Data.DataTable candlestick = new System.Data.DataTable("Stock"); candlestick.Columns.AddRange(new System.Data.DataColumn[] { new System.Data.DataColumn("DayOfWeek", typeof(String)), new System.Data.DataColumn("Morning", typeof(int)), new System.Data.DataColumn("Afternoon", typeof(int)), new System.Data.DataColumn("Evening", typeof(int)), new System.Data.DataColumn("Night", typeof(int)) }); candlestick.Rows.Add(new object[] { "Mon", 20, 28, 38, 45 }); candlestick.Rows.Add(new object[] { "Tues", 31, 38, 55, 66 }); candlestick.Rows.Add(new object[] { "Wed", 50, 55, 77, 80 }); candlestick.Rows.Add(new object[] { "Thurs", 50, 77, 66, 77 }); candlestick.Rows.Add(new object[] { "Fri", 15, 66, 22, 68 }); this.GVCandlestickChart1.GviTitle = "Stock Value over Week"; this.GVCandlestickChart1.DataSource = candlestick; this.GVCandlestickChart1.DataBind(); System.Data.DataTable dt = new System.Data.DataTable("Work Day"); dt.Columns.Add("Activity"); dt.Columns.Add("Daily Percentage", typeof(int)); dt.Rows.Add(new object[] { "Engineering", 5 }); dt.Rows.Add(new object[] { "Programming", 3 }); dt.Rows.Add(new object[] { "Sleeping", 1 }); dt.Rows.Add(new object[] { "Lunch", 1 }); dt.Rows.Add(new object[] { "Meetings", 1 }); this.GVPieChart1.DataSource = dt; this.GVDonutChart1.DataSource = dt; this.GVDonutChart1.DataBind(); this.GVPieChart2.GviTitle = "Where I Spend My Time"; this.GVPieChart2.GviLegendClass = new GoogleChartsNGraphsControls.Legend() { LegendPosition = GoogleChartsNGraphsControls.LegendPostion.Bottom }; this.GVPieChart2.GviIs3D = true; this.GVPieChart2.GviOptionsOverride = "{\"is3D\":true,\"title\":\"Where I Spend My Time\",\"legend\":{position: 'left', textStyle: {color: 'blue', fontSize: 16}}}"; this.GVPieChart2.DataSource = dt; System.Data.DataTable dt2 = new System.Data.DataTable("Company Sales/Expenses"); dt2.Columns.Add("Year"); dt2.Columns.Add("Expenses", typeof(int)); dt2.Columns.Add("Sales", typeof(int)); dt2.Rows.Add(new object[] { "2004", 215000, 225000 }); dt2.Rows.Add(new object[] { "2005", 300000, 320000 }); dt2.Rows.Add(new object[] { "2006", 326000, 356000 }); dt2.Rows.Add(new object[] { "2007", 485000, 490000 }); dt2.Rows.Add(new object[] { "2008", 410000, 442000 }); dt2.Rows.Add(new object[] { "2009", 466000, 422000 }); dt2.Rows.Add(new object[] { "2010", 480000, 435000 }); //this.GVAreaChart2.GviLegend = new GoogleChartsNGraphsControls.Legend() { LegendPosition = GoogleChartsNGraphsControls.LegendPostion.Bottom }; this.GVAreaChart2.DataSource = dt2; this.GVLineChart1.DataSource = dt2; this.GVLineChart22.GviIsStacked = true; this.GVLineChart22.DataSource = dt2; GoogleChartsNGraphsControls.hAxis hx = new GoogleChartsNGraphsControls.hAxis(); hx.SlantedText = true; hx.Title = "Hoz Axis Title"; this.GVAreaChart2.GviHAxisClass = hx; GoogleChartsNGraphsControls.Animation an = new GoogleChartsNGraphsControls.Animation(); an.Easing = GoogleChartsNGraphsControls.AnimationEasing.Out; an.Duration = 1000; this.GVAreaChart2.GviAnimationClass = an; System.Data.DataTable barchart = new System.Data.DataTable("Company Performance"); barchart.Columns.Add("Year", typeof(string)); barchart.Columns.Add("Sales", typeof(int)); barchart.Columns.Add("Expenses", typeof(int)); barchart.Rows.Add(new object[] { "2004", 1000, 400 }); barchart.Rows.Add(new object[] { "2005", 1170, 460 }); barchart.Rows.Add(new object[] { "2006", 660, 1120 }); barchart.Rows.Add(new object[] { "2007", 1030, 540 }); //this.GVBarChart1.GviVAxis = "{title: 'Year', titleTextStyle: {color: 'red'} }"; hx = new GoogleChartsNGraphsControls.hAxis(); hx.Title = "In Thousands"; hx.Formatted = GoogleChartsNGraphsControls.AxisFormat.Currency; hx.SlantedText = true; this.GVBarChart1.GviHAxisClass = hx; this.GVBarChart1.GviColors = new System.Drawing.Color?[] { Color.MediumAquamarine, Color.LightCyan }; this.GVBarChart1.DataSource = barchart; //this.GVColumnChart1.GviVAxis = "{title: 'Year', titleTextStyle: {color: 'red'} }"; GoogleChartsNGraphsControls.vAxis vx = new GoogleChartsNGraphsControls.vAxis(); vx.BaselineColor = Color.Green; vx.Formatted = GoogleChartsNGraphsControls.AxisFormat.Euro; vx.Title = "By Year"; //vx.Format = "#,###"; GoogleChartsNGraphsControls.TrendLine tl1 = new GoogleChartsNGraphsControls.TrendLine() { Color = Color.MediumPurple, Type = GoogleChartsNGraphsControls.TrendLineType.Exponential, LabelInLegend = "Year Trend", Opacity = 0.3f, LineWidth = 10, VisibleInLegend = true }; GoogleChartsNGraphsControls.TrendLine tl2 = new GoogleChartsNGraphsControls.TrendLine() { Color = Color.Maroon, Type = GoogleChartsNGraphsControls.TrendLineType.Linear, LabelInLegend = "Sales Trend", Opacity = 0.3f, LineWidth = 5, VisibleInLegend = true }; this.GVColumnChart1.GviTrendLine = new GoogleChartsNGraphsControls.TrendLine[] { tl1, tl2 }; this.GVColumnChart1.GviVAxisClass = vx; this.GVColumnChart1.DataSource = barchart; this.GVBarChartEvents.DataSource = barchart; // stacked chart this.GVBarChartStacked.DataSource = barchart; this.GVBarChartStacked.DataBind(); /* * var data = google.visualization.arrayToDataTable([ * ['Month', 'Bolivia', 'Ecuador', 'Madagascar', 'Papua New Guinea', 'Rwanda', 'Average'], * ['2004/05', 165, 938, 522, 998, 450, 614.6], * ['2005/06', 135, 1120, 599, 1268, 288, 682], * ['2006/07', 157, 1167, 587, 807, 397, 623], * ['2007/08', 139, 1110, 615, 968, 215, 609.4], * ['2008/09', 136, 691, 629, 1026, 366, 569.6] * ]); */ DataTable combo = new DataTable("Monthly Coffee Production by Country"); combo.Columns.Add("Year", typeof(DateTime)); combo.Columns.Add("Bolivia", typeof(int)); combo.Columns.Add("Ecuador", typeof(int)); combo.Columns.Add("Madagascar", typeof(int)); combo.Columns.Add("Papua New Guinea", typeof(int)); combo.Columns.Add("Rwanda", typeof(int)); combo.Columns.Add("Average", typeof(int)); combo.Rows.Add(new object[] { new DateTime(2004, 5, 1), 165, 938, 522, 998, 450, 614 }); combo.Rows.Add(new object[] { new DateTime(2004, 6, 1), 135, 1120, 599, 1268, 288, 682 }); combo.Rows.Add(new object[] { new DateTime(2004, 7, 1), 157, 1167, 587, 807, 397, 623 }); combo.Rows.Add(new object[] { new DateTime(2004, 8, 1), 139, 1110, 615, 968, 215, 609 }); combo.Rows.Add(new object[] { new DateTime(2004, 9, 1), 136, 691, 629, 1026, 366, 569 }); //this.GVComboChart1.GviOptionsOverride = "{ seriesType:'bars', series:{5:{type:'line'}} }"; this.GVComboChart1.GviLineSeriesList.Add(new GoogleChartsNGraphsControls.ComboChartLineSeries() { Column = 5, SeriesType = GoogleChartsNGraphsControls.SeriesType.Line }); GoogleChartsNGraphsControls.vAxis vxx = new GoogleChartsNGraphsControls.vAxis(); vxx.MinValue = 0; vxx.MaxValue = 2000; this.GVComboChart1.GviVAxisClass = vxx; this.GVComboChart1.DataSource = combo; this.GVComboChart1.DataBind(); //DataTable combo2 = new DataTable("Monthly Coffee Production by Country"); //combo2.Columns.Add("Year", typeof(DateTime)); //combo2.Columns.Add("Bolivia", typeof(int)); //combo2.Columns.Add("Ecuador", typeof(int)); //combo2.Columns.Add("Madagascar", typeof(int)); //combo2.Columns.Add("Papua New Guinea", typeof(int)); //combo2.Columns.Add("Rwanda", typeof(int)); //// NOTE: This will be a calculated column as part of the ComboChart features ////combo2.Columns.Add("Average", typeof(int)); //combo2.Rows.Add(new object[] { new DateTime(2004, 5, 1), 165, 938, 522, 998, 450 }); //combo2.Rows.Add(new object[] { new DateTime(2004, 6, 1), 135, 1120, 599, 1268, 288 }); //combo2.Rows.Add(new object[] { new DateTime(2004, 7, 1), 157, 1167, 587, 807, 397 }); //combo2.Rows.Add(new object[] { new DateTime(2004, 8, 1), 139, 1110, 615, 968, 215 }); //combo2.Rows.Add(new object[] { new DateTime(2004, 9, 1), 136, 691, 629, 1026, 366}); //this.GVComboChart2.GviOptionsOverride = "{ seriesType:'bars', series:{4:{type:'line'}} }"; //this.GVComboChart2.DataSource = combo2; //this.GVComboChart2.DataBind(); //System.Data.DataTable gnattchart = new System.Data.DataTable("Something Performance"); //gnattchart.Columns.Add("Year", typeof(string)); //gnattchart.Columns.Add("Something", typeof(int)); //gnattchart.Rows.Add(new object[] { "2004", 400 }); //gnattchart.Rows.Add(new object[] { "2005", 460 }); //gnattchart.Rows.Add(new object[] { "2006", 1120 }); //gnattchart.Rows.Add(new object[] { "2007", 540 }); //this.GVGanttChart1.GviVAxis = "{title: 'Year', titleTextStyle: {color: 'blue'} }"; //this.GVGanttChart1.GviColors = new System.Drawing.Color?[] { Color.DeepPink, Color.Violet, Color.Turquoise, Color.Salmon }; //this.GVGanttChart1.DataSource = gnattchart; System.Data.DataTable motionchart = new System.Data.DataTable("Example"); motionchart.Columns.AddRange(new System.Data.DataColumn[] { new System.Data.DataColumn("Fruit", typeof(string)), new System.Data.DataColumn("Date", typeof(DateTime)), new System.Data.DataColumn("Sales", typeof(int)), new System.Data.DataColumn("Expenses", typeof(int)), new System.Data.DataColumn("Location", typeof(string)) }); motionchart.Rows.Add(new object[] { "Apples", new DateTime(1988, 1, 1), 1000, 300, "East" }); motionchart.Rows.Add(new object[] { "Oranges", new DateTime(1988, 1, 1), 1150, 311, "West" }); motionchart.Rows.Add(new object[] { "Bananas", new DateTime(1988, 1, 1), 300, 200, "West" }); motionchart.Rows.Add(new object[] { "Apples", new DateTime(1989, 6, 1), 1200, 250, "East" }); motionchart.Rows.Add(new object[] { "Oranges", new DateTime(1989, 6, 1), 750, 150, "West" }); motionchart.Rows.Add(new object[] { "Bananas", new DateTime(1989, 6, 1), 788, 617, "West" }); this.GVMotionChart1.DataSource = motionchart; System.Data.DataTable scatter = new System.Data.DataTable("Scatter Example"); scatter.Columns.AddRange( new System.Data.DataColumn[] { new System.Data.DataColumn("Age", typeof(int)), new System.Data.DataColumn("Weight", typeof(int)) }); scatter.Rows.Add(new object[] { 8, 72 }); scatter.Rows.Add(new object[] { 4, 46 }); scatter.Rows.Add(new object[] { 6, 55 }); scatter.Rows.Add(new object[] { 9, 78 }); scatter.Rows.Add(new object[] { 12, 92 }); scatter.Rows.Add(new object[] { 5, 50 }); this.GVScatterChart1.GviTitle = "Age vs Weight Comparison"; GoogleChartsNGraphsControls.TrendLine trend = new GoogleChartsNGraphsControls.TrendLine() { Color = Color.MediumPurple, Opacity = 0.4f, LineWidth = 10, VisibleInLegend = true, LabelInLegend = "Trend Line", Type = GoogleChartsNGraphsControls.TrendLineType.Exponential }; this.GVScatterChart1.GviTrendLine = new GoogleChartsNGraphsControls.TrendLine[] { trend }; //this.GVScatterChart1.GviHAxis = "{title: 'Age', minValue: 0, maxValue: 15}"; hx = new GoogleChartsNGraphsControls.hAxis(); hx.Title = "Child Age"; hx.ShowTextEvery = 1; hx.SlantedText = true; //this.GVScatterChart1.GviVAxis = "{title: 'Weight', minValue: 0, maxValue: 100}"; this.GVScatterChart1.GviHAxisClass = hx; an = new GoogleChartsNGraphsControls.Animation(GoogleChartsNGraphsControls.AnimationEasing.InAndOut, 1000); this.GVScatterChart1.GviAnimationClass = an; this.GVScatterChart1.DataSource = scatter; //System.Data.DataTable projs = new System.Data.DataTable("US Projects"); //projs.Columns.AddRange(new System.Data.DataColumn[] { // new System.Data.DataColumn("City",typeof(string)), // new System.Data.DataColumn("Completion",typeof(int)), // new System.Data.DataColumn("Comments",typeof(string)) //}); //projs.Rows.Add(new object[] { "Astoria, NY", 95, "Astoria: Almost Done" }); //projs.Rows.Add(new object[] { "Novato, CA", 35, "Novato: Just Starting" }); //projs.Rows.Add(new object[] { "Duvall, WA", 10, "Duvall: Just Starting" }); //this.GVGeoMap3.GviOptionsOverride = "{'region':'US','colors':[0xFF8747, 0xFFB581, 0xc06000], 'dataMode':'markers'}"; //this.GVGeoMap3.DataSource = projs; System.Data.DataTable gauge = new System.Data.DataTable("Computer"); gauge.Columns.AddRange(new System.Data.DataColumn[] { new System.Data.DataColumn("Label", typeof(string)), new System.Data.DataColumn("Value", typeof(int)) }); gauge.Rows.Add(new object[] { "Memory", 80 }); gauge.Rows.Add(new object[] { "CPU", 55 }); gauge.Rows.Add(new object[] { "Network", 68 }); this.GVGauge1.GviRedFrom = 90; this.GVGauge1.GviRedTo = 100; this.GVGauge1.GviYellowFrom = 75; this.GVGauge1.GviYellowTo = 90; this.GVGauge1.DataSource = gauge; System.Data.DataTable tblArrow = new System.Data.DataTable("DataTable - Arrow Formatter"); tblArrow.Columns.AddRange(new System.Data.DataColumn[] { new System.Data.DataColumn("Department", typeof(string)), new System.Data.DataColumn("Revenue Change", typeof(float)) }); tblArrow.Rows.Add(new object[] { "Sports", 12f }); tblArrow.Rows.Add(new object[] { "Toys", -7.3f }); tblArrow.Rows.Add(new object[] { "Electronics", -2.1f }); tblArrow.Rows.Add(new object[] { "Food", 22.0f }); this.GVTableArrowFormat1.GviOptionsOverride = "{allowHtml: true, showRowNumber: true}"; this.GVTableArrowFormat1.DataSource = tblArrow; System.Data.DataTable tblBar = new System.Data.DataTable("DataTable - Bar + Arrow Formatter"); tblBar.Columns.AddRange(new System.Data.DataColumn[] { new System.Data.DataColumn("Department", typeof(string)), new System.Data.DataColumn("Manager", typeof(string)), new System.Data.DataColumn("Revenue", typeof(int)), new System.Data.DataColumn("Revenue Change", typeof(float)) }); tblBar.Rows.Add(new object[] { "Shoes", "Lady Gaga", 10700, 12f }); tblBar.Rows.Add(new object[] { "Sports", "Reggie Bush", -15200, -7.3f }); tblBar.Rows.Add(new object[] { "Toys", "Reggie Bush", 12500, 2.1f }); tblBar.Rows.Add(new object[] { "Electronics", "Daft Punk", -2100, -6.3 }); tblBar.Rows.Add(new object[] { "Food", "Wolfgang Puck", 22600, 5.3f }); tblBar.Rows.Add(new object[] { "Art", "Leo Davinci", 1100, 44.3f }); this.GVTableBarFormat1.GviFormatColumn = 2; this.GVTableBarFormat1.GviOptionsOverride = "{allowHtml: true, showRowNumber: true}"; this.GVTableBarFormat1.GviFormatter.Add( new GoogleChartsNGraphsControls.TableFormatter() { Formatter = GoogleChartsNGraphsControls.TableFormatter.FormatType.ArrowFormat, GviFormatColumn = 3 }); this.GVTableBarFormat1.DataSource = tblBar; this.GVOrgChart1.ChartData("Mike R", "", "President/CEO"); this.GVOrgChart1.ChartData("Helen B", "Mike R", "CFO"); this.GVOrgChart1.ChartData("Tom N", "Mike R", "VP Construction"); this.GVOrgChart1.ChartData("Patrick S", "Mike R", "VP Project Management"); this.GVOrgChart1.ChartData("Greg T", "Mike R", "VP Procurement"); this.GVOrgChart1.ChartData("Carl Q", "Mike R", "VP Engineering"); this.GVOrgChart1.ChartData("Sunny R", "Helen B", "IT Manager"); this.GVOrgChart1.ChartData("Kim C", "Helen B", "Accounting Manager"); this.GVOrgChart1.ChartData("Sam Fagih", "Carl Q", "Sr. Engineering Manager"); this.GVOrgChart1.ChartData("Tony M", "Sunny R", "Sr. Software Analyst"); this.GVOrgChart1.ChartData("Jeff L", "Sunny R", "Sr. Desktop Support"); this.GVOrgChart1.ChartData("Isaac P", "Sunny R", "Information Systems"); this.GVOrgChart1.ChartData("Paul L", "Sunny R", "Information Systems"); this.GVOrgChart1.ChartData("Connie B", "Sunny R", "IT Specialist"); this.GVOrgChart1.ChartData("David H", "Jeff L", "Desktop Support"); this.GVOrgChart1.ChartData("Chad T", "Jeff L", "Desktop Support"); this.GVOrgChart1.ChartData("Julian K", "Tony M", "Jr. Software Analyst"); // this.GVOrgChart2.GviAllowHtml = true; ' this is turned on automatically by the templating ChartData call this.GVOrgChart2.ChartData(quickTemplate("Mike R", "", "President/CEO", false)); this.GVOrgChart2.ChartData(quickTemplate("Helen B", "Mike R", "CFO", true)); this.GVOrgChart2.ChartData(quickTemplate("Tom N", "Mike R", "VP Construction", false)); this.GVOrgChart2.ChartData(quickTemplate("Patrick S", "Mike R", "VP Project Management", false)); this.GVOrgChart2.ChartData(quickTemplate("Greg T", "Mike R", "VP Procurement", false)); this.GVOrgChart2.ChartData(quickTemplate("Carl Q", "Mike R", "VP Engineering", false)); this.GVOrgChart2.ChartData(quickTemplate("Sunny R", "Helen B", "IT Manager", true)); this.GVOrgChart2.ChartData(quickTemplate("Kim C", "Helen B", "Accounting Manager", true)); this.GVOrgChart2.ChartData(quickTemplate("Sam Fagih", "Carl Q", "Sr. Engineering Manager", false)); this.GVOrgChart2.ChartData(quickTemplate("Tony M", "Sunny R", "Sr. Software Analyst", false)); this.GVOrgChart2.ChartData(quickTemplate("Jeff L", "Sunny R", "Sr. Desktop Support", false)); this.GVOrgChart2.ChartData(quickTemplate("Isaac P", "Sunny R", "Information Systems", false)); this.GVOrgChart2.ChartData(quickTemplate("Paul L", "Sunny R", "Information Systems", false)); this.GVOrgChart2.ChartData(quickTemplate("Connie B", "Sunny R", "IT Specialist", true)); this.GVOrgChart2.ChartData(quickTemplate("David H", "Jeff L", "Desktop Support", false)); this.GVOrgChart2.ChartData(quickTemplate("Chad T", "Jeff L", "Desktop Support", false)); this.GVOrgChart2.ChartData(quickTemplate("Julian K", "Tony M", "Jr. Software Analyst", false)); }
//private void areaChart() //{ // System.Data.DataTable dt = new System.Data.DataTable("Company Performance"); // dt.Columns.Add("Year", typeof(string)); // dt.Columns.Add("Sales", typeof(int)); // dt.Columns.Add("Expenses", typeof(int)); // dt.Rows.Add(new object[] { "2004", 1000, 400 }); // dt.Rows.Add(new object[] { "2005", 1170, 460 }); // dt.Rows.Add(new object[] { "2006", 660, 1120 }); // dt.Rows.Add(new object[] { "2007", 1030, 540 }); // this.GVAreaChart1.DataSource = dt; // this.GVAreaChart1.DataBind(); // GoogleChartsNGraphsControls.Animation an = new GoogleChartsNGraphsControls.Animation(); // an.Easing = GoogleChartsNGraphsControls.AnimationEasing.Out; // an.Duration = 2500; // this.GVAreaChart1.GviAnimationClass = an; // this.GVAreaChart1.GviLegendClass = new GoogleChartsNGraphsControls.Legend() { LegendPosition = GoogleChartsNGraphsControls.LegendPostion.Bottom }; // GoogleChartsNGraphsControls.hAxis hx = new GoogleChartsNGraphsControls.hAxis(); // hx.Baseline = 1; // hx.BaselineColor = System.Drawing.Color.Red; // hx.SlantedText = true; // hx.Title = "Hoz Axis Title"; // this.GVAreaChart1.GviHAxisClass = hx; // GoogleChartsNGraphsControls.vAxis vx = new GoogleChartsNGraphsControls.vAxis(); // vx.BaselineColor = System.Drawing.Color.Green; // vx.Formatted = GoogleChartsNGraphsControls.AxisFormat.Euro; // vx.Title = "By Year"; // this.GVAreaChart1.GviVAxisClass = vx; //} private void lineChartWithIntervals() { System.Data.DataTable dt2 = new System.Data.DataTable("Company Sales/Expenses"); dt2.Columns.Add("Year", typeof(string)); dt2.Columns.Add("Expenses", typeof(int)); dt2.Columns.Add("Sales", typeof(int)); dt2.Columns.Add("Interval-Expenses1", typeof(int)); dt2.Columns.Add("Interval-Sales1", typeof(int)); dt2.Columns.Add("Interval-Expenses2", typeof(int)); dt2.Columns.Add("Interval-Sales2", typeof(int)); dt2.Rows.Add(new object[] { "2004", 215000, 225000, 205000, 210000, 235000, 213000 }); dt2.Rows.Add(new object[] { "2005", 300000, 320000, 295000, 315000, 300000, 315000 }); dt2.Rows.Add(new object[] { "2006", 326000, 356000, 315000, 345000, 335000, 365000 }); dt2.Rows.Add(new object[] { "2007", 485000, 490000, 475000, 475000, 495000, 515000 }); dt2.Rows.Add(new object[] { "2008", 410000, 442000, 395000, 425000, 425000, 465000 }); dt2.Rows.Add(new object[] { "2009", 466000, 422000, 445000, 405000, 475000, 435000 }); dt2.Rows.Add(new object[] { "2010", 480000, 435000, 475000, 405000, 525000, 445000 }); GoogleChartsNGraphsControls.TrendLine trend = new GoogleChartsNGraphsControls.TrendLine() { Color = Color.MediumPurple, Opacity = 0.4f, LineWidth = 10, VisibleInLegend = true, LabelInLegend = "Sales", Type = GoogleChartsNGraphsControls.TrendLineType.Exponential }; this.GVLineChart1.GviIntervals = new GoogleChartsNGraphsControls.Interval[] { new GoogleChartsNGraphsControls.Interval() { BarWidth = 3, Color = System.Drawing.Color.MediumPurple, Opacity = 0.2f, Style = GoogleChartsNGraphsControls.IntervalStyle.Area }, new GoogleChartsNGraphsControls.Interval() { BarWidth = 1, Color = System.Drawing.Color.IndianRed, Opacity = 0.2f, Style = GoogleChartsNGraphsControls.IntervalStyle.Box }, new GoogleChartsNGraphsControls.Interval() { BarWidth = 3, Color = System.Drawing.Color.IndianRed, Opacity = 0.2f, Style = GoogleChartsNGraphsControls.IntervalStyle.Area }, new GoogleChartsNGraphsControls.Interval() { BarWidth = 1, Color = System.Drawing.Color.LightBlue, Opacity = 0.2f, Style = GoogleChartsNGraphsControls.IntervalStyle.Box }, }; this.GVLineChart1.GviTrendLine = new GoogleChartsNGraphsControls.TrendLine[] { trend }; //this.GVScatterChart1.GviHAxis = "{title: 'Age', minValue: 0, maxValue: 15}"; GoogleChartsNGraphsControls.hAxis hx = new GoogleChartsNGraphsControls.hAxis(); hx.Title = "Date"; hx.ShowTextEvery = 1; hx.SlantedText = true; //this.GVScatterChart1.GviVAxis = "{title: 'Weight', minValue: 0, maxValue: 100}"; this.GVLineChart1.GviHAxisClass = hx; GoogleChartsNGraphsControls.Animation an = new GoogleChartsNGraphsControls.Animation(GoogleChartsNGraphsControls.AnimationEasing.InAndOut, 1000); this.GVLineChart1.GviAnimationClass = an; this.GVLineChart1.DataSource = dt2; }
private void scatterChart() { System.Data.DataTable scatter = new System.Data.DataTable("Scatter Example"); scatter.Columns.AddRange( new System.Data.DataColumn[]{ new System.Data.DataColumn("Age",typeof(int)), new System.Data.DataColumn("Male-Weight",typeof(int)), new System.Data.DataColumn("Female-Weight",typeof(int)) }); scatter.Rows.Add(new object[] { 8, 72 ,null}); scatter.Rows.Add(new object[] { 4, 46, null }); scatter.Rows.Add(new object[] { 6, 55, null }); scatter.Rows.Add(new object[] { 9, 78, null }); scatter.Rows.Add(new object[] { 12, 92, null }); scatter.Rows.Add(new object[] { 5, 50, null }); scatter.Rows.Add(new object[] { 8, null,72 }); scatter.Rows.Add(new object[] { 4, null, 48 }); scatter.Rows.Add(new object[] { 6, null, 56 }); scatter.Rows.Add(new object[] { 9, null, 76 }); scatter.Rows.Add(new object[] { 12, null, 98 }); scatter.Rows.Add(new object[] { 5, null, 53 }); this.GVScatterChart1.GviTitle = "Age vs Weight Comparison"; GoogleChartsNGraphsControls.TrendLine trend = new GoogleChartsNGraphsControls.TrendLine() { Color = Color.MediumPurple, Opacity = 0.4f, LineWidth = 10, VisibleInLegend = true, LabelInLegend = "Trend Line", Type = GoogleChartsNGraphsControls.TrendLineType.Exponential }; this.GVScatterChart1.GviTrendLine = new GoogleChartsNGraphsControls.TrendLine[] { trend }; //this.GVScatterChart1.GviHAxis = "{title: 'Age', minValue: 0, maxValue: 15}"; GoogleChartsNGraphsControls.hAxis hx = new GoogleChartsNGraphsControls.hAxis(); hx.Title = "Child Age"; hx.ShowTextEvery = 1; hx.SlantedText = true; //this.GVScatterChart1.GviVAxis = "{title: 'Weight', minValue: 0, maxValue: 100}"; this.GVScatterChart1.GviHAxisClass = hx; GoogleChartsNGraphsControls.Animation an = new GoogleChartsNGraphsControls.Animation(GoogleChartsNGraphsControls.AnimationEasing.InAndOut, 1000); this.GVScatterChart1.GviAnimationClass = an; this.GVScatterChart1.DataSource = scatter; }