Diffrent Colors in bubblecharts for a specific listvaluerange


https://www.nevron.com/Forum/Topic3148.aspx
Print Topic | Close Window

By Christopher Gilbreath - 14 Years Ago

Hello again Nevron-Support-Team,

we've got a bubblechart based on a SharePoint-list. Now we'd like to set different colors to single bubbles with a valuerange in the list. For example you have 3 colors and 9 values like:

Yellow   | 1 - 3
Red       | 4 - 6
Green    | 7 - 9

We couldn't find a way to realise it yet.
In case that's possible: can you help us to fix this problem.

Best regards

Christopher Gilbreath 

By Nevron Support - 14 Years Ago
Hi Christopher,

Currently that is not possible, however the new version that we are going to release hopefully this week, will have C# and VB.NET code injection, which will help you achieve this by code (please let us know if you would like to receive a code snipped). The C#/VB.NET code that is executed is again directly edited in browser, and you can use the full Nevron Chart for .NET API without the need to deploy/administer anything.

We are also considering to increase the places where expressions can be placed in both the Nevron Chart for SSRS and SharePoint and as a part of this major enhancement, most of the settings in both components (and the respective gauges), will provide this feature "out of the box". However these are expected in the second half of this year (probably aligned with the Map for SSRS and SharePoint) that we are working on.
By Nevron Support - 14 Years Ago
Hi Christopher,

You can inject this code to achieve your color coding requirements (paste it in the Code - Code Editor page):

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 series in the chart
NSeries series = chart.Series[0] as NSeries;
if (series == null)
return;

// colorize it
int count = series.Values.Count;
double total = 0;

for (int i = 0; i < count; i++)
{
if (i < 3)
{
series.FillStyles[i] = new NColorFillStyle(Color.Yellow);
}
else if (i < 6)
{
series.FillStyles[i] = new NColorFillStyle(Color.Red);
}
else if (i < 9)
{
series.FillStyles[i] = new NColorFillStyle(Color.Green);
}
else
{
// do nothing to use default colors, otherwise simply set another filling
}
}
}
}
}

Hope this helps - questions or comments - please feel free...
By Grey Randall - 14 Years Ago

How about wanting to use a different color other than the standards?

 

I see an option for "KnownArgbColorValue"  but I have yet to see how to enter that value... I've got the values for the colors I need in RGB, CMYK, HSB, Lab and HTML.

By bob milanov - 14 Years Ago
 Hi Gray,

You can use the FromArgb method - for example:
new NColorFillStyle(Color.FromArgb(255, 0, 0));

creates a red filling.

Let me know if you meet any problems.

Best regards,
Bob

By Nevron Support - 11 Years Ago

Hi Christopher,

With the latest version of the Vision for SharePoint web parts, you can use conditional Custom Data Point Appearance.

Take a look at the following forum post: Change the color of a bar if value is above 10

By Nevron Support - 10 Years Ago
Hello Messaoud,
You can achieve your requirement via custom code. However, a better and easier approach would be to use conditional Custom Data Point Appearance. Take a look at the following example: http://spchartexamples.nevron.com/Charting%20Types/Box%20And%20Whiskers%20Chart/Box%20And%20Whiskers%20Chart/default.aspx
By Nevron Support - 10 Years Ago
Hi Messaoud,
You can specify custom data point appearance via expressions - take a look at the Box and Whiskers example -> Pivot -> Data Groupings -> Values -> Appearance