Sagrada é a integridade e a razão de o ser.
sexta-feira, 7 de dezembro de 2012
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
int z = 0;
string[] ID = { "JAN", "FEV", "MAR", "ABR", "MAI", "JUN", "JUL", "AGO", "SET", "OUT", "NOV", "DEZ" };
int[] size = { 100, 300, 200, 300, 260, 300, 100, 300, 200, 380, 350, 300 };
// barras
foreach (string k in ID)
{
Label makeLinkLabel = new Label();
makeLinkLabel.Width = 35;
makeLinkLabel.Height = size[z];
makeLinkLabel.Location = new Point(100 + 40 * z, 500 - size[z]);
makeLinkLabel.Name = "lblattach" + Convert.ToString(z);
makeLinkLabel.Text = k.ToString();
makeLinkLabel.BackColor = Color.Red;
this.Controls.Add(makeLinkLabel);
z++;
}
// eixo dos Y
Label makeLinkLabely = new Label();
makeLinkLabely.Width = 2;
makeLinkLabely.Height = 450;
makeLinkLabely.Location = new Point(90,50);
makeLinkLabely.Name = "lbly";
makeLinkLabely.BackColor = Color.Olive;
this.Controls.Add(makeLinkLabely);
// eixo dos x
Label makeLinkLabelx = new Label();
makeLinkLabelx.Width = 550;
makeLinkLabelx.Height = 2;
makeLinkLabelx.Location = new Point(90, 500);
makeLinkLabelx.Name = "lblx";
makeLinkLabelx.BackColor = Color.Olive;
this.Controls.Add(makeLinkLabelx);
// eixos paralelos aos x
for (int i = 1; i <= 4; i++)
{
// linha
Label makeLinkLabelx1 = new Label();
makeLinkLabelx1.Width = 550;
makeLinkLabelx1.Height = 1;
makeLinkLabelx1.Location = new Point(90, 500 - i* 100);
makeLinkLabelx1.Name = "lblx" + Convert.ToString(i);
makeLinkLabelx1.BackColor = Color.Olive;
this.Controls.Add(makeLinkLabelx1);
// escala
Label makeLinkLabelxe1 = new Label();
makeLinkLabelxe1.Location = new Point(50, 490 - i * 100);
makeLinkLabelxe1.Name = "lblxe" + Convert.ToString(i);
makeLinkLabelxe1.Text = Convert.ToString(i * 100);
this.Controls.Add(makeLinkLabelxe1);
}
}
}
}
Subscrever:
Enviar feedback (Atom)
Sem comentários:
Enviar um comentário