Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pi chart labels

Status
Not open for further replies.

apestaart

Technical User
Feb 5, 2004
107
NL
I can't find a way to put labels on a pi chart generated by the report wizzard for charts.
Who can help me?
Regards Apestaart
 
What kind of labels? Data/series labels, legend, title, etc...?

Did you hear about the Buddhist who refused Novocain during a root
canal? He wanted to transcend dental medication.
 
Reply back with the SQL view of your chart's Row Source and the values of the labels you would like to see.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Hello dhookom,
Underneith you will find the SQL Row source.
I tried to define the pi chart with the autoform Wizzard and choos the Pivotchart. The filterfield are: Periode
The datafields : Aantal uren ziek
Serie fields : Region and a second one : Station.
So what I want te see in the pi chart is : Per periode the sum of ours ill (aantal uren ziek) for a chosen region and stations. On top of the pi pices I want to see the value in percentage of the total. So in januari 30% ill for region north station Amsterdam.
My SQL :
Code:
SELECT Verzuim.[Aantal uren ziek], Verzuim.Reden, Verzuim.Oorzaak, Werknemers.[Kontrakt soort], IIf(nz([Datum ziekmelding],0)>0,MonthName(Month([Datum ziekmelding])),MonthName(Month([Maandnz]))) AS Periode, TabStations.Station, TabRegios.Regio, Werknemers.RelID, Verzuim.[Datum ziekmelding]
FROM TabRegios INNER JOIN ((TabStations INNER JOIN Werknemers ON TabStations.StationID = Werknemers.StationID) INNER JOIN Verzuim ON Werknemers.RelID = Verzuim.RelID) ON TabRegios.RegioID = TabStations.RegioID
WHERE (((Verzuim.[Datum ziekmelding])>(Now()-Format(Now(),"y")))) OR (((Verzuim.[Datum ziekmelding]) Is Null) AND ((Verzuim.Maandnz)>0));
 
I don't understand if your issue is with just changing the labels of the chart or changing the actual composition of the data that is displayed.

The labels in the chart come from your column names in your Row Source. These can be modified by using an alias.
Mth: MonthName(...)

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Hello Dhookom,
I tried to define the pi chart with the Form Wizzard and choos the Pivotchart. So that is an form and not a report. Maybe Iam not at the rigth forum. But I will try to explane what I want. Using the Form Wizzard I get a pi chart without any label. I only can see the values of the sections when I move the cursor over the parts. What I want is to have those values as a label just besides the parts.

At first I tried to define a report with the report chart Wizzard. This reports have the labels I want , but I can´t find a way to filter the chart by Period.
When I use MonthName(Month(GivenDate)) as criteria I get an error.
And an other problem is that the report has 81 pages. Thats why I tried to get my reports in a form presentation.

I hope that you understand what I try to do.
Best regards Apestaart

 
You can set hundreds of properties in your chart by double-clicking it in design view of the form and then selecting various chart items to set the properties.

Any chart control can have a criteria in its Row Source property. If you can't figure this out, reply with some significant information about what you have and what you want to do.

What's wrong with 81 pages? If you only want 1 page then I expect you need to remove the Record Source from the report.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Hello Dhookom,
In the chart rowsource I have : [Aantal uren ziek], [Regio] and [Station]. This data comes from the query I have send to you.
The problem I have is to filter the data with a perio of time say "Januari 2007".
I think you can do that in two ways 1) the main query 2) the chart rowsource. But I can´t it getting to work in both ways.
1) The main query the where statement I tried :
Code:
WHERE (((IIf(nz([Datum ziekmelding],0)>0,MonthName(Month([Datum ziekmelding])),MonthName(Month([Maandnz]))))=MonthName(Month([Month]))) AND ((Verzuim.[Datum ziekmelding])>(Now()-Format(Now(),"y")))) OR (((Verzuim.[Datum ziekmelding]) Is Null) AND ((Verzuim.Maandnz)>0));
The query is asking for Month but i get an mistype error.
2)When I try to to add a criteria to the chart rowsource I think I have to add Period and goupby Period. I also whant to groupby Regio. The query looks like this.
Code:
 SELECT Query1.Regio, Sum(Query1.[Aantal uren ziek]) AS [SumOfAantal uren ziek], Query1.Periode FROM Query1 GROUP BY Query1.Regio, Query1.Periode;
What I tried i the criteria row I always get an error Makes no part of the statistical function.

I hope you can help me.
Best regards Apestaart


 
Are you using [Month] as a parameter prompt to allow users to enter a value? If so, what type of value are you entering?

If you want to get the day of the year, I would replace:
Format(Now(),"y")
with
DatePart("y",Date())
Format returns a string:
TypeName(Format(Now(),"y")) = String
DatePart() returns a number:
TypeName(Datepart("y",date())) = Integer


Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Hi Dhookom,
Answer on your first question Yes I do prompting for a month. The user should enter a string like january.
(If the date is within this year I check with
Code:
Verzuim.[Datum ziekmelding])>(Now()-Format(Now(),"y"))))
)
When I remove MonthName(Month([Month])) from the query I get all the correct data for this year.
So the only problem left is the criteria :
Code:
WHERE (((IIf(nz([Datum ziekmelding],0)>0,MonthName(Month([Datum ziekmelding])),MonthName(Month([Maandnz]))))=MonthName(Month([Month])
The query is asking for Month? entering january gives a type mismatch.
What is going wrong in the criteria?
Regards,
Apestaart
 
I would not conver the month to the month name. Have your users simply type in the month number. Then get rid of the conversion calculations. The MonthName() function expects to get a number argument from 1 to 12. The Month() function expects to get a legitimate date value argument like #9/21/2007#.

IMHO you should never subject your users to parameter prompts. If you want a query the allows entry of a month, use a combo box on a form.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top