Using following code I am able to configure bar styles as needed.
Would like assistance on code to change Timeline axis to reflect hours, when Start and End dates are only 1-2 days
Thanks for your assistance so far, been good learning experience with your product
using System;
using System.Drawing;
using Nevron.GraphicsCore;
using Nevron.Chart;
using Nevron.ReportingServices;
using System.Drawing.Drawing2D;
namespace MyNamespace
{
/// <summary>
/// Sample class
/// </summary>
public class MyClass
{
/// <summary>
/// Main entry point
/// </summary>
/// <param name="context"></param>
public static void RSMain(NRSChartCodeContext context)
{
NChart chart = context.Document.Charts[0];
HatchStyle hatch = new HatchStyle();
Color backcolor = new Color();
//Dictionary<string, NFillStyle> prefixToFill = new Dictionary<string, NFillStyle>();
//prefixToFill.Add("Documentation", new NHatchFillStyle(hatch, Color.White, Color.CadetBlue));
//prefixToFill.Add("Testing", new NHatchFillStyle(hatch, Color.White, Color.Green));
foreach (NFloatBarSeries bar in chart.Series)
{
for (int i = 0; i < bar.Values.Count; i++)
{
String label = (String)bar.Labels[i];
String wtype = label.Substring(0, 2);
String priority = label.Substring(2, 1);
String rg = label.Substring(3, 1);
String appr = label.Substring(4, 3);
if (appr=="APP")
hatch = HatchStyle.ForwardDiagonal;
else if (appr=="WSC")
hatch = HatchStyle.LightVertical;
else if (appr=="SCH")
hatch=HatchStyle.LightVertical;
else
hatch=HatchStyle.LightVertical;
if (wtype == "PM")
{ backcolor = Color.Green; }
else if (wtype =="OP")
{ backcolor= Color.Blue;}
else if (wtype=="EN")
{backcolor = Color.Orange;}
else if (wtype == "CM")
{ if (priority =="1")
{backcolor = Color.Red; }
else
{backcolor = Color.Tan;}
}
bar.FillStyles[i] = new NHatchFillStyle(hatch, Color.White, backcolor);
}
}I
}
}
}