|
Group: Forum Members
Posts: 15,
Visits: 78
|
The code I have is as follows
using System; using System.Drawing; using Nevron.GraphicsCore; using Nevron.Chart; using Nevron.ReportingServices; using System.Text.RegularExpressions; namespace MyNamespace { public class MyClass { public static void RSMain(NRSChartCodeContext context) { if (context.document.Charts.Count == 0) return; NChart chart = context.document.Charts[0] as NChart; if (chart == null) return; NRangeSeries range = chart.Series[2] as NRangeSeries; //NStockSeries range = chart.Series[2] as NStockSeries; int dpCount = range.Values.Count; int backColorOffset = 0;
for (int i = 0; i < dpCount; i++) { string strColors = (string)range.Labels[backColorOffset+i]; if (strColors == "") { strColors = "0,0,0"; } char[] delimiterChars = {','}; string[] intColors = strColors.Split(delimiterChars); int[] convertedItems = Array.ConvertAll<string, int>(intColors, int.Parse); Color lineColor = Color.FromArgb(convertedItems[0],convertedItems[1],convertedItems[2]); int lineWidth = 50;
range.FillStyles[i] = new NColorFillStyle(lineColor); range.BorderStyles[i] = new NStrokeStyle(lineWidth, lineColor); } // clean up the chart for (int i = range.Values.Count - 1; i >= dpCount; i--) { range.RemoveDataPointAt(i); } } } }
But what I am saying is not that it doesn't run, but that the width after passing 2 doesnt change. If i change it to 1 and then to 2 i see a difference, but 2 to 3 or 2 to 10 or 2 to 50 shows no change in size.
Using a stock chart I was able to get better widths, but the problem was I couldn't seem to change the colors the same way I am changing them now.
|