Profile Picture

Configure chart properties through code for Multiple Chart Area charts

Posted By Brian Dalwood 11 Years Ago

Configure chart properties through code for Multiple Chart Area charts...

Author
Message
Brian Dalwood
Posted 11 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: Forum Members
Last Active: 7 Years Ago
Posts: 6, Visits: 15
Hi,

I have a chart that includes 7 chart areas (each configured as an area chart with 5 data series in each).
I want to be able to configure each of the area charts properties (i.e. No axis labels, data series colours etc.) through code so that I can easily make bulk changes to any property across all charts.

Can you please provide some sample code to get me started accessing the properties of each "Chart Area" chart.

Thanks

Nevron Support
Posted 11 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009

Hi Brian,

The following code shows how to iterate trough all charts and series in a chart document:


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)
  {
   for (int i = 0; i < context.Document.Charts.Count; i++)
   {
    NChart chart = context.Document.Charts[i];
    
    // do something with chart
    
    for (int j = 0; j < chart.Series.Count; j++)
    {
     NSeries series = (NSeries)chart.Series[j];
     
     // do something with series
    }
   }
  }
 }
}

Hope this helps - let us know if you require something more specific...



Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic