vb.net - Creating and Editing Excel Chart -
i trying create data analysis program using vb.net. data in excel file. x values in col a2, y values in b col b2.
i able generate chart data.
how format chart:
- add title
- change line color in chart specified color
- add trend line (polynomial)
- modify color of trend line
- add series(data set plot) chart
- edit series names
- x,y labels
any other formatting tips appreciated.
sorry ambiguous question. trying automate excel create charts using vb.net.
i not sure how implement since new vb.net. able create micro in excel functions. not sure how code in vb.net.
is there way convert vba excel micro vb.net?
sub macro2() ' ' macro2 macro ' ' range("b1:b14").select activesheet.shapes.addchart.select activechart.charttype = xlxyscattersmoothnomarkers activechart.setsourcedata source:=range("sheet1!$b$1:$b$14") activechart.seriescollection(1).select selection.format.line .visible = msotrue .forecolor.objectthemecolor = msothemecoloraccent1 .forecolor.tintandshade = 0 .forecolor.brightness = 0 end selection.format.line .visible = msotrue .forecolor.rgb = rgb(255, 0, 0) .transparency = 0 end activechart.seriescollection(1).trendlines.add activechart.seriescollection(1).trendlines(1).select selection .type = xlpolynomial .order = 2 end end sub
thank you.
thank you. have found solution these problems. please see other post how set xvalues of series in excel using vb.net
the example shows how create chart , of formatting methods. there 1 minor error in code has been answered tntinmn in post.
Comments
Post a Comment