MacroAlan
New Member
- Joined
- Aug 30, 2004
- Messages
- 31
I have built the PivotTables from the data and then PivotCharts from them.
My "PrimaryValueAxisTitle" is showing on the wrong data; displaying on the Secondary axis side. And my "SecondaryValueAxisTitle" is not displaying at all. I do not get any error messages.
Got any ideas?
And now the customer wants a text box in the chart showing when the data originated.
My "PrimaryValueAxisTitle" is showing on the wrong data; displaying on the Secondary axis side. And my "SecondaryValueAxisTitle" is not displaying at all. I do not get any error messages.
Got any ideas?
Code:
ActiveSheet.Shapes.AddChart2(201).Select
ActiveChart.SetSourceData source:=Range("'" & NewSht & "'!A" & LftRow + 3 & ":I" & LastRow)
ActiveChart.FullSeriesCollection(4).Select
CurrChrt = ActiveChart.Name
Cells(LftRow - 2, 10) = CurrChrt
ActiveChart.FullSeriesCollection(1).ChartType = xlColumnStacked
ActiveChart.FullSeriesCollection(2).Select
ActiveChart.SetElement (msoElementDataLabelCenter) 'Bars
ActiveChart.ChartArea.Select
ActiveChart.FullSeriesCollection(8).AxisGroup = 2
ActiveChart.FullSeriesCollection(8).ChartType = xlLine
ActiveChart.ChartArea.Select
ActiveChart.SetElement (msoElementDataLabelCenter)
ActiveChart.ChartArea.Select
ActiveChart.FullSeriesCollection(8).Select
ActiveChart.SetElement (msoElementDataLabelRight) 'Line
ActiveChart.ChartArea.Select
ActiveChart.SetElement (msoElementPrimaryCategoryAxisTitleAdjacentToAxis)
Selection.Caption = "Calendar Month Order entered in JDE"
ActiveChart.SetElement (msoElementSecondaryValueAxisTitleAdjacentToAxis)
Selection.Caption = "Percentage of Orders that Violated Lead Time" [B] [COLOR="#B22222"]' Not showing[/COLOR][/B]
ActiveChart.SetElement (msoElementPrimaryValueAxisTitleAdjacentToAxis)
Selection.Caption = "Total Number of Orders"[B] [COLOR="#B22222"]'Showing on wrong side[/COLOR][/B]
ActiveChart.SetElement (msoElementChartTitleAboveChart)
Selection.Caption = "Number of Orders vs. Order Lead Time" & vbCr & FltTyp & ": " & Chr(32) & Fliter
ActiveChart.ChartTitle.Select
Selection.Format.TextFrame2.TextRange.Font.Bold = msoTrue
ArrNotFound:
' Next Z
LftRow = LftRow + 40
Z = Z + 1
RSa.MoveNext
Loop
LftRow = 5
For Z = 1 To ActiveSheet.ChartObjects.Count
With ActiveSheet.ChartObjects(Z)
.Left = Range("K" & LftRow).Left
.Top = Range("K" & LftRow).Top
.Width = 800
.Height = 525
[B] [COLOR="#B22222"] ' WRONG! Text box needs to be relative to chart
' ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, 489.75, 556.5, 111 _
, 22.5).Select
' Selection.ShapeRange(1).TextFrame2.TextRange.Characters.Text = "Data as of " & Format(Now(), "mm/dd/yy")[/COLOR][/B]
End With
LftRow = LftRow + pInterval
Next Z
And now the customer wants a text box in the chart showing when the data originated.