Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Excel Chart Axis Maximum Fixed Value

$
0
0

I've wrote the following code to create a chart in Excel, but I need to specify the Y Axis to be fixed at 100 instead of set to the default of Auto.

# Generate graph
$xRow = 1
$yRow = $rows
$objRange=$Worksheet.range("a${xRow}:c${yRow}")
$colCharts=$excel.Charts
$objChart=$colCharts.Add()
$objChart.ChartType=4
$objChart.Axes(0).CategoryType=2
$objChart.Axes(0).TickLabelSpacing=7
$objChart.HasTitle = $true
$objChart.ChartTitle.text = "Report"
$a=$objChart.Activate

I've tried $objChart.Axes(0).Maximum = 100 and also .Minimum and .MaximumScaling and .Scaling.Maximum but none of these have worked. Does anyone know the correct command?

Thanks in advance


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>