Scatter Chart Axis as text in C# Web appl

Hi, 
I've created a Scatter Chart in OWC11 in C# and the X axis must display 
dates instead of numbers, I do it using the code below:

....
string x= "10/2/2004 12:00:00 AM\t10/2/2004 12:00:00 AM\t10/5/2004 12:00:00 
AM\t10/5/2004 12:00:00 AM\t10/6/2004 12:00:00 AM\t10/7/2004 12:00:00 
AM\t10/8/2004 12:00:00 AM\t";
string y = 1\t2\t76\t67\t....";

objChart.SeriesCollection[0].SetData(OWC11.ChartDimensionsEnum.chDimCategories, 
(int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, "Scatter Charts Series 
1");
objChart.SeriesCollection[0].SetData 
(OWC11.ChartDimensionsEnum.chDimXValues, 
(int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, x);
objChart.SeriesCollection[0].SetData(OWC11.ChartDimensionsEnum.chDimYValues,
(int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, y);
....

whe I do this, somehow the X axis doesn't display the current dates in the 
variable x and so the points position is wrong... so what I did is to change 
the dates in the x variable into numbers. That way did work out but it didn't 
display the dates in the x axis... (Example below)

....
x= "5\t7\t78\t23\t23\t85\t....";
y = 1\t2\t76\t67\t....";

objChart.SeriesCollection[0].SetData(OWC11.ChartDimensionsEnum.chDimCategories, 
(int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, "Scatter Charts Series 
1");
objChart.SeriesCollection[0].SetData 
(OWC11.ChartDimensionsEnum.chDimXValues, 
(int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, x);
objChart.SeriesCollection[0].SetData(OWC11.ChartDimensionsEnum.chDimYValues,
(int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, y);
....

I have no clue about using a Scatter Chart with a date format axis... can 
you please tell me any way to do that please?

pavr1
0
Pavr1 (1)
3/28/2005 4:21:02 PM
excel.charting 18370 articles. 0 followers. Follow

1 Replies
791 Views

Similar Articles

[PageSpeed] 2

I can't read French (I mean C#/OWC), so I don't know what a lot of your 
post means, but I've included a few comments in line.

Pavr1 wrote:

> Hi, 
> I've created a Scatter Chart in OWC11 in C# and the X axis must display 
> dates instead of numbers, I do it using the code below:
> 
> ...
> string x= "10/2/2004 12:00:00 AM\t10/2/2004 12:00:00 AM\t10/5/2004 12:00:00 
> AM\t10/5/2004 12:00:00 AM\t10/6/2004 12:00:00 AM\t10/7/2004 12:00:00 
> AM\t10/8/2004 12:00:00 AM\t";
> string y = 1\t2\t76\t67\t....";
> 
> objChart.SeriesCollection[0].SetData(OWC11.ChartDimensionsEnum.chDimCategories, 
> (int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, "Scatter Charts Series 
> 1");
> objChart.SeriesCollection[0].SetData 
> (OWC11.ChartDimensionsEnum.chDimXValues, 
> (int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, x);
> objChart.SeriesCollection[0].SetData(OWC11.ChartDimensionsEnum.chDimYValues,
> (int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, y);
> ...
> 
> whe I do this, somehow the X axis doesn't display the current dates in the 
> variable x and so the points position is wrong... so what I did is to change 
> the dates in the x variable into numbers. That way did work out but it didn't 
> display the dates in the x axis... (Example below)
 >
> ...
> x= "5\t7\t78\t23\t23\t85\t....";
> y = 1\t2\t76\t67\t....";

Is this a funny way to write {5, 7, 78, 23, 23,...} ? I was thinking 
that you might really have dates, but the number format was not set up 
to display the numbers as dates. But these are not the dates that Excel 
knows (I can't speak to OWC dates).

> objChart.SeriesCollection[0].SetData(OWC11.ChartDimensionsEnum.chDimCategories, 
> (int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, "Scatter Charts Series 
> 1");
> objChart.SeriesCollection[0].SetData 
> (OWC11.ChartDimensionsEnum.chDimXValues, 
> (int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, x);
> objChart.SeriesCollection[0].SetData(OWC11.ChartDimensionsEnum.chDimYValues,
> (int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, y);
> ...
> 
> I have no clue about using a Scatter Chart with a date format axis... can 
> you please tell me any way to do that please?

In Excel, a Scatter chart just has a numeric axis, but you can format 
the numbers as dates. You can't get nice ticks at nonuniform spacing, 
like the first of every month, because the major tick spacing must be 
equal, and months don't work out that way. In Excel, you can use a Line 
chart, which will give you a tick and a label at nonuniform places, like 
1-Jan, 1-Feb, etc. This unfortunate nomenclature ("scatter" vs. "line") 
confuses about 97% of Excel users, who think a line chart is for points 
with connecting lines and a scatter chart is for points without 
connecting lines; in reality the difference is between a numeric X axis 
(scatter chart) or a category or time scale X axis (line chart).

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
0
3/31/2005 4:28:24 AM
Reply:

Similar Artilces:

Text in cell #2
I am trying to find out how I can enter text in a cell and then press enter in the same cell to add more text. The keystroke is Alt+Enter to create a paragraph return. :) ******************* ~Anne Troy www.OfficeArticles.com www.MyExpertsOnline.com "Heather" <Heather @discussions.microsoft.com> wrote in message news:BFFAFA7F-4C45-42A6-96D6-5FB471C82EAA@microsoft.com... > I am trying to find out how I can enter text in a cell and then press enter > in the same cell to add more text. ...

capture/maintain information in summary/charts
My workbook has 10 Information-03 worksheet, 1 Charts and 1 Summary worksheets. How do I delete the 10 Information- 03 sheets but capture and maintain the information in the Charts and Summarys sheets so I can continue the Charts and Summary with Information-04 worksheets. I hope that made sense. AEFelton Jon Peltier has instructions for changing a chart's series formulas. You should be able to change the sheet names in your charts and summaries, to switch from 03 to 04 information. http://www.peltiertech.com/Excel/Charts/ChgSrsFmla.html AEFelton wrote: > My workbook has...

Saving auto text entries during reformatting
I'm having a partition installed on my work computer and I suspect my auto correct entries will be lost. I have Windows XP, SP3, Word 2007. I have a backup removable disk on which I'm storing my personal files until after the reformatting. I've searched for previous answers to this, but they seemed to be for earlier versions of Word. Can anyone help? pbkry2r wrote: > I'm having a partition installed on my work computer and I suspect my > auto correct entries will be lost. I have Windows XP, SP3, Word 2007. > I have a backup removable disk on which I'm...

Formula staying as text in cell
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel I have been having an issue with formulas remaining as text. Example: I type in a cell &quot;=A10&quot; and instead of displaying the contents of A10 I get +A10. It especially happens when I write a formula to display a value from a cell in another TAB. <br><br>Even when I type an &quot;=&quot; sign and then select the desired cell it come back with the formula not the desired value. Slight error the +A10 should be =A10. <br><br>> I have been having an issue with formulas ...

Can't change the scale of values on a y-axis on a line chart
The data are bunched together, so I want to choose a different grid line display to spread them apart. I changed the parameters in the Format Axis window but Excel won't accept the changes. Help! After entering values, do not check the Auto checkboxes. This tells Excel to use whatever scaling parameters it wants, and you already do not like those. - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions http://PeltierTech.com _______ "ags" <ags@discussions.microsoft.com> wrote in message news:FC410C13-BA19-4A29-A550-F99FE1915E31@microsoft.com....

Summing Text
I have two columns of text d s d r t s p s p r t r t r d s How do I write a formula to find out how many instances there are of d in columna A that correspond to s in Column B? Should be two. Is that sumprouct or sumif? This formula should do what you want... =SUMPRODUCT((A1:A100="d")*(B1:B100="s")) Change both of the references to Row 100 to whatever you will eventually need them to be. Rick "Paul" <Msr33@TPx12.com> wrote in message news:hlcj749de4arqdbq13tjiaokaqs23c1lac@4ax.com... >I have two columns of text > > d...

3D column chart, stacked
Hello, I created a 3D chart of the type 3D Column Chart from the standard tzpe menu. see following picture: 3D: [URL=http://www.directupload.net/show/d/567/MyhouTEW.jpg][IMG]http://www.directupload.net/images/060104/temp/MyhouTEW.jpg[/IMG][/URL] http://www.directupload.net/show/d/567/MyhouTEW.jpg X Achsis: driven kilometre in 10000 blocks Y Achsis: Production month Z Achsis: number I need to show another month in that chart, the repair month. Each colored column should be a stacked column with more colors, so that every color shows a repair month. the chart should look like the following ...

from someone OR with text in subject
Hi, How do I make a rule that puts mail in a folder if it is from someone *or* has a specific word in the subject line. When I try I always get *and*. Thanks in advance Jan Make two rules, one for each condition. --=20 Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for=20 Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Jan" <etyud@hetnot.nl> wrote in message = news:20a7d$429f005d$c3a990f6$15523@news1.tudelft.nl... > Hi, > How do I make a rule that puts mail in a folder if it is from...

Text disappears in navigation bar
I'm working on a site and the text is disappearing in my navigation bar. When I click on the wizard wand it shows that the text is indeed there, but it's not showing up. There are about 20 pages on this site and on each page different texts disappear. There doesn't seem to be any pattern. Has anyone ever ran into this problem before? Thanks ...

full text search should include attachments
it would be more than convenient to have a full text search implemented which also includess attached documents or notes. We add quite a lot of review documents inside CRM and should have the possibility to search for their contents. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the ...

chart over time
I wish to create a line graph to chart errors over time. Each entry has a "Type" and "Date" column. I want the dates on the x-axis filled automatically and a different line for each type of error. Every time I try to enter it manually the chart shows only the dates on the spreadsheet. This doesn't display the trends very well. ...

Macro to copy text between two different delimeters
I am trying to write a macro in Excel to select text between cells which contain words. Two challenges: 1.) I need to search for a cell that contains only one-single word "item:" and then copy the contents of the cell just-above that cell 2.) I need to search for a cell that contains only one-single word "component(s):" and then copy all of the rows below that until I find a cell that contains only the word "Zip" Any samples would help for either of these challenges ~Vic This is just an example of technique, not a full solution. This macro searches the activ...

Excel 2003 Text-to-Speech
We have currently installed MS Office 2003 Small Business Edition OEM on desktops, and the option to install Text-to-Speech for Excel is not listed in the features during installation, although it is featured in the lower Basic edition. Would anyone know what would be the problem? Shouldn't the higher SBE have this option too? Am I missing something? IF anyone have any ideas for this, please let me know, as it would be greatly appreciated. Thanks I don't see anything that says it's excluded from that version. Perhaps the information in the following MSKB article will help: Abou...

Labeling Data Series on an XY Scatter
I need to label a data series on an XY Scatter. Currently Excel only has the option to label and individual point with the series name, I want to label the entire series of points just once with the series name, even if inputs are changed. Select the point you want to label (two single clicks, one for the series, one for the point itself). Press Ctrl+1 to format the point, then add a data label using the Series option. This point will carry the series name as its label, even if the data or the series name change. In 2007, select the point (two clicks again). Go to the Chart Tools >...

BUBBLE CHART VSS- does not work
Hi- Purchased Visor based on the recommendation that it could create a Bubble chart from Data- http://blogs.msdn.com/visio/archive/2007/02/06/introducing-the-bubble-chart.aspx I downloaded the Buble chart VSS file from the blog and then followed the Directions implicitly. Does not work. I had my programmer look at it briefly and he went through it with me. Did not work. I then used the data flow diagram and used the data link- Worked perfectly except for the SIZE... the size is static no matter what you put in. Can anyone help me with this? We bought Viso for this and only this appl...

Problem with web page created in Excel
Hello I used Excel to create a web page with multiple sheets. I've done many web site before using Excel (yeah I know its probably a bad idea generally to use Excel to make web pages, but its easy, and for what i need it for, it is usually fine). In this case, it still works, but its aesthetically kind of messy. I have a few sheets with several boxes of information with borders. All the borders are basic, thin single lines, nothing dotted or thicker or anything. The same everywhere. Yet, when you open the files online, or as an .htm file, the lines are really fuzzy, dotted and messy. If y...

Chart Data Table
This is what I want to do, if it is possible. I want to show the data table on the bottom of the chart, but I don't want it to show all the data plotted in the chart. Is it possible to remove some information from the data table, but it still be on the chart? Thanks for the help, Bob -- robertjtucker ------------------------------------------------------------------------ robertjtucker's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=21805 View this thread: http://www.excelforum.com/showthread.php?threadid=522758 Hi, You can not control the content of th...

Question about pasting web content and formats
I am trying to paste the baseball standings from a web page onto a spreadsheet. The data pastes very nicely since it is already in a table format. However, some of the data on the web lists Home, Away and Last 10 records as "10-6", "3-7", etc. When I paste this onto the spreadsheet it automatically assumes it is a date and thus changes the data. Can this auto-formatting be temporarily disabled? Sometimes Excel is just too smart for it's own good. Anyway, any suggestions would be greatly appreciated. TIA! -gk- Hi try pre-formating the target range as 'Text...

OWA has no GUI, all text type directories
So in dealing with some DNS and AD issues between the AD DCs and the Exchange Server something happened to OWA. OWA only displays a text type directory of your mailbox. Like an FTP Site. There is no GUI anymore. So my mailbox looks like this: - /exchange/Scott.Townsend/ -------------------------------------------------------------------------------- [To Parent Directory] 4/11/2007 2:26 PM <dir> Calendar 4/11/2007 2:26 PM <dir> Contacts 4/11/2007 2:26 PM <dir> Deleted Items 4/11/2007 2:26 PM <dir> Drafts 4/11/2007 2:27 PM &...

Charting two axes
Need help charting the following: Revenue $ on left axis using bar graph Two Gross Profit % (GAAP and Proforma) on right axis using line graphs I can only get one bar and one line graph using the custom chart. FYI..I will be out of the office tomorrow. Thanks...Tonya Hi Tonya 1 select the data you want to chart (including axis labels and x axi data) 2 On the chart wizard, select the type of chart you want and follow th steps indicated 3 to change a single series from a column to a line, right click on it select chart type, and then line 4 to change the series to the right hand axis, rig...

Outlook 2002 sp3 doesn't find Notes by Cyrillic text in them
Hello Outlook 2002 sp3 doesn't find notes by Cyrillic text in them, only by digits, Latin letters. It finds some old Notes by Cyrillic text in them. How to correct this? ������������ Outlook 2002 sp3 �� ������� ������� (notes) �� �������������� ������ � ���, ������ �� ������ ��� ��������� ������. ��������� ������ ������� �� ������� �� �������������� ������ � ���. ��� ��� ���������? Outlook 2002 SP3 "Advanced find" finds Notes by Cyrillic text in their AutoPreview text only, not below the AutoPreview text. Outlook 2002 sp3 ������� ������� ������ �� ������, ������� �������� �...

Chart with x-axis as date/time
I have a spreadsheet with dates in column A and times in column B (when data was gathered). I have a chart using the x-axis for column A (date). How can I also get the chart to display the time? Basically, right now the x-axis is in the format 09/24/06 but I would like for it to be in the format 09/24/06 at 12:00 (or something like that). Can I use a custom number format that pulls data from multiple spreadsheet columns? Thanks in advance for any help, UCG Combine the date and time into a single column (Excel stores these numbers as a whole number date and fractional number time)....

Viewing text box fill colors on screen pub pro 2003
using pub pro 2003 on a dell lap top, windows XP SP2. I can not get the text box color fill to display the fill color on the screen. Prints fine when sent to printer. Almost looks like a view property setting but I have tried all of them. Do not have this problem on an HP desk top same OS version, same pub version. Any help? Read the third FAQ here: http://ed.mvps.org/Static.aspx?=Publisher/FAQs -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "Dan" <Dan@discussions.microsoft.com> wrote in message news:1E93FC77...

Apple surpasses M$ in market capitalization
SEATTLE - Apple has surpassed Microsoft as the largest technology company in the world by market capitalization. Apple's move comes as the company's iPhone, and now its iPad tablet computer, have taken on more of the personal computing tasks once handled by computers running Microsoft's Windows operating system and other programs. Market cap is the dollar value of a company's outstanding shares. On Wednesday, Apple Inc.'s shares slipped $1.11 to close at $244.11, making its market cap about $222 billion. But Microsoft Corp.'s stock fell $1.06, or 4.1 perce...

Count if Text is Equal in two Fields
I have a managers that do reviews on employees and i need to know if they did a review on an employee that reports to them or to another manager. In my table I have Mgr doing the review[Rev_Mgr] and Mgr who is accountable[Mgr_Acct] for the person being reviewed. In a query I am try to get it to give me a 1 if Mgr doing the review DO NOT EQUAL Mgr who is accountable. SO the two text field need to not equal. Try this -- IIF([Rev_Mgr] <> [Mgr_Acct], 1, 0) Seems like homework as there are a few others asking the same thing in different ways. -- Build a littl...