Solved

Pie chart

Posted on 1998-07-20
5
1,495 Views
Last Modified: 2008-02-01
Given a stringlist containing info that resembles this:
abc 25
def 13
ghi 18
...
I want to create a pie chart in my Delphi 3 program...

I have NO IDEA on how to use/create a  delphi pie chart, but I need one for my program.

If any of you experts out there are willing to guide me throught this step by step until completion... I'm willing to give 350 points (I'll upgrade the points before completion)

Thanks
0
Comment
Question by:rafy
  • 3
  • 2
5 Comments
 

Accepted Solution

by:
westy100697 earned 200 total points
ID: 1358272
I have some code that I used for the TChart component to build a bar graph. It is pretty simple and powerful once you get into it. It was exactly what I was after . i will put some code in here and see if that helps you.

var  {Global Variables}
    SeriesValB : TBarSeries ;
    SeriesValL : TLineSeries ;
    SeriesValP : TPointSeries ;
    i : Integer ;
    Xlabel : String ;
    XVal,YVal : Real ;
implementation

procedure TViewGraphForm.GetGraphData ;
begin
    SeriesValB := TBarSeries.Create(Self) ;
    SeriesValB.BarStyle := bsRectangle ;
   {Other options for styles}
     SeriesValB.BarStyle := bsPyramid ;
     XVal := xdata ;
     yVal := ydata      
     SeriesValB.AddXY(XVal,YVal,Xlabel,PointColor) ;

    SeriesValL := TLineSeries.Create(Self) ;
    XVal := xdata ;
    yVal := ydata;
    SeriesValL.AddXY(XVal,YVal,Xlabel,PointColor) ;
end;

procedure TViewGraphForm.ViewGBtnClick(Sender: TObject);
begin
  GetGraphData ;
  Chart1.View3D := true
  Chart1.AddSeries(SeriesValB) ;
  Chart1.GetASeries ;
end;


You will have to adapt it to suit a TCircleSeries (Pie Chart) but hope this helps a bit... :)

WESTY
0
 

Author Comment

by:rafy
ID: 1358273
Thanks... Your code was very helpful, I upped the points to 200... is that OK?? (Less than promised, but help wasn't exactly step by step... still had to do a lot on my own)

I'll grade the question and transfer the points to you after you confirm that this is OK with you...Fair enough??

Anyways thanks again...and yes you are right... this is very powerful once you figure out how to use it.
 
0
 

Expert Comment

by:westy100697
ID: 1358274
rafy,
      No problems yeh I have just started to use all the Chart functions to their full and it kicks ass over D1 and D2. Thought I would just post up some of the code i used and let you delve into a bit deeper as you would probably learn more yourself. I have no probs with above and glad i could help. Nothing worse than getting stuck eh.

WESTY 8)
0
 

Author Comment

by:rafy
ID: 1358275
Cool... At least I know now that there's an expert that will be able to help me out with Charts if I get stuck again...
0
 

Expert Comment

by:westy100697
ID: 1358276
Excellent, glad I could help. This delphi area is so good for getting quick responses eh.
Makes it worthwile to ask questions I reckon. Points aren't what its about.. more about getting the knowledge to take your programming further.

WESTY


0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Using idhttp to login to instagram 2 90
Delphi XE10 Round Image 2 129
Magic Software info 18 132
How to build JSON File in Delphi 6 3 35
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question