hasembamboo.blogg.se

Excel change x axis range
Excel change x axis range















String chartName = "TEST CHART", processType="TEST TYPE" String fileName = "" + "YOUR_PATH" + "\\Templates\\m圜SV.csv" string appPath = Path.GetDirectoryName(Application.ExecutablePath)

#Excel change x axis range code

I tried your code and made some modifications, I hope this will work using Excel = XlWorkBooks.Close(true, misValue, misValue) Īny guidance would be greatly appreciated. Chart chart = (.Chart)co.Chart Ĭhart.Export(("Charts") + "\\ProcessFiles" + + chartName + " (" + processName + "of" + processType + ")" + ".png", "PNG", false) ChartObjects chartObjects =(.ChartObjects)(xlWorkSheet.ChartObjects(Type.Missing)) įoreach (.ChartObject co in chartObjects) (misValue, Title: chartName + " (" + processName + ")", CategoryTitle: "Iterations", ValueTitle: processType) (misValue, misValue, misValue, misValue, misValue).Select() Set Sheet 1 as the sheet you want to work with

excel change x axis range

Xlexcel.Visible = + processName + ".csv", misValue, misValue, .XlTextParsingType.xlDelimited, .XlTextQualifier.xlTextQualifierNone, misValue, misValue, misValue, misValue, misValue, misValue, misValue, misValue, misValue, misValue, misValue, misValue, misValue) Here's a snippet of my code: .Application xlexcel I went through a lot of articles and questions even on Stack Overflow but none seemed to help. It plots properly if I specify a range for X-axis too but how can I get the current row number there?

excel change x axis range

However my graph by default takes the X-axis to be the first column in my csv file.

excel change x axis range

The graph plotted should be the column range I am providing, in the Y-axis and X-axis should have the current row number(1,2,3,4 etc). I have used the ChartObjects and ChartWizard property in c# to create the graph. I am a little new to c# and Visual Studio and I am trying to plot a graph based on the values of a csv file located somewhere else.















Excel change x axis range