Click here to Skip to main content
15,887,214 members
Home / Discussions / C#
   

C#

 
AnswerRe: New to programming--Help! Pin
Afzaal Ahmad Zeeshan10-Sep-15 1:06
professionalAfzaal Ahmad Zeeshan10-Sep-15 1:06 
AnswerRe: New to programming--Help! Pin
Amarnath S10-Sep-15 1:56
professionalAmarnath S10-Sep-15 1:56 
Questionmaking an array of List Pin
sdecorme9-Sep-15 3:53
sdecorme9-Sep-15 3:53 
AnswerRe: making an array of List Pin
OriginalGriff9-Sep-15 4:17
mveOriginalGriff9-Sep-15 4:17 
AnswerRe: making an array of List Pin
Eddy Vluggen9-Sep-15 11:24
professionalEddy Vluggen9-Sep-15 11:24 
QuestionSecondary Y-Axis not displayed in graph using c sharp Pin
santosh kumar dash9-Sep-15 2:10
santosh kumar dash9-Sep-15 2:10 
AnswerRe: Secondary Y-Axis not displayed in graph using c sharp Pin
Eddy Vluggen9-Sep-15 3:44
professionalEddy Vluggen9-Sep-15 3:44 
GeneralRe: Secondary Y-Axis not displayed in graph using c sharp Pin
santosh kumar dash10-Sep-15 0:16
santosh kumar dash10-Sep-15 0:16 
Hi Eddy,

I have pasted my code please have a look.

can we draw secondary y axis with the help of ChartWizard method in word chart.

Microsoft.Office.Interop.Word.Chart wdChart = wordDoc.InlineShapes.AddChart(Microsoft.Office.Core.XlChartType.xlLine, para17.Range).Chart;
wdChart.ChartWizard(Source: missing1,
Title: "graphTitle",
CategoryTitle: "Time",
ValueTitle: "Temperature",
ExtraTitle:"check");

Microsoft.Office.Interop.Word.ChartData chartData = wdChart.ChartData;

Microsoft.Office.Interop.Excel.Workbook dataWorkbook = (Microsoft.Office.Interop.Excel.Workbook)chartData.Workbook;
Microsoft.Office.Interop.Excel.Worksheet dataSheet = (Microsoft.Office.Interop.Excel.Worksheet)dataWorkbook.Worksheets[1];

Microsoft.Office.Interop.Excel.ChartObjects ChartObjects = (Microsoft.Office.Interop.Excel.ChartObjects)dataSheet.ChartObjects();
Microsoft.Office.Interop.Excel.ChartObject chartObject = ChartObjects.Add(40, 1000, 700, 350);

Microsoft.Office.Interop.Excel.SeriesCollection seriesCollection = (Microsoft.Office.Interop.Excel.SeriesCollection)chartObject.Chart.SeriesCollection();

Microsoft.Office.Interop.Excel.Series series1 = seriesCollection.NewSeries();
series1.XValues = dataSheet.get_Range("A1", "B7");
series1.AxisGroup = Microsoft.Office.Interop.Excel.XlAxisGroup.xlSecondary;

Microsoft.Office.Interop.Excel.Series series3 = seriesCollection.NewSeries();
series3.XValues = dataSheet.get_Range("A1", "D7");
Microsoft.Office.Interop.Excel.Series series4 = seriesCollection.NewSeries();
series4.XValues = dataSheet.get_Range("A1", "E7");


((Microsoft.Office.Interop.Excel.Range)dataSheet.Cells.get_Range("A2", missing1)).FormulaR1C1 = "5";
((Microsoft.Office.Interop.Excel.Range)dataSheet.Cells.get_Range("A3", missing1)).FormulaR1C1 = "10";
((Microsoft.Office.Interop.Excel.Range)dataSheet.Cells.get_Range("A4", missing1)).FormulaR1C1 = "15";
((Microsoft.Office.Interop.Excel.Range)dataSheet.Cells.get_Range("A5", missing1)).FormulaR1C1 = "20";
((Microsoft.Office.Interop.Excel.Range)dataSheet.Cells.get_Range("A6", missing1)).FormulaR1C1 = "25";
((Microsoft.Office.Interop.Excel.Range)dataSheet.Cells.get_Range("A7", missing1)).FormulaR1C1 = "30";
((Microsoft.Office.Interop.Excel.Range)dataSheet.Cells.get_Range("B2", missing1)).FormulaR1C1 = "1000";
((Microsoft.Office.Interop.Excel.Range)dataSheet.Cells.get_Range("B3", missing1)).FormulaR1C1 = "2500";
((Microsoft.Office.Interop.Excel.Range)dataSheet.Cells.get_Range("B4", missing1)).FormulaR1C1 = "4000";
((Microsoft.Office.Interop.Excel.Range)dataSheet.Cells.get_Range("B5", missing1)).FormulaR1C1 = "3000";
((Microsoft.Office.Interop.Excel.Range)dataSheet.Cells.get_Range("B6", missing1)).FormulaR1C1 = "400";
((Microsoft.Office.Interop.Excel.Range)dataSheet.Cells.get_Range("B7", missing1)).FormulaR1C1 = "300";

