Posted 9 March 2018, 5:47 pm EST
Hi,
In ASP.NET MVC FlexChart Line Chart, how can I add a horizontal line at a specific value? I need to add upper limit line and lower limit line in my chart.
Thank you
Forums Home / ComponentOne / ASP.NET MVC Edition
Posted by: josh.nguyen on 9 March 2018, 5:47 pm EST
Posted 9 March 2018, 5:47 pm EST
Hi,
In ASP.NET MVC FlexChart Line Chart, how can I add a horizontal line at a specific value? I need to add upper limit line and lower limit line in my chart.
Thank you
Posted 12 March 2018, 12:25 am EST
Hi,
You can use Annotation to create limit lines.
http://demos.componentone.com/ASPNET/MVCExplorer/FlexChart/Annotation
Example:
@(Html.C1().FlexChart().Id("anChart").Bind(fbData)
.AddAnnotationLayer(layer =>{
layer.Id("LimitLineLayer");
layer.AddLine(
line =>
line.Name("highLine").Attachment(AnnotationAttachment.DataCoordinate)
.Start(new DataPoint(new DateTime(2014, 4, 10), 59.16)).End(new DataPoint(new DateTime(2016, 4, 10), 59.16))
.Style(style => style.Fill("#000000").Stroke("#000000").StrokeWidth(1)).Tooltip("High"));
line =>
line.Name("lowLine").Attachment(AnnotationAttachment.DataCoordinate)
.Start(new DataPoint(new DateTime(2014, 4, 10), 59.16)).End(new DataPoint(new DateTime(2016, 4, 10), 59.16))
.Style(style => style.Fill("#000000").Stroke("#000000").StrokeWidth(1)).Tooltip("Low"));
}))
~nilay
Posted 12 March 2018, 2:26 am EST
Awesome. Thank you!