public DataSeriesBox SetLabels(string[] labels, float size)
{
if (this.InvokeRequired)
{
this.Invoke((Action)(() => SetLabels(labels, size)));
return this;
}
var pane = zedGraphControl.GraphPane;
LineItem lineItem = series[0] as LineItem;
for (int i = 0; i < lineItem.Points.Count; i++)
{
var label = new TextObj(labels[i],
lineItem.Points[i].X, lineItem.Points[i].Y + 5);
label.FontSpec.Border.IsVisible = false;
label.FontSpec.Size = size;
label.FontSpec.Fill.IsVisible = false;
label.FontSpec.Angle = 45;
pane.GraphObjList.Add(label);
}
lineItem.Label.IsVisible = true;
zedGraphControl.GraphPane.AxisChange();
return this;
}