private void Redraw() { TxtNumber.Text = Counter.ToString(); TxtEstimate.Text = CalculatedPi.ToString(); PieGraph.Draw(); //Thread.Sleep(50) }
private Image GetPieGraph() { RandomUtil ru = new RandomUtil(); PieGraph pg = new PieGraph(this.Size); pg.Color = Color.White; pg.ColorGradient = Color.Orange; Legend legend = new Legend(this.Width, 70); legend.Text = String.Empty; pg.Text = _displayString + " Total: " + _totalComponents.ToString(); ICollection keys = _componentInfoTable.Keys; IEnumerator ie = keys.GetEnumerator(); while (ie.MoveNext()) { Type key = (Type)ie.Current; ComponentInfo ci = (ComponentInfo)_componentInfoTable[key]; PieSlice ps = new PieSlice(ci.Count, ci.Color); pg.Slices.Add(ps); LegendEntry le = new LegendEntry(ci.Color, ci.Type.Name.ToString().Trim()); legend.LegendEntryCollection.Add(le); } return(GraphRenderer.DrawGraphAndLegend(pg, legend, this.Size)); }
protected override void OnBindingContextChanged() { if (Model == null) { return; } UpdateCalendarGraph(); PieGraph.Title = AppResources.TestStatusPieGraphScore; PieGraph.Members = new List <PieGraphView.PieItem>() { new PieGraphView.PieItem() { Color = new SkiaSharp.SKColor(0x52, 0xb2, 0xff), Rate = (float)Model.Total.AnswerCountCorrectRate }, new PieGraphView.PieItem() { Color = new SkiaSharp.SKColor(0xe8, 0x6d, 0x6b), Rate = (1 - (float)Model.Total.AnswerCountCorrectRate) } }; PieGraph.InvalidateSurface(); base.OnBindingContextChanged(); }
private void frmGraph_Load(object sender, EventArgs e) { DataTable dt = new DataTable(); dt.Columns.Add("column1"); dt.Columns.Add("column2"); dt.Columns.Add("column3"); dt.Rows.Add(1, "Name1", 6); dt.Rows.Add(2, "Name2", 4); dt.Rows.Add(3, "Name3", 6); PieGraph pg = new PieGraph(); pg.GraphColors = "5566AA"; pg.GraphHeight = "125"; pg.GraphWidth = "250"; pg.GraphTitle = "Welcome to Test Graph"; pg.GraphTitleColor = "112233"; pg.GraphTitleSize = "20"; pg.dtData = dt; pictureBox1.ImageLocation = pg.GenerateGraph(); // p.dtData = dt; }
private void Redraw() { if (started) { TxtNumber.Text = (number + 1).ToString(); TxtEstimate.Text = (4.0 * CalculatedPie).ToString(); TxtEstimate2.Text = CalculatedE.ToString(); if (number % 10 == 1) { PieGraph.Draw(); eGraph.Draw(); } } }
public static PlainCommonGraph create_plain_graph(PlainGraphType type) { PlainCommonGraph graph; switch (type) { case PlainGraphType.Line: graph = new LineGraph(); break; case PlainGraphType.LinePoint: graph = new LinePointGraph(); break; default: case PlainGraphType.LineArea: graph = new LineAreaGraph(); break; case PlainGraphType.Column: graph = new ColumnGraph(); break; case PlainGraphType.StackedColumn: graph = new StackedColumnGraph(); break; case PlainGraphType.StackedPercentColumn: graph = new StackedPercentColumnGraph(); break; case PlainGraphType.Pie: graph = new PieGraph(); break; //case PlainGraphType.Pie3D: // graph = new Pie3DGraph(); // not support yet // break; //case PlainGraphType.ExplodedPie: // graph = new ExplodedPieGraph(); // not support yet // break; } return(graph); }
public QuizResultPage() { InitializeComponent(); this.BindingContextChanged += (s, e) => { PieGraph.Title = AppResources.StatisticsPieGraphScore; PieGraph.Members = new List <PieGraphView.PieItem>() { new PieGraphView.PieItem() { Color = new SkiaSharp.SKColor(0x52, 0xb2, 0xff), Rate = (float)Model.AnswerCorrectPercentage / 100.0f }, new PieGraphView.PieItem() { Color = new SkiaSharp.SKColor(0xe8, 0x6d, 0x6b), Rate = (1 - (float)Model.AnswerCorrectPercentage / 100.0f) } }; PieGraph.InvalidateSurface(); }; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Create your application here SetContentView(Resource.Layout.PieGraph); PieGraph pg = FindViewById <PieGraph> (Resource.Id.piegraph); //(PieGraph)v.findViewById(R.id.piegraph); PieSlice slice = new PieSlice(); slice.setColor(Color.ParseColor("#99CC00")); slice.setValue(2); pg.addSlice(slice); slice = new PieSlice(); slice.setColor(Color.ParseColor("#FFBB33")); slice.setValue(3); pg.addSlice(slice); slice = new PieSlice(); slice.setColor(Color.ParseColor("#AA66CC")); slice.setValue(8); pg.addSlice(slice); }
private Image GetPieGraph() { RandomUtil ru = new RandomUtil(); PieGraph pg = new PieGraph(this.Size); pg.Color = Color.White; pg.ColorGradient = Color.Orange; Legend legend = new Legend(this.Width, 70); legend.Text = String.Empty; pg.Text = _displayString + " Total: " + _totalComponents.ToString(); ICollection keys = _componentInfoTable.Keys; IEnumerator ie = keys.GetEnumerator(); while (ie.MoveNext()) { Type key = (Type)ie.Current; ComponentInfo ci = (ComponentInfo)_componentInfoTable[key]; PieSlice ps = new PieSlice(ci.Count, ci.Color); pg.Slices.Add(ps); LegendEntry le = new LegendEntry(ci.Color, ci.Type.Name.ToString().Trim()); legend.LegendEntryCollection.Add(le); } return GraphRenderer.DrawGraphAndLegend(pg, legend, this.Size); }