I've been thinking about it for a few days and couldn't find a solution, so I'm asking for help.
This chart displays product weight values.
In this chart, I want to draw a line according to the change condition of the maximum and minimum criteria.
In this chart, there is no problem in drawing lines without changing based on the minimum and maximum settings.
However, if the min and max values are changed in the middle, I want to draw a new line based on that criteria.
foreach (DataRow row in dataTable.Rows)
{
lineSeries4.DataPoints.Add(new CategoricalDataPoint(double.Parse(row["PRODUCT WEIGHT"].ToString()), row["REC.TIME"].ToString()));
}
radChartView.Series.Add(lineSeries4);
// x축 라벨
CategoricalAxis categoricalAxis = radChartView.Axes[0] as CategoricalAxis;
categoricalAxis.LabelInterval = dataTable.Rows.Count / 5;
// y축 라벨
LinearAxis verticalAxis = radChartView.Axes[1] as LinearAxis;
verticalAxis.MajorStep = 0.200;
verticalAxis.Maximum = double.Parse(sValue[2]) + 0.1;
verticalAxis.Minimum = double.Parse(sValue[1]) - 0.5;
//verticalAxis.LabelInterval = 2;
verticalAxis.LabelFormat = "{0:F3}";
// 눈금 표현
CartesianArea area = radChartView.GetArea<CartesianArea>();
area.ShowGrid = true;
CartesianGrid grid = area.GetGrid<CartesianGrid>();
grid.DrawHorizontalFills = true;
grid.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Solid;
// max
CartesianGridLineAnnotation annotation1 = new CartesianGridLineAnnotation();
annotation1.Axis = radChartView.Axes[1] as CartesianAxis;
annotation1.Value = double.Parse(sValue[2]);
annotation1.BorderColor = Color.Red;
annotation1.BorderDashStyle = DashStyle.Solid;
annotation1.BorderWidth = 1;
annotation1.Label = sValue[2];
radChartView.Annotations.Add(annotation1);
// average
CartesianGridLineAnnotation annotation2 = new CartesianGridLineAnnotation();
annotation2.Axis = radChartView.Axes[1] as CartesianAxis;
annotation2.Value = double.Parse(sValue[0]);
annotation2.BorderColor = Color.Blue;
annotation2.BorderDashStyle = DashStyle.Solid;
annotation2.BorderWidth = 1;
annotation2.Label = sValue[0];
radChartView.Annotations.Add(annotation2);
// min
CartesianGridLineAnnotation annotation3 = new CartesianGridLineAnnotation();
annotation3.Axis = radChartView.Axes[1] as CartesianAxis;
annotation3.Value = double.Parse(sValue[1]);
annotation3.BorderColor = Color.Green;
annotation3.BorderDashStyle = DashStyle.Solid;
annotation3.BorderWidth = 1;
annotation3.Label = sValue[1];
radChartView.Annotations.Add(annotation3);