Profile Picture

Display the z value as a colorscale

Posted By Leonardo Rocha 12 Years Ago
Author
Message
Leonardo Rocha
questionmark Posted 12 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: Forum Members
Last Active: 12 Years Ago
Posts: 7, Visits: 1
How can I display the Z value in a 2D scatter chart as a color value in a colorscale? Should I extend NDataPoint?

Leonardo Rocha
Posted 12 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: Forum Members
Last Active: 12 Years Ago
Posts: 7, Visits: 1
Just to clarify the question:

I have a 2D plot and want to add different colors to a third attribute, that can be the Z value or not. In the examples for Point chart (Standard Point example), it's possible to have different colors for each point, but based on the value property only in an ordinal scale. I want to use the x and y values and have the a third value display as a color in custom color scale.

I've been trying to extend the NRuleApplicator class and override the Apply method, put I can only go down to the NPointSeries type for NChartElement, which means that I can setup a single NFillStyle for the whole series. The NFillStile was extended to get the color scale color based on a index property to it.

Leonardo Rocha
Posted 12 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: Forum Members
Last Active: 12 Years Ago
Posts: 7, Visits: 1
Why the following code does not work? if the X and Y are set, why not the other properties?

for (int i = 0; i < length; i++)
{
NDataPoint dataPoint = new NDataPoint();
NColor color = this.colorScale.GetColor(this.zLog[i]);
dataPoint[DataPointValue.Color] = color;
dataPoint[DataPointValue.FillStyle] = new NColorFillStyle(color);
dataPoint[DataPointValue.StrokeStyle] = new NStrokeStyle(1, color);
dataPoint[DataPointValue.Y] = this.yLog[i];
dataPoint[DataPointValue.X] = this.xLog[i];
series.AddDataPoint(dataPoint);
}

Nevron Support
Posted 12 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: 2 days ago @ 1:54 AM
Posts: 3,054, Visits: 4,009

Hi Leonardo,

That code is Ok - most likely you apply a chart palette later in the code that overrides the settings for color...



Best Regards,
Nevron Support Team



Leonardo Rocha
Posted 12 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: Forum Members
Last Active: 12 Years Ago
Posts: 7, Visits: 1
I found the problem: enabling the cluster mode disables the fill style for each point.

Rgds,

LEo

Nevron Support
Posted 12 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: 2 days ago @ 1:54 AM
Posts: 3,054, Visits: 4,009

Hi Leonardo,

Yes - that's true - in this mode all individual settings for points are ignored as the resulting point is an approximation of serveral points.



Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic