Hello,
I created a Grid Series 3D Surface diagram and would like draw contour lines. The lines should be drawn to a particular Y value.
I also want to determine the color and the width of the lines themselves.
How can I realize this?
Draw contour lines in surface grid series 3D chart
Moderator: Queue Moderators
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Draw contour lines in surface grid series 3D chart
Use ContourPalette of surface series. Each step in the palette represents a pair of color and Y value.
Then it uses a palette fill, and black contour line in the Y position of each palette step.
If you want to show palette-colored contour lines instead, use a single tone color fill, and select ContourLineType = PalettedLine:
Different contouring and fill styles can be seen quickly at http://www.arction.com/download/lightni ... manual.pdf, page 129 onwards.
Code: Select all
ValueRangePalette vrp = new ValueRangePalette(gridSeries);
vrp.Steps.Clear();
vrp.MinValue = 0;
vrp.Steps.Add(new PaletteStep(vrp, Color.Reds, 0));
vrp.Steps.Add(new PaletteStep(vrp, Colors.Yellow, 30));
vrp.Steps.Add(new PaletteStep(vrp, Colors.Lime, 60));
vrp.Steps.Add(new PaletteStep(vrp, Colors.White, 100));
gridSeries.ContourPalette = vrp;
//Hide the wireframe so it doesn't disturb here
gridSeries.WireframeType = SurfaceWireframeType.None;
gridSeries.ContourLineType = ContourLineType.ColorLine;
gridSeries.ContourLineColor = Colors.Black;
gridSeries.Fill = SurfaceFillStyle.Paletted;
Code: Select all
gridSeries.ContourLineType = ContourLineType.PalettedLine;
gridSeries.Fill = SurfaceFillStyle.Toned;
gridSeries.ContourLineWidth = 3f;
gridSeries.ToneColor = Colors.White;
Different contouring and fill styles can be seen quickly at http://www.arction.com/download/lightni ... manual.pdf, page 129 onwards.
LightningChart Support Team, PT
Re: Draw contour lines in surface grid series 3D chart
Unfortunately I have the problem that I want to show very different contour values, as I have stated in the "Value Range range," also will get a different color each contour line.
Compilation of the "Value Range range":
These steps are needed for a beautiful display, but will not be displayed as contour lines.
As contour lines are 3 values are shown, A Min-an average and a maximum value.
How can I implement this?
I have her example, Try to my 3D chart, but I get the following display:
PS: The display of the 3D chart looks at redrawing of exactly like the picture, even without contour lines. Without contour lines, it looks like this: Why?
Compilation of the "Value Range range":
Code: Select all
double averageValue = (rangeMaxValue - rangeMinValue) / 2.0 + rangeMinValue;
double stepValue = (rangeMaxValue - rangeMinValue) / 6.0;
palette.Steps.Clear();
palette.MinValue = rangeMinValue;
palette.Type = PaletteType.Gradient;
palette.Steps.Add(new PaletteStep(palette, Color.Transparent, -1));
palette.Steps.Add(new PaletteStep(palette, Color.Black, 0));
palette.Steps.Add(new PaletteStep(palette, Color.Blue, stepValue));
palette.Steps.Add(new PaletteStep(palette, Color.Teal, stepValue * 2));
palette.Steps.Add(new PaletteStep(palette, Color.LimeGreen, averageValue));
palette.Steps.Add(new PaletteStep(palette, Color.Yellow, stepValue * 4));
palette.Steps.Add(new PaletteStep(palette, Color.Red, stepValue * 5));
palette.Steps.Add(new PaletteStep(palette, Color.White, rangeMaxValue));
As contour lines are 3 values are shown, A Min-an average and a maximum value.
How can I implement this?
I have her example, Try to my 3D chart, but I get the following display:
PS: The display of the 3D chart looks at redrawing of exactly like the picture, even without contour lines. Without contour lines, it looks like this: Why?
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Draw contour lines in surface grid series 3D chart
Because I don't have all your code, I can't say what's the problem related to black-white picture.
So you are trying to render the surface with a gradient palette, consisting of 9 steps? And then use 3 contour lines in that? LightningChart can render contour lines only in the step positions, so that would mean 9 contour lines.
To achieve gradient fill of 9 steps, and 3 contour line levels, use two surfaces (with same data).
Surface 1:
Fill = Paletted
ContourLineType = None
ContourPalette: your 9 steps here
Surface 2:
Fill = None
ContourLineType = PalettedLines
ContourPalette: 3 contour levels
That way you should get the result you are looking for.
So you are trying to render the surface with a gradient palette, consisting of 9 steps? And then use 3 contour lines in that? LightningChart can render contour lines only in the step positions, so that would mean 9 contour lines.
To achieve gradient fill of 9 steps, and 3 contour line levels, use two surfaces (with same data).
Surface 1:
Fill = Paletted
ContourLineType = None
ContourPalette: your 9 steps here
Surface 2:
Fill = None
ContourLineType = PalettedLines
ContourPalette: 3 contour levels
That way you should get the result you are looking for.
LightningChart Support Team, PT
Re: Draw contour lines in surface grid series 3D chart
I solved the problem, had passed the wrong object in the allocation of "ValueRangeRange".
Thanks for the help.
Thanks for the help.