Increase the Line Chart width via code in SSRS

Applies to: Nevron Chart for Reporting Services (SSRS 2005 and 2008)

How to increase the Line Chart width via code in SSRS?

In Nevron Chart for SSRS you can control the width of Line Charts directly through the designer UI. However, sometimes you may have to configure the Line Chart width by using custom code. The following code example demonstrates how to set the Line Series Stroke Style (border style) to 2 points.

[C#]

using System;
using System.Collections.Generic;
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)
        {
            NChart chart = context.Document.Charts[0];
 
            foreach (NSeriesBase series in chart.Series)
            {
                NLineSeries line = series as NLineSeries;
                if (line != null)
                {
                    line.BorderStyle.Width = new NLength(2);
                }
            }
        }
    }
}


Article ID: 217, Created On: 5/7/2012, Modified: 5/7/2012