You'll have to do it through the C# code. Cause a postback where you change the data points. Since it is just an image, the image has to be regenerated.
So, have a textbox that autopostsback and then change the value in the datapoints on your series and the image will be regenerated.
I have done it like this code and its working well.thank you I am beginner and I just ask for understanding I am not Developer so if there is anything you find wrong out of me them please guide me.
Thanks
private void Form1_Load(object sender, EventArgs e)
{
bmpDrawingArea = new Bitmap(Width, Height);
graphDrawingArea = Graphics.FromImage(bmpDrawingArea);
}
private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
e.Graphics.DrawImage(bmpDrawingArea, 0, 0);
}
private void btnGenerate_Click(object sender, EventArgs e)
{
int monday = int.Parse(this.txtMonday.Text);
int tuesday = int.Parse(this.txtTuesday.Text) ;
int wednesday = int.Parse(this.txtWednesday.Text);
int thursday = int.Parse(this.txtThursday.Text);
int friday = int.Parse(this.txtFriday.Text);
graphDrawingArea.Clear(this.BackColor);
graphDrawingArea.DrawRectangle(new Pen(Color.Red), this.txtMonday.Left + 5, 280 - monday, 40, monday);
graphDrawingArea.DrawRectangle(new Pen(Color.Blue), this.txtTuesday.Left + 5, 280 - tuesday, 40, tuesday);
graphDrawingArea.DrawRectangle(new Pen(Color.Yellow), this.txtWednesday.Left + 5, 280 - wednesday, 40, wednesday);
graphDrawingArea.DrawRectangle(new Pen(Color.Green), this.txtThursday.Left + 5, 280 - thursday, 40, thursday);
graphDrawingArea.DrawRectangle(new Pen(Color.Maroon), this.txtFriday.Left + 5, 280 - friday, 40, friday);
graphDrawingArea.DrawRectangle(new Pen(Color.Black), 10, 280, Width, 1);
Invalidate();
}
private void txtChangeValue_TextChanged(object sender, EventArgs e)
{
txtMonday.Text = ((TextBox)sender).Text;
}
private void txtMonday_TextChanged(object sender, EventArgs e)
{
txtChangeValue.Text = ((TextBox)sender).Text;
}