Solved

Pie chart

Posted on 1998-07-20
5
1,497 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Help on project with Soap 10 57
tidtcpserver connection lost handle 2 100
Find and Replace Stream with 0s 8 69
Twebbrowser in Fire monkey android scrolling to bottom 1 44
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

791 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