Page 1 of 1

want waterfall 3d display show colored lines only

Posted: Mon Feb 10, 2014 9:52 pm
by 9526080
As showing in the attachment waterfall3d.jpg created in c++ with TeeChart, the area under the series are painted.

Code: Select all

long id = ptChart->AddSeries(tchartNS::scWaterfall);
	tchartNS::ISeriesPtr ser = ptChart->Series(id);
	ser->Pen->Visible = false;
	ser->asWaterfall->UsePalette = false;
	ser->asWaterfall->WaterLines->Visible = false;
	ser->asWaterfall->Transparency = 10;
	ser->asWaterfall->Waterfall = true;
	ser->asWaterfall->IrregularGrid = true;
	ptChart->Aspect->Chart3DPercent = 75;
	ptChart->Axis->Depth->Visible = true;
	m_ptChart->Aspect->View3D = TRUE;

	
	
	double x = 0.0;
	_bstr_t b;
	for (int i = 0; i < 500; i++)
		ser->asWaterfall->AddXYZ(i, sin(x + i*0.1), 0.5, b, RGB(0, 0, 255));
	
	x = 2.0;
	for (int i = 0; i < 500; i++)
		ser->asWaterfall->AddXYZ(i, sin(x + i*0.1), 1, b, RGB(0, 255, 255));
	
	x = 3.0;
	for (int i = 0; i < 500; i++)
		ser->asWaterfall->AddXYZ(i, sin(x + i*0.1), 1.5, b, RGB(255, 0, 255));

I would like to remove the shaded paint but keep the colored lines as shown in waterfall-desired.jpg.

How do I achieve effect in waterfall-desired.jpg? I am using c++.

Re: want waterfall 3d display show colored lines only

Posted: Thu Feb 13, 2014 11:09 am
by yeray
Hello,

The images you posted look too different to be compared. The data and the number of series is very different. With so few series the space between them is bigger, ad I'd expect.

I've been doing some tests and I think the best way to draw such a chart is to combine TLineSeries with TSeriesRegionTools.
Here it is the code I used. It's in Delphi but you shouldn't find too much problems to translate it into C++; otherwise let us know.

Code: Select all

uses Series, TeeSeriesRegion;

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  Chart1.Chart3DPercent:=10;
  Chart1.Aspect.OrthoAngle:=60;
  Chart1.Legend.Visible:=false;

  for i:=0 to 34 do
  begin
    with Chart1.AddSeries(TLineSeries) as TLineSeries do
    begin
      Depth:=0;
      Pen.Color:=RGB(Random(256), Random(256), Random(256));

      if i=0 then
        FillSampleValues(1500)
      else
        DataSource:=Chart1[0];
    end;

    with Chart1.Tools.Add(TSeriesRegionTool) as TSeriesRegionTool do
    begin
      Series:=Chart1[i];
      Pen.Visible:=false;
      OriginPen.Visible:=true;
      OriginPen.Color:=Series.Pen.Color;
    end;
  end;
end;
And the result I've obtained:
test.png
test.png (224.63 KiB) Viewed 4872 times

Re: want waterfall 3d display show colored lines only

Posted: Mon Feb 17, 2014 10:00 pm
by 9526080
Yeray, thank you for the reply.

Yes, the images are very different as the waterfall-desired.jpg is from Internet searching. The waterfall3d.jpg is created by me, using data that is not real and only has three series to show clearly the un-wanted shading under the series.

The data that I want to display are spectrum collected in real-time and the horizontal is wavelength, vertical is spectrum intensity, and depth are series of time that the data captured.

From you example, I do not see how I can get the depth be displayed as time series with axis tick marks. Also, not clear about what property/method call to use to remove the shading under the curve.

Re: want waterfall 3d display show colored lines only

Posted: Wed Feb 19, 2014 3:25 pm
by narcis
kgu wrote: I do not see how I can get the depth be displayed as time series with axis tick marks.
You just need to enable depth axis and set its labels like this:

Code: Select all

  Chart1.Axes.Depth.Visible:=True;
  Chart1.Axes.Depth.LabelStyle:=talValue;
You'll find further axis settings information in tutorial 4. Tutorials can be found at TeeChart's program group.
kgu wrote: Also, not clear about what property/method call to use to remove the shading under the curve.
That's the TSeriesRegionTool instance Yeray added. If you don't want them just remove this part of the code:

Code: Select all

    with Chart1.Tools.Add(TSeriesRegionTool) as TSeriesRegionTool do
    begin
      Series:=Chart1[i];
      Pen.Visible:=false;
      OriginPen.Visible:=true;
      OriginPen.Color:=Series.Pen.Color;
    end;
If you want to disable it temporarily you can set Active property to false:

Code: Select all

    with Chart1.Tools.Add(TSeriesRegionTool) as TSeriesRegionTool do
    begin
      Series:=Chart1[i];
      Pen.Visible:=false;
      OriginPen.Visible:=true;
      OriginPen.Color:=Series.Pen.Color;
      Active:=False;
    end;