want waterfall 3d display show colored lines only

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
kgu
Newbie
Newbie
Posts: 2
Joined: Fri Feb 25, 2005 5:00 am

want waterfall 3d display show colored lines only

Post by kgu » Mon Feb 10, 2014 9:52 pm

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++.
Attachments
waterfall3d.JPG
waterfall3d.JPG (70.46 KiB) Viewed 5016 times
waterfall-desired.JPG
waterfall-desired.JPG (45.7 KiB) Viewed 4961 times

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: want waterfall 3d display show colored lines only

Post by Yeray » Thu Feb 13, 2014 11:09 am

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 4905 times
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

kgu
Newbie
Newbie
Posts: 2
Joined: Fri Feb 25, 2005 5:00 am

Re: want waterfall 3d display show colored lines only

Post by kgu » Mon Feb 17, 2014 10:00 pm

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.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: want waterfall 3d display show colored lines only

Post by Narcís » Wed Feb 19, 2014 3:25 pm

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;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply