问题原因可能是因为没有正确地传递注释字段,可以通过以下代码修改:
List
var newAnnotation = new Annotations(); newAnnotation.X = "Jan"; newAnnotation.X2 = "Mar"; newAnnotation.FillColor = "#B3F7CA"; newAnnotation.BorderColor = "#4CAF50"; newAnnotation.Opacity = 0.9; newAnnotation.Label = new Label(){ BorderColor ="#4CAF50", Style = new Style(){ BackgroundColor ="#4CAF50", FontSize ="12px", Color ="#fff", Padding = "5px" }, Text = "Annotation Text", Position = "top", OffsetY = 5 };
annotationsList.Add(newAnnotation);
以上代码中的注释是在图表中创建一个矩形区域,标签位于其上方。根据需要,可以调整注释字段以更合适地满足需求。