vba - Excel Graph Automatic Resizing of Axis Origin -
i have following code plots scatter plot. there elegant way resize plot area such x , y axis not automatically start zero, rather below lowest value? @ moment data points end bunched in 1 corner. many thanks!
set cht = activechart 'graph 1 set rng1 = activesheet.range(range("ac13").offset(jump * 50, 0), range("ag23").offset(jump * 50, 0)) activesheet.chartobjects.add(left:=rng1.left, width:=rng1.width, top:=rng1.top, height:=rng1.height) '(left:=100, width:=375, top:=75, height:=225) .chart.charttype = xlxyscatterlines .chart.haslegend = false .chart.axes(xlcategory).ticklabels.font.size = 18 .chart.axes(xlvalue).ticklabels.font.size = 18 '.chart.setsourcedata source:=range("u13:o40,t13:n40") set srs = .chart.seriescollection.newseries srs.xvalues = range(range("u13").offset(jump * 50, 0), range("u13").offset(jump * 50, 0).end(xldown)) srs.values = range(range("t13").offset(jump * 50, 0), range("t13").offset(jump * 50, 0).end(xldown)) end
if y-range data in cells b1:b10
of activesheet
use code start range @ 90% of lowest value (ie below)
set cht = activechart cht.axes(xlvalue).minimumscale = 0.9 * application.min([b1:b10])