Jump to content
Software FX Community

Question about gradient bar graph


User (Legacy)

Recommended Posts

I want to display like below 3D graph. (see that attached file)

The point is gradient fill bar. The bar color of each data is variable

according to max value(z coordinates) of each x,y coordinates.

For example, if the max value is 10 than the bar color is red, else if the

max value is 5 than the bar color is purple, else if the max value is 1 than

the bar color is blue. So each bar has various colors.

The color of bar can be customized.

Is it possible in Chart FX? If so, please show me the sample code.

TIA.

Link to comment
Share on other sites

Gradients are supported in Chart FX for 6.2.

For example:

chart1.Scheme = Scheme.Gradient;

chart1.Series[0].AlternateColor = Color.Lime;

chart1.Series[0].Color = Color.Red;

Will set a gradient going from Green to Red from bottom to top.

Also, in Chart 6.2 you can assign different attributes to different bars, so

if the condition for this gradient comes from variable, you can assign a

different gradient to each bar, so for example, you can treat Negative bars

differently than positive bars by simply adding what we call a Conditional

Attribute:

chart1.Scheme = Scheme.Gradient;

// Negative values

ConditionalAttributes condition1 = chart1.ConditionalAttributes[0];

condition1.AlternateColor = Color.Lime;

condition1.Color = Color.Red;

condition1.Condition.From = double.NegativeInfinity;

condition1.Condition.To = 0;

// Positive values

ConditionalAttributes condition2 = chart1.ConditionalAttributes[1];

condition2.AlternateColor = Color.Blue;

condition2.Color = Color.Yellow;

condition2.Condition.From = 0;

condition2.Condition.To = double.PositiveInfinity;

chart1.ConditionalAttributes.Recalculate();

--

FP

Software FX

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...