Page 1 of 1

Smudged colors on surface.

Posted: Tue Sep 13, 2005 2:09 pm
by 9527947
Hello,

I have two screenshots of surfaces using TeeChart and another control. These screenshots have been sent to the steema.public.attachments newsgroup. Screenshots display the same information, using the same palette. As you can see on screenshots, the visual results are not the same. I would like to reproduce the original results using TeeChart. Is there a property to get the clearly visible “horizontal” palette colors? If there isn’t, how can I closely approximate that visual effect?

Thank you,
Alex

Posted: Fri Sep 16, 2005 3:01 pm
by Pep
Hi Alex,

most likely you've to set the palette colors in reverse order, then you should get the same results, have you tried ?

Posted: Fri Sep 16, 2005 5:47 pm
by 9527947
Hi Pep,

You are right, the palette is reversed. But that is besides the point. The problem is that there are some colors that are VERTICALLY parallel to each other. On my screenshot you can see that the “large bump” is colored yellow, light blue and dark blue at the same heights. As you can see on the original screenshot using a different control, there’s a single color at any particular height.

Another question: Is there a way to “cut” part of surface that extends past an Axis. That is, if I set Axis.Automatic to False, how can I display only that part of the surface that fits into volume bounded by the Axes? I cannot simply ignore points that don’t fit into this range, because that would alter shape of the surface.

Thank you,
Alex

Posted: Tue Sep 27, 2005 9:42 am
by Marc
Hello Alex,

TeeChart paints the cell of a Surface datapoint in the color that equates to the maximum y value of that cell. If cells span several 'y values' that may result in the effect of interlacing the color range across the data instead of painting steady banded colours as your example does. The effect can be reduced by adding more data values as the cells will become smaller and the interlacing less marked.

Re. “cut” part of surface
That is not inherently dealt with when a Surface is constructed, something we should take a look at. You can cut the Series by setting the Axis minimum with SetMinMax but the result when viewing the Series, even if the Walls are not transparent is to see the whole Series painted, with the part corresponding to outside of the Axis boundaries plotted there.

An alternative would be to make datapoints transparent if they lay outside the boundaries.

eg. (To test this set TChart.Axis.Bottom.SetMinMax(xMin,xMax) to values that cut the Axis scale ..or load the Chart as usual and scroll the Chart data using the right MouseButton)

Here applying to a Left-Cut data segment, extrapolate to apply to other Axes.

Code: Select all

 (Visual Basic)
Private Sub TChart1_OnSeriesBeforeDrawValues(ByVal SeriesIndex As Long)
  With TChart1.Series(0)
    For i = 0 To .Count - 1
        If .XValues.Value(i) < TChart1.Axis.Bottom.Minimum Then
          .PointColor(i) = clNone
        Else
          .PointColor(i) = .asSurface.GetSurfacePaletteColor(.YValues.Value(i))
        End If
    Next i
  End With
End Sub
I hope that may be of help.

Regards,
Marc Meumann

Posted: Tue Sep 27, 2005 5:11 pm
by 9527947
Hi Marc,

Thank you for your help. As you've suggested I will try to produce more points to avoid color interlacing.

I tried your solution for "cutting" the surface. Making points transparent hasn't worked. As soon as .Aspect.OpenGL.Active is set to True, all surface parts are visible again.

Thank you,
Alex

Posted: Thu Sep 29, 2005 2:30 pm
by 9527947
Hello Marc,

Unfortunately, adding more points to surface to separate colors will not work for me. The number of points that I would have to add can differ from row to row, which is impossible given the NumXValues surface dimension. Going ahead and adding points anyway makes a surface with "holes", as on screenshot sent to attachments newsgroup.

Alex

Posted: Tue Oct 04, 2005 1:23 pm
by Marc
Hello Alex,

I don't think we'll be able to offer you a short term solution for the colour banding requirement. We'll take a look if there is a modification we could make to the Surface Series for a future version. Please note there is a Surface property called Irregular Grid that is designed to help plots for non-regular points.

With respect to cutting points, yes true, in OpenGL the points remain visible. The Surface Brush applies to all points of the Series so changing that to transparent won't help either. Only one option that occurs to me is if the background of your Charts is black. Not an ideal solution but you could try setting the Point colour to black instead of clNone.

eg.

Code: Select all

If .XValues.Value(i) < TChart1.Axis.Bottom.Minimum Then
  .PointColor(i) = vbBlack  'or TChart1.Panel.Color
Else
  .PointColor(i) = .asSurface.GetSurfacePaletteColor(.YValues.Value(i))
End If
Regards,
Marc Meumann

Posted: Tue Oct 04, 2005 2:24 pm
by 9527947
Hello Marc,

It would be great if such modification was added.

I also noticed that the ColorGrid series is basically a Surface series viewed from above. Will this potential change also affect the ColorGrid? I am using ColorGrid series as well. The displayed chart is satisfactory, but I cannot tell how accurate it is. Maybe the color banding issue also affects ColorGrid?

Thank you,
Alex

Posted: Mon Oct 10, 2005 5:49 pm
by Marc
Hello Alex,

It is unlikely that the ColorGrid Series might receive the kind of colour banding modification described in early stages of its development, as the Series, although similar to Surface in some respects, does have an extra level of complexity that makes it difficult to generically apply a 3D Series modification.

Regards,
Marc Meumann