Jump to content
Software FX Community

Question about gradient bar graph


User (Legacy)
 Share

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...