Solved

Pie chart

Posted on 1998-07-20
5
1,499 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

687 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