Solved

Pie chart

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

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…
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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now