BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

XY Chart

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Cenk
Guest





PostPosted: Tue May 23, 2006 3:14 pm    Post subject: XY Chart Reply with quote



Hi,
Can someone tell me how to draw xy charts?
thanks
Back to top
Mark Jacobs
Guest





PostPosted: Wed May 24, 2006 12:14 pm    Post subject: Re: XY Chart Reply with quote



Cenk wrote:
Quote:
Can someone tell me how to draw xy charts?

Go to the "Additional" tab on the component palette, and choose the "Chart"
object to drop a TChart onto your form. The TChart IDE interface should
handhold you through designing your XY chart. HTH,
--
·
Mark Jacobs
DK Computing
http://www.dkcomputing.co.uk
Back to top
Cenk
Guest





PostPosted: Wed May 24, 2006 2:14 pm    Post subject: Re: XY Chart Reply with quote



Hi Mark,

i have datas and i wanna show those datas on my Tchart.How can i do it?
Would you please help me?
thanks
Back to top
Cenk
Guest





PostPosted: Wed May 24, 2006 4:14 pm    Post subject: Re: XY Chart Reply with quote

well well well,

my datas are on my harddisk, actually in <double> vectors.I want to open an
other form which has this TChart and put those datas on the chart which are
on my harddisk (in vectors). I hope this is more clear.

thanks
Back to top
Danzer
Guest





PostPosted: Wed May 24, 2006 5:14 pm    Post subject: Re: XY Chart Reply with quote

Cenk wrote:
Quote:
Hi Mark,

i have datas and i wanna show those datas on my Tchart.How can i do it?
Would you please help me?
thanks



Drop a TChart component on your form. Right-click the TChart and select
edit chart. Add a series to your chart. In the constuctor for your
form you might have something like the following.

Series1->Clear();
for (int i = 0; i < 100; i++)
Series1->AddXY(XValue[i], YValue[i]);


Danzer
Back to top
Fraser Ross
Guest





PostPosted: Wed May 24, 2006 7:14 pm    Post subject: Re: XY Chart Reply with quote

Quote:
well well well,

my datas are on my harddisk, actually in <double> vectors.I want to
open an
other form which has this TChart and put those datas on the chart
which are
on my harddisk (in vectors). I hope this is more clear.

thanks


If you have a continuous series of values, which is indicated by using a

vector, you would want to use Add rather than AddXY. e.g.
mySeries->Add(value, AnsiString(), clYellow);

Keeping the chart data series in sync. with a more workable copy in a
STL container is advisable.

Fraser.
Back to top
Cenk
Guest





PostPosted: Wed May 24, 2006 9:14 pm    Post subject: Re: XY Chart Reply with quote

Hello,

I want to show the X and Y values when i click on the Series. But i could
not manage the show the Y values correctly. Y values are double. Can you
please help me?

thanks
Back to top
Mark Jacobs
Guest





PostPosted: Wed May 24, 2006 10:14 pm    Post subject: Re: XY Chart Reply with quote

Cenk wrote:
Quote:
Bytheway,
i also wanna know if its possible to add series at run time? I mean,
due to different types of calculations in my applicaton, there could
be 20 different kinds of data series.And i wanna show all of them or
lets says 5 of them on my chart. Is it possible? if so, could you
please tell me how...

//---------------------------------------------------------------------------
void __fastcall TForm1::plotbtnClick(TObject *Sender)
{
long double x,y,frox,tox,stp;
frox=atof(xfro->Text.c_str()); tox=atof(xto->Text.c_str());
stp=atof(xstep->Text.c_str()); Chart1->Series[0]->Clear();
Chart1->Title->Text->SetText("y=sqrt(x^3)");
for (x=frox;x<=tox;x+=stp)
{
try
{
y=sqrtl(x*x*x);
}
catch (Exception &excp)
{
continue;
}
Chart1->Series[0]->AddXY(x,y,"",clTeeColor);
}
}
//---------------------------------------------------------------------------

And remember, you can drag a zoom box with the mouse, and it will zoom in
when you release the mouse button. Then you can use the right mouse button
to move around the graph zoomed in. It's pretty good for a freeby component!
The code is the way my graph plotter (at
http://www.jacobsm.com/maths.htm#tae - just click on the graph to download
it) produces plots. HTH,
--
Mark Jacobs
http://jacobsm.com
Back to top
Cenk
Guest





PostPosted: Wed May 24, 2006 10:14 pm    Post subject: Re: XY Chart Reply with quote

Bytheway,
i also wanna know if its possible to add series at run time? I mean, due to
different types of calculations in my applicaton, there could be 20
different kinds of data series.And i wanna show all of them or lets says 5
of them on my chart. Is it possible? if so, could you please tell me how...

thanks
Back to top
Danzer
Guest





PostPosted: Wed May 24, 2006 11:25 pm    Post subject: Re: XY Chart Reply with quote

Cenk wrote:
Quote:
Bytheway,
i also wanna know if its possible to add series at run time? I mean, due to
different types of calculations in my applicaton, there could be 20
different kinds of data series.And i wanna show all of them or lets says 5
of them on my chart. Is it possible? if so, could you please tell me how...



Add all 20 series to the chart. In the constructor to the form on which
the chart resides do the following.

Series1->Clear();
Series2->Clear();
....
Series20->Clear();

for (int iData = 0; iData < 100; iData++)
{
if (SomeCondition1)
Series1->AddXY(Series1X[iData],Series1Y[iData]);
if (SomeCondition2)
Series2->AddXY(Series2X[iData],Series2Y[iData]);
...
if (SomeCondition20)
Series20->AddXY(Series20X[iData],Series20Y[iData]);
}

Any series that does not pass the "SomeConditionNN" will not be displayed.

Danzer
Back to top
Cenk
Guest





PostPosted: Thu May 25, 2006 11:14 am    Post subject: Re: XY Chart Reply with quote

Hi,

What is notebook used for? i saw it in the Teechart example (under examples
directory of bcb). Can somebody help me?

thanks
Back to top
Cenk
Guest





PostPosted: Thu May 25, 2006 12:14 pm    Post subject: Re: XY Chart Reply with quote

Hello,

How can i set the title of the chart at run time?
Back to top
Cenk
Guest





PostPosted: Thu May 25, 2006 1:14 pm    Post subject: Re: XY Chart Reply with quote

hello,

i also want to click on a serie and a pop up menu should display, having two
choices ; which are display value and clear serie. If user choose to clear
serie, the serie should be cleared from the chart. Would you please help me?

thanks
Back to top
Danzer
Guest





PostPosted: Thu May 25, 2006 3:14 pm    Post subject: Re: XY Chart Reply with quote

Quote:
And remember, you can drag a zoom box with the mouse, and it will zoom in
when you release the mouse button. Then you can use the right mouse button
to move around the graph zoomed in. It's pretty good for a freeby component!
The code is the way my graph plotter (at
http://www.jacobsm.com/maths.htm#tae - just click on the graph to download
it) produces plots. HTH,

I believe we have located a vampire.

http://www.slash7.com/pages/vampires

Danzer
Back to top
Mark Jacobs
Guest





PostPosted: Fri May 26, 2006 1:22 am    Post subject: Re: XY Chart Reply with quote

Cenk wrote:
Quote:
i also want to click on a serie and a pop up menu should display,
having two choices ; which are display value and clear serie. If user
choose to clear serie, the serie should be cleared from the chart.
Would you please help me?

See my other response.

P.S. You are sounding like a "help vampire" -
http://www.slash7.com/pages/vampires from Danzer's previous message.
--
Mark Jacobs
http://jacobsm.com
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.