Welcome to Dream.In.Code
Become a VB Expert!

Join 149,378 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 2,591 people online right now. Registration is fast and FREE... Join Now!




help in pie chart

 
Reply to this topicStart new topic

help in pie chart

muddasir
14 Feb, 2008 - 02:01 AM
Post #1

D.I.C Head
Group Icon

Joined: 14 Jan, 2007
Posts: 106



Thanked: 4 times
Dream Kudos: 200
My Contributions
i had developed an accouting software and in this i made some chart
for this i used MSChart .
As long as charting is concerned it is working fine all the chart is showing the desired results. the problem only arise in pie chart


well , when i use the chart type as


Code: ( text )
VtChChartType2dPie


the chart show the data (let says sale of six month) by representing six circles size according to each month sales
now i want the chart to be look like just as pie chart in Excel that is for six months sale it has to show me only one circle the the sale of each month will shown as portion in the same circle.

I think this will clear to you what i actually want.
Is there any other control is available to draw charts or not?

User is offlineProfile CardPM
+Quote Post

Nayana
RE: Help In Pie Chart
14 Feb, 2008 - 02:39 AM
Post #2

DIC Hawk - 나야나 नयन:
Group Icon

Joined: 14 Nov, 2007
Posts: 824



Thanked: 5 times
Dream Kudos: 175
My Contributions
You're simply using it wrong. You've probably got your columns and rows muddled up or something.

We need to see some code in order to help.

Please paste code like so code.gif

If you don't paste code, it makes it extremely difficult for us to help.

Please help us, help you, help us all.

And yes, there are other charting controls available. But MSChart should work fine for most things.
User is offlineProfile CardPM
+Quote Post

muddasir
RE: Help In Pie Chart
14 Feb, 2008 - 04:32 AM
Post #3

D.I.C Head
Group Icon

Joined: 14 Jan, 2007
Posts: 106



Thanked: 4 times
Dream Kudos: 200
My Contributions
when i am using bar chart the graph look correct
likeAttached Image

but when i set grph property on click evnet
to

CODE
graph1.ChartType=VtChChartType2dPie

then i get picture like this see all labels and data vanished
Attached Image

i want it to belike this Attached Image

one user suggest me to set rowcount property to 1 but this shoes only one mothdata like thisAttached Image

How can i use the pie chart having label and data just like the picture i wanted whic isAttached Image


User is offlineProfile CardPM
+Quote Post

Nayana
RE: Help In Pie Chart
14 Feb, 2008 - 05:28 AM
Post #4

DIC Hawk - 나야나 नयन:
Group Icon

Joined: 14 Nov, 2007
Posts: 824



Thanked: 5 times
Dream Kudos: 175
My Contributions
Your friend was right.

Listen and understand.

You set your row count to 1 right?

In that case you should have 1 row. Pure logic.

Put all the data in different columns in the same row.
User is offlineProfile CardPM
+Quote Post

muddasir
RE: Help In Pie Chart
14 Feb, 2008 - 07:54 AM
Post #5

D.I.C Head
Group Icon

Joined: 14 Jan, 2007
Posts: 106



Thanked: 4 times
Dream Kudos: 200
My Contributions
how can i
Put all the data in different columns in the same row

can you please explain in detail.

also please tell me some name of other control from which we can make charts and how/where to get them





QUOTE(Nayana @ 14 Feb, 2008 - 06:28 AM) *

Your friend was right.

Listen and understand.

You set your row count to 1 right?

In that case you should have 1 row. Pure logic.

Put all the data in different columns in the same row.


This post has been edited by muddasir: 14 Feb, 2008 - 07:57 AM
User is offlineProfile CardPM
+Quote Post

Nayana
RE: Help In Pie Chart
14 Feb, 2008 - 08:15 AM
Post #6

DIC Hawk - 나야나 नयन:
Group Icon

Joined: 14 Nov, 2007
Posts: 824



Thanked: 5 times
Dream Kudos: 175
My Contributions
Well, if you were to show us YOUR CODE, then we might be able to tell you what you're doing wrong.

We're not mind readers. And we're not going to hack into your computer just to see your code.

For goodness sake, help us help you.

Specifically, the code where you put the data into the pie chart.

kthxbai
User is offlineProfile CardPM
+Quote Post

muddasir
RE: Help In Pie Chart
15 Feb, 2008 - 01:24 AM
Post #7

D.I.C Head
Group Icon

Joined: 14 Jan, 2007
Posts: 106



Thanked: 4 times
Dream Kudos: 200
My Contributions
on the click event of a button i use the following code

CODE
salesrs.Open "SELECT DATENAME(mm, [date]) + ' ' + DATENAME(yy, [date]) AS Months, SUM([total(Credit)]-[total(debit)]) AS Amount FROM         sales WHERE     ([date] BETWEEN '" & fromdate & "' AND'" & todate & "') GROUP BY DATENAME(mm, [date]) + ' ' + DATENAME(yy, [date]), MONTH([date]), YEAR([date]) ORDER BY YEAR([date]), MONTH([date]) ", con, adOpenStatic, adLockReadOnly
Set salesgraph.DataSource = salesrs
If graphtype.Text = "Pie Graph" Then
salesgraph.ChartType = VtChChartType2dPie
ElseIf graphtype.Text = "Bar Graph" Then
salesgraph.ChartType = VtChChartType2dBar
ElseIf graphtype.Text = "Area Graph" Then
salesgraph.ChartType = VtChChartType2dArea
End If


where salesgrpah is the name of graph
and graphtype is the combobox where user can select
type of graph
now did any thing more you needed

also please tell me some other control that can be
use for graph making









QUOTE(Nayana @ 14 Feb, 2008 - 09:15 AM) *

Well, if you were to show us YOUR CODE, then we might be able to tell you what you're doing wrong.

We're not mind readers. And we're not going to hack into your computer just to see your code.

For goodness sake, help us help you.

Specifically, the code where you put the data into the pie chart.

kthxbai


User is offlineProfile CardPM
+Quote Post

maceng
RE: Help In Pie Chart
16 Feb, 2008 - 10:11 AM
Post #8

New D.I.C Head
*

Joined: 12 Feb, 2008
Posts: 6

I think you are going the wrong way. Pie charts under VB6 consist on just on circle (no 3D) which you have to divide in sectors. The angle "barred" by the sector is to be calculated by the user:

angle()=(per())*6.2832/100

I will post some more info within the hour. OK?
User is offlineProfile CardPM
+Quote Post

muddasir
RE: Help In Pie Chart
16 Feb, 2008 - 10:59 PM
Post #9

D.I.C Head
Group Icon

Joined: 14 Jan, 2007
Posts: 106



Thanked: 4 times
Dream Kudos: 200
My Contributions
dear sir,
please downolade a small project which may
clear you that what the code i am using

http://www.ziddu.com/download.php?uid=aK2c...qhkZSnY6ufmp2u6

can you correct the code






QUOTE(maceng @ 16 Feb, 2008 - 11:11 AM) *

I think you are going the wrong way. Pie charts under VB6 consist on just on circle (no 3D) which you have to divide in sectors. The angle "barred" by the sector is to be calculated by the user:

angle()=(per())*6.2832/100

I will post some more info within the hour. OK?


User is offlineProfile CardPM
+Quote Post

muddasir
RE: Help In Pie Chart
17 Feb, 2008 - 01:11 AM
Post #10

D.I.C Head
Group Icon

Joined: 14 Jan, 2007
Posts: 106



Thanked: 4 times
Dream Kudos: 200
My Contributions
if 3d graph is not possible it may be 2d but
it has to show the records in one circle only
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 09:19AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month