private void marker_for_same_min_max_value()
{
/*
Our previous marker formula has a draw back if max_value = min_value the difference
between max_value- min_value=0 so which present problem
this is solved by this marker assumin in such case the plot is of same color we do this part.
*/
try
{
using (Graphics grp1 = this.CreateGraphics())
{
int x1Axis = (int)(chart1.ChartAreas[0].Position.X + chart1.Width + 10);
int y1Axis = (int)(chart1.ChartAreas[0].Position.Y + chart1.Height);
int x2Axis = x1Axis + 15;
int y2Axis = y1Axis;
double start = min_value;
double value = start;
// double temp_value = (max_value - min_value);
//double increment = 0;
//increment = temp_value / 50;
//decimal val = (Decimal)((value - min_value) / (max_value - min_value));
Pen pen1 = new Pen(Color.FromArgb(0, 255, 0));
//grp1.DrawRectangle(pen1, 958, 537, 15, 15);
grp1.DrawRectangle(pen1, x1Axis, y1Axis, 15, 15);
SolidBrush drawBrushGreen = new SolidBrush(Color.FromArgb(0, 255, 0));
//grp1.FillRectangle(drawBrushGreen, 958, 537, 15, 15);
grp1.FillRectangle(drawBrushGreen, x1Axis, y1Axis, 15, 15);
String drawString = Math.Round(value,0).ToString();
// Create font and brush.
Font drawFont = new Font("Arial", 7);
SolidBrush drawBrush = new SolidBrush(Color.Black);
// Create point for upper-left corner of drawing.
PointF drawPoint = new PointF(x1Axis-12, y1Axis);//--537->520
// Draw string to screen.
grp1.DrawString(drawString, drawFont, drawBrush, drawPoint);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void marker()