PDA

View Full Version : Chart Code Assistance



reportxcel
11-09-2006, 10:11 AM
Chart Code Assistance

Hello,

I am currently out of ideas and need some assistance with my chart coding. The issue I am having is when the chart runs the “tick labels” appear in the middle of the chart. (Very frustrating)

Below is the coding for the line chart I am running. Any help would be great thanks.



With TempChart
.ChartType = xlLine
.SetSourceData Source:=SourceData, PlotBy:=xlRows
.HasLegend = True
.Legend.Position = xlLegendPositionBottom
.ApplyDataLabels Type:=xlDataLabelsShowValue, LegendKey:=False
.ChartTitle.Font.Size = 8
.ChartTitle.Font.Bold = True
.Axes(xlValue).MinimumScale = -1.5
.Axes(xlValue).MaximumScale = 1.5
.Axes(xlCategory).TickLabels.Font.Size = 8
.Axes(xlCategory).TickLabels.Font.Bold = True
.Axes(xlCategory).TickLabels.Orientation = xlHorizontal
.Location Where:=xlLocationAsObject, Name:="Sheet1
End With

mdmackillop
11-09-2006, 10:55 AM
Welcome to VBAX.
Can you post a sample of your data? You can do this using Manage Attachments in the Go Advanced section.
Regards
MD

TrippyTom
11-09-2006, 11:08 AM
Tick marks will always be applied to your axis. If your chart has negative values, that will push your axis into the middle of the chart. To fix this:
1) double click your Y axis
2) on the SCALE tab, where it says Category (X) axis crosses at: ____, change it to whatever value is the lowest negative number.

You can use the macro recorder to figure out how it does it via code.