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:

  1. add title
  2. change line color in chart specified color
  3. add trend line (polynomial)
  4. modify color of trend line
  5. add series(data set plot) chart
  6. edit series names
  7. 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

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -