Cummulative line chart


Author
Message
Shawn Haggett
Shawn Haggett
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)
Group: Forum Members
Posts: 6, Visits: 1
Hi, I'm trying to build a chart and I'm not sure if it will be possible in Nevron Chart for Sharepoint. My data consists of a set of values and dates, i.e.:

1: Jan, 2
2: Jan, 1
3: Jan, 4
4: Feb, 2
5: Mar, 5
6: Mar, 2

Currently I am grouping my month, so I have month on the X-axis and total for that month on the Y axis (so the line goes up and down for each month, depending on the total for that month). What I would like to do is still have months on the X-axis, but have the line showing the cummulative total up until that point (i.e. the line will only ever go up).

Thanks
Reply
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
Hi Shawn,

Currently you can do that with code injection. Go to the Code - Code Editor Page and paste this code:

using System;
using System.Drawing;

using Nevron.GraphicsCore;
using Nevron.Chart;
using Nevron.ReportingServices;

namespace MyNamespace
{
///
/// Sample class
///

public class MyClass
{
///
/// Main entry point
///

///
public static void RSMain(NRSChartCodeContext context)
{
if (context.Document.Charts.Count == 0)
return;

// get the first chart in the document
NChart chart = context.Document.Charts[0];
if (chart.Series.Count == 0)
return;

// get the first line series in the chart
NSeries series = chart.Series[0] as NSeries;
if (series == null)
return;

// make the totals
int count = series.Values.Count;
double total = 0;

for (int i = 0; i < count; i++)
{
double value = (double)series.Values[i];
if (Double.IsNaN(value))
continue;

total = total + value;
series.Values[i] = total;
}
}
}
}

It will implemented the total calculation for first series in almost all charting types (Bar, Line, Area etc.)

Best Regards,
Nevron Support Team


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search