((Microsoft.Office.Interop.Excel.Range)dataSheet.Cells.get_Range("C2", missing1)).FormulaR1C1 = "700";
((Microsoft.Office.Interop.Excel.Range)dataSheet.Cells.get_Range("C3", missing1)).FormulaR1C1 = "500";
((Microsoft.Office.Interop.Excel.Range)dataSheet.Cells.get_Range("C4", missing1)).FormulaR1C1 = "400";
((Microsoft.Office.Interop.Excel.Range)dataSheet.Cells.get_Range("C5", missing1)).FormulaR1C1 = "300";
((Microsoft.Office.Interop.Excel.Range)dataSheet.Cells.get_Range("C6", missing1)).FormulaR1C1 = "2500";
((Microsoft.Office.Interop.Excel.Range)dataSheet.Cells.get_Range("C7", missing1)).FormulaR1C1 = "3500";


((Microsoft.Office.Interop.Excel.Range)dataSheet.Cells.get_Range("D2", missing1)).FormulaR1C1 = "1100";
((Microsoft.Office.Interop.Excel.Range)dataSheet.Cells.get_Range("D3", missing1)).FormulaR1C1 = "2150";
((Microsoft.Office.Interop.Excel.Range)dataSheet.Cells.get_Range("D4", missing1)).FormulaR1C1 = "4100";
((Microsoft.Office.Interop.Excel.Range)dataSheet.Cells.get_Range("D5", missing1)).FormulaR1C1 = "3100";
((Microsoft.Office.Interop.Excel.Range)dataSheet.Cells.get_Range("D6", missing1)).FormulaR1C1 = "2100";
((Microsoft.Office.Interop.Excel.Range)dataSheet.Cells.get_Range("D7", missing1)).FormulaR1C1 = "3100";

((Microsoft.Office.Interop.Excel.Range)dataSheet.Cells.get_Range("E2", missing1)).FormulaR1C1 = "2100";
((Microsoft.Office.Interop.Excel.Range)dataSheet.Cells.get_Range("E3", missing1)).FormulaR1C1 = "2050";
((Microsoft.Office.Interop.Excel.Range)dataSheet.Cells.get_Range("E4", missing1)).FormulaR1C1 = "4000";
((Microsoft.Office.Interop.Excel.Range)dataSheet.Cells.get_Range("E5", missing1)).FormulaR1C1 = "2100";
((Microsoft.Office.Interop.Excel.Range)dataSheet.Cells.get_Range("E6", missing1)).FormulaR1C1 = "4000";
((Microsoft.Office.Interop.Excel.Range)dataSheet.Cells.get_Range("E7", missing1)).FormulaR1C1 = "2100";

wdChart.ApplyDataLabels(Microsoft.Office.Interop.Word.XlDataLabelsType.xlDataLabelsShowLabel, missing1, missing1, missing1, missing1, missing1, missing1, missing1, missing1, missing1);
dataWorkbook.Application.Quit();

Regards,
Santosh.
Questioncalling T's method from a generic class Pin
binsafir7-Sep-15 23:36
binsafir7-Sep-15 23:36 
AnswerRe: calling T's method from a generic class Pin
Eddy Vluggen7-Sep-15 23:57
professionalEddy Vluggen7-Sep-15 23:57 
AnswerRe: calling T's method from a generic class Pin
Richard MacCutchan7-Sep-15 23:59
mveRichard MacCutchan7-Sep-15 23:59 
AnswerRe: calling T's method from a generic class Pin
Pete O'Hanlon8-Sep-15 0:07
mvePete O'Hanlon8-Sep-15 0:07 
AnswerRe: calling T's method from a generic class Pin
F-ES Sitecore8-Sep-15 0:24
professionalF-ES Sitecore8-Sep-15 0:24 
AnswerRe: calling T's method from a generic class Pin
DanBecause9-Sep-15 18:03
DanBecause9-Sep-15 18:03 
GeneralRe: calling T's method from a generic class Pin
David A. Gray11-Sep-15 11:33
David A. Gray11-Sep-15 11:33 
QuestionHow to Insert Into WebServer Using WCF Pin
Käük Kwäý7-Sep-15 17:40
Käük Kwäý7-Sep-15 17:40 
AnswerRe: How to Insert Into WebServer Using WCF Pin
Eddy Vluggen7-Sep-15 23:58
professionalEddy Vluggen7-Sep-15 23:58 
QuestionFormatting the RDL report tablix Pin
Ashfaque Hussain7-Sep-15 3:52
Ashfaque Hussain7-Sep-15 3:52 
AnswerRe: Formatting the RDL report tablix Pin
Afzaal Ahmad Zeeshan7-Sep-15 9:32
professionalAfzaal Ahmad Zeeshan7-Sep-15 9:32 
GeneralRe: Formatting the RDL report tablix Pin
Ashfaque Hussain7-Sep-15 21:00
Ashfaque Hussain7-Sep-15 21:00 
QuestionCapturing from Webcam without preview to the user Pin
Sultan Uz Zaman6-Sep-15 17:35
Sultan Uz Zaman6-Sep-15 17:35 
AnswerRe: Capturing from Webcam without preview to the user Pin
Wendelius6-Sep-15 17:43
mentorWendelius6-Sep-15 17:43 
AnswerRe: Capturing from Webcam without preview to the user Pin
Richard MacCutchan6-Sep-15 21:30
mveRichard MacCutchan6-Sep-15 21:30 
GeneralRe: Capturing from Webcam without preview to the user Pin
Sultan Uz Zaman6-Sep-15 22:13
Sultan Uz Zaman6-Sep-15 22:13 
GeneralRe: Capturing from Webcam without preview to the user Pin
Richard MacCutchan6-Sep-15 22:34
mveRichard MacCutchan6-Sep-15 22:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.