Click here to Skip to main content
15,889,281 members
Home / Discussions / C#
   

C#

 
AnswerRe: DataAdaptor.Fill startRecord Pin
Rajeshwar Code- Developer31-May-10 1:34
Rajeshwar Code- Developer31-May-10 1:34 
QuestionHow to call from an unmanaged DLL to managed code Pin
Keith Vitali31-May-10 0:53
Keith Vitali31-May-10 0:53 
AnswerRe: How to call from an unmanaged DLL to managed code Pin
Abhinav S31-May-10 1:10
Abhinav S31-May-10 1:10 
AnswerRe: How to call from an unmanaged DLL to managed code Pin
Luc Pattyn31-May-10 1:53
sitebuilderLuc Pattyn31-May-10 1:53 
Questionprogrammatically export crystal report with a sub report to .doc file Pin
MayukhSen30-May-10 23:51
MayukhSen30-May-10 23:51 
QuestionHelp ploting Excel graph in C# Pin
Mc_Topaz30-May-10 23:17
Mc_Topaz30-May-10 23:17 
AnswerRe: Help ploting Excel graph in C# Pin
OriginalGriff30-May-10 23:29
mveOriginalGriff30-May-10 23:29 
GeneralRe: Help ploting Excel graph in C# Pin
Mc_Topaz30-May-10 23:51
Mc_Topaz30-May-10 23:51 
Yes of course, forgot that one D'Oh! | :doh: Here is the correed version of the method:

public void TestAddChart(XlChartType type, System.Drawing.Point location, Size size)
{
    ChartObjects chartObjects = (ChartObjects)workSheet.ChartObjects(Type.Missing);
    ChartObject chartObject = chartObjects.Add(location.X, location.Y, size.Width, size.Height);
    Chart chart = chartObject.Chart;

    Range line1Yvalues = workSheet.get_Range("A1", "A5");
    Range line2Yvalues = workSheet.get_Range("B1", "B5");
    Range commonXvalues = workSheet.get_Range("C1", "C5");

    chart.SetSourceData(line1Yvalues, XlRowCol.xlRows);
    chart.SetSourceData(line2Yvalues, XlRowCol.xlRows);
    chart.SetSourceData(commonXvalues, XlRowCol.xlRows);
    chart.ChartType = type;
}


But the result is still not what I wanted. Here is the new result:

1) No lines in the graph is visible
2) There are five series, it should only be two
3) The Y-axis value is from 0 to 6, it should at least be 0 to 8.
4) The x-axis value is just 1, it should be 1 to 5.

I guess Excel cannot figure out that Line1 and Line2 should share same X-axis values. Or I lack those instructions.

What to do now?
GeneralRe: Help ploting Excel graph in C# Pin
Henry Minute31-May-10 0:37
Henry Minute31-May-10 0:37 
GeneralRe: Help ploting Excel graph in C# Pin
Mc_Topaz31-May-10 1:10
Mc_Topaz31-May-10 1:10 
GeneralRe: Help ploting Excel graph in C# Pin
Henry Minute31-May-10 1:23
Henry Minute31-May-10 1:23 
GeneralRe: Help ploting Excel graph in C# Pin
Mc_Topaz31-May-10 2:29
Mc_Topaz31-May-10 2:29 
GeneralRe: Help ploting Excel graph in C# Pin
Henry Minute31-May-10 2:51
Henry Minute31-May-10 2:51 
Questiondarw rectangle modification.... [modified] Pin
Nivas8230-May-10 22:42
Nivas8230-May-10 22:42 
AnswerRe: darw rectangle modification.... Pin
OriginalGriff30-May-10 23:00
mveOriginalGriff30-May-10 23:00 
GeneralRe: darw rectangle modification.... Pin
Nivas8231-May-10 18:53
Nivas8231-May-10 18:53 
GeneralRe: darw rectangle modification.... Pin
OriginalGriff31-May-10 22:13
mveOriginalGriff31-May-10 22:13 
GeneralRe: darw rectangle modification.... Pin
Nivas821-Jun-10 22:17
Nivas821-Jun-10 22:17 
GeneralRe: darw rectangle modification.... Pin
OriginalGriff1-Jun-10 22:59
mveOriginalGriff1-Jun-10 22:59 
AnswerRe: darw rectangle modification.... [modified] Pin
Nivas822-Jun-10 19:18
Nivas822-Jun-10 19:18 
GeneralRe: darw rectangle modification.... Pin
Nivas827-Jun-10 21:39
Nivas827-Jun-10 21:39 
AnswerRe: darw rectangle modification.... Pin
Luc Pattyn31-May-10 1:57
sitebuilderLuc Pattyn31-May-10 1:57 
GeneralRe: darw rectangle modification.... Pin
Nivas8231-May-10 19:02
Nivas8231-May-10 19:02 
GeneralRe: darw rectangle modification.... Pin
Luc Pattyn1-Jun-10 1:48
sitebuilderLuc Pattyn1-Jun-10 1:48 
QuestionA Question Of Focus and Tab Indices [Solved] Pin
Roger Wright30-May-10 22:20
professionalRoger Wright30-May-10 22:20 

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.