russ_uk Posted July 31, 2007 Report Share Posted July 31, 2007 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 More sharing options...
Frank Posted July 31, 2007 Report Share Posted July 31, 2007 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 More sharing options...
russ_uk Posted August 1, 2007 Author Report Share Posted August 1, 2007 Hi Frank, The actual chart is correct but the colours do not blend into each other as shown in the Surface and Comtour Plots example in the Chart FX 2005 Resource Center like this Link to comment Share on other sites More sharing options...
Frank Posted August 1, 2007 Report Share Posted August 1, 2007 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 More sharing options...
russ_uk Posted August 2, 2007 Author Report Share Posted August 2, 2007 Thanks Frank the AlternateColor waas just what I was looking for. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.