Jump to content
Software FX Community

Surface Chart Colour Issues


russ_uk
 Share

Recommended Posts

Hi,

I'm having problems enabling the correct colouring on a surface chart.  No matter what options I try the chart only displays two tones of colour and the colours do not fade into each other.

<code>

 Chart1.Data.Series = 5;

Chart1.Data.Points = 10;

Chart1.Gallery = ChartFX.WebForms.Gallery.Surface;

((ChartFX.WebForms.Galleries.

Surface)Chart1.GalleryAttributes).Step = 1;((ChartFX.WebForms.Galleries.Surface)Chart1.GalleryAttributes).ShowContourLines=true;((ChartFX.WebForms.Galleries.Surface)Chart1.GalleryAttributes).Colors = new System.Drawing.Color[] { System.Drawing.Color.Yellow, System.Drawing.Color.Red, System.Drawing.Color.AliceBlue };

 

Chart1.View3D.Depth = 80;

Chart1.View3D.Enabled = true;

Chart1.View3D.AngleX = 30;

Chart1.AxisY.ScaleUnit = 1;

Chart1.AxisY.Step = 1;

//Chart1.AxisY.MinorStep = 0.1;

//Axis Y Min and Max

Chart1.AxisY.Min = 0;

Chart1.AxisY.Max = 15;

 

int s = 0;for (s = 0; s < 5; s++)

{

Chart1.Data[s, 0] = 0;

Chart1.Data[s, 1] = 0;

Chart1.Data[s, 2] = 0;

Chart1.Data[s, 3] = 0;

// Chart1.Data[s, 4] = 0;

Chart1.Data[s, 5] = 0;

Chart1.Data[s, 6] = 0;

Chart1.Data[s, 7] = 0;

Chart1.Data[s, 8] = 0;

Chart1.Data[s, 9] = 0;

}

Chart1.Data[0, 4] = 1;

Chart1.Data[1, 4] = 2;

Chart1.Data[2, 4] = 3;

Chart1.Data[3, 4] = 4;

Chart1.Data[4, 4] = 5;

 

 

</code> 

 Do you have any code examples available for surface charts?

 I have tried with and without this line;

((ChartFX.WebForms.Galleries.Surface)Chart1.GalleryAttributes).Colors = new System.Drawing.Color[] { System.Drawing.Color.Yellow, System.Drawing.Color.Red, System.Drawing.Color.AliceBlue };

 

Link to comment
Share on other sites

When I pasted this code in the Form_Load of a default chart I obtained the attached image. Which is what I expected.

Please provide more details of what you are doing to this chart or, better yet, a complete Web Form that reproduces the problem.

I am running the latest Chart FX Service Pack available from our support site.

Link to comment
Share on other sites

The chart I pasted is the intended output for the settings provided (3 colors).

You can provide more colors if you want better resolution.

In order to achieve something like the chart in your attachment, you will need to provide more colors in the array. Several blues, several greens, etc.

Another way to achieve more subtle color transitions is to not set an array of colors but leave Chart FX to interpolate between two colors: Series[0].Color and Series[0]..Alternate.

For example:

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

chart1.Series[0].AlternateColor =

Color.Red;

Using this approach, you will not be able to control the colors in between.

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...