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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with MS Graph and the X Axis with - values 1

Status
Not open for further replies.

AJN2004

Programmer
May 11, 2004
30
DE
In a Program I'm currently developing I have an MS Graph object that is populated out of a query that is built with SQl statements that are fed from a combo box which allows the user to select a category that he/she wishes to see. In my code I establish the maximum and minimum values out of the table and use these to set the maximum and minimum properties of the Y Axis before the graph is shown. This works fine with + values, however in one of the categories the values returned are quite often negative. When this category is selected and the values are negative the graph is drawn with the curve correctly shown, however the X Axis moves to the top of the graph (not a problem) and shows just dots instead of the X Axis values.

What I need is an example of code where I can manipulate the X Axis to show the values.
 
Hi, this works for me:
Something else - if you're using a line chart, try changing to the scatter type graph. I was not successful doing this with a line chart. Worked perfectly with the scatter type.

Private Sub GraphToDts_Updated(Code As Integer)
Dim Systems
Dim DdDate
Dim StDate

DdDate = DLookup("[CodDate]", "[tblCodDate]", "[ID]=1") 'Get Drop Dead Date
StDate = DMin("[ActToDt]", "tblStatus")
Systems = DCount("[SuSys]", "tblSus") 'Get Number of Packages


Me![GraphToDts].Axes(xlCategory).MaximumScale = DdDate 'Set Drop Dead Date as Max for Graph
Me![GraphToDts].Axes(xlCategory).MinimumScale = StDate
Me![GraphToDts].Axes(xlValue, xlPrimary).MinimumScale = SchTODt
Me![GraphToDts].Axes(xlValue, xlPrimary).MaximumScale = txtTotalQty

With Me!GraphToDts
Me!GraphToDts.ChartTitle.Caption = DLookup("[Jobname]", "tblJobs", "[number]=1") & " Earned Man-Hours"
End With

With Me!GraphToDts.Axes(xlValue, xlPrimary)
.HasTitle = True
.AxisTitle.Text = "Total Budgeted Man-Hours: " & Me.txtTotalQty
End With
End Sub

HTH
 
Thanks for your swift reply.
I'm using code pretty much the same as yours, which as I said earlier works fine with positive values.

The problem with negative values lies in the Chart object itself. To make the reading of the values in the X axis easier to read I slanted them - no probs with positive values. As soon as negative values are being plotted the X axis moves to the top of the chart AND BECAUSE of the slanting the values disapear! I removed the slanting and voila the values were there!!
 
Hmmm, I've never set the X-axis to a negative value. I do use slanting too. That's something useful to know. I'll have to give you a star for that one - odd's are I'll run into that one day. I used to cuss this stuff up one side and down the other until I switched to scatter plots.

Thanks!
 
Thanks for the star, I'm not certain that I deserve it!
One point, I do not set the X Axis to negative values. Perhaps I explained badly. The X axis is a time axis that stays constant over a time period that is taken from the underlying table. It is the Y axis that can have negative values. When it does, the behaviour previously explained ocures. The charts (2) are also a scatter charts.

All the best!

ajn2004
 
Just for the record here it is in black & white from MS:

PSS ID Number: 248657

Article Last Modified on 5/23/2003


--------------------------------------------------------------------------------
The information in this article applies to:


Microsoft Excel 2000
Microsoft PowerPoint 2000
Microsoft Word 2000

--------------------------------------------------------------------------------

This article was previously published under Q248657
SYMPTOMS
When you print an Excel worksheet, a PowerPoint slide, or a Word document that contains a chart or graph, rotated text on a graph axis is printed as a white box. The white box may or may not contain the text.
CAUSE
The problem occurs when the following conditions are all true:
You print by using a PostScript printer driver.
The axis labels are rotated by a non-multiple of 90 degrees.
The text contains accented characters.
WORKAROUND
To work around this problem, use one of the following methods.
Method 1
Rotate the text in multiples of 90 degrees.
Method 2
Do not use a non-white background behind a chart.
Method 3
Use a non-PostScript printer driver.
STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
MORE INFORMATION
Steps to Reproduce Problem
Start PowerPoint 2000.
Click OK to open a blank presentation (the default).
In the Choose an AutoLayout list, click the Chart layout (second row, fourth column). Click OK.
On slide 1, double-click on the chart placeholder to edit the chart.
Start Character Map. If you need help using Character Map, please refer to Help for your specific operating system.
In the Character Map dialog box, in the Font list, select Arial.
Click the accented e for which the keystroke is ALT+0232, and then click Select. The keystroke is shown in the lower right of the Character Map dialog box.
Repeat the previous step to select three or four additional accented characters.
Click Copy to copy the selected characters to the clipboard.
On Presentation1 - Datasheet, click the text 1st Qtr, and then paste the text that you selected in Character Map.
Point to an x-axis series name, right-click it, and then click Format Axis.
On the Alignment tab in the Degrees box, type 45 and then click OK. The x-axis should now contain rotated series names, with one series containing accented characters.
Click off the chart to leave edit mode, and then click the chart to select it.
On the Format menu, click Object.
On the Colors and Lines tab, in the Fill Color list, select yellow (or any other pale color).
On the Colors and Lines tab, in the Line Color list, select black.
Print the slide to a PostScript printer.

Result: A white box is printed, instead of the rotated accented characters.
NOTE: Steps 5 through 7 use the Character Map feature to add accented characters. You can also use the ALT key and the numeric keypad to type an accented character. Keyboards for languages other than English provide specific keys for typing accented characters.


Additional query words: off2000 chart graph axis rotate accent character

Keywords: kbbug kbfix KB248657
Technology: kbExcel2000 kbExcel2000Search kbExcelSearch kbExcelWinSearch kbPowerPt2000 kbPowerPt2000Search kbPowerPtSearch kbWord2000 kbWord2000Search kbWordSearch kbZNotKeyword2

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top