This is my code, if i remove these four lines:
double start = (double)floatBar.BeginValues[floatBar.BeginValues.Count - 1];
double end = (double)floatBar.EndValues[floatBar.BeginValues.Count - 1];
NAxisStripe s1 = chart.Axis(StandardAxis.PrimaryY).Stripes.Add(start, end);
s1.FillStyle = new NColorFillStyle(Color.FromArgb(125, Color.SteelBlue));
The code runs fine and the purple constline gets printed. What I'm actually trying to do is highlight specific values in my series.
using System;
using System.Drawing;
using Nevron.GraphicsCore;
using Nevron.Chart;
using Nevron.ReportingServices;
namespace MyNamespace
{
/// <summary>
/// Sample class
/// </summary>
public class MyClass
{
/// <summary>
/// Main entry point
/// </summary>
/// <param name="context"></param>
public static void RSMain(NRSChartCodeContext context)
{
if (context.Document.Charts.Count == 0)
return;
NChart chart = context.Document.Charts[0];
//Create shift markers
int shiftCount = context.GetInt32Parameter("shiftCount");
for (int i = 1; i < shiftCount; i++)
{
NFloatBarSeries floatBar = chart.Series[0] as NFloatBarSeries;
NAxis yAxis = chart.Axis((int)StandardAxis.PrimaryY);
//NAxisConstLine cl1 = chart.Axis(StandardAxis.PrimaryY).ConstLines.Add();
NAxisConstLine cl1 = yAxis.ConstLines.Add();
cl1.StrokeStyle.Color = Color.Purple;
cl1.StrokeStyle.Width = new NLength(1.5f);
cl1.FillStyle = new NColorFillStyle(new NArgbColor(125, Color.Purple));
cl1.Value = 40569.3;
double start = (double)floatBar.BeginValues[floatBar.BeginValues.Count - 1];
double end = (double)floatBar.EndValues[floatBar.BeginValues.Count - 1];
NAxisStripe s1 = chart.Axis(StandardAxis.PrimaryY).Stripes.Add(start, end);
s1.FillStyle = new NColorFillStyle(Color.FromArgb(125, Color.SteelBlue));
}
}
}