Question: Using C#, modify from previous homework to add two radio button so we can choose either Bar Chart or Pie Chart. Also add a combo

Using C#, modify from previous homework to add two radio button so we can choose either Bar Chart or Pie Chart. Also add a combo box with Monday, Tuesday, Wednesday, Thursday, and Friday. Add a textbox so you can add amount of sales on a particular day. When you click change, the corresponding elemeent of the array sales will be changed and bar or pie chart will change accordingly. You should still use an array sales to hold sales for each weekday.

You will get 2 point bonus if you display a percentage for each weekday. Using C#, modify from previous homework to add two radio button sowe can choose either Bar Chart or Pie Chart. Also add a

This is what I currently have:

using System.Drawing; using System.Windows.Forms; public class DrawBars : Form { private int[] sales = { 40000, 20000, 35000, 20000, 10000 }; private Brush[] colors = { Brushes.Blue, Brushes.Red, Brushes.Yellow, Brushes.Green, Brushes.Gold }; private Font arialBold24 = new Font("Arial", 24, FontStyle.Bold); private string [] weekday = { "MON", "TUES", "WED", "THUR", "FRI" }; public DrawBars() { Size = new Size(500,500); Text = "Draw and Fill"; BackColor = Color.White; } protected override void OnPaint(PaintEventArgs e){ Graphics g = e.Graphics; displayBars(g);

base.OnPaint(e); } private void displayBars(Graphics g) { int startX=50; int startY=100;

int gap=20; int height=(int)g.MeasureString ("MON", arialBold24).Height; int w = (int)g.MeasureString ("TUES", arialBold24).Width; for(int i=0;i

startY=startY+gap+height; } } public static void Main() { Application.Run( new DrawBars() ); } }

Draw and Fill Bar Chart O Pie Chart ?| |80000 Change MON TUES WED THUR FRI

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!