Chartspace for ASP.NET or VB.NET

L

Leslie

I'm trying to modify some examples in MSDN to create an
xlscatterplot chart and need to know how to find the
constants that apply to chartspace, for example, the
constants that apply to chartspace.type. Is this
documented in MSDN, in Excel 2002, or where?

Also, more detailed info on the entire use of chartspace
would be very helpful.

In the messages (see below) which I posted on the dotnet
list, the technician refers to several web pages on MSDN.
As far as I can tell none of those shows me the valid
constants for chartspace.type (or any of the other
properties of chartspace) Where is this information
located?

Leslie


===
From: Leslie
Date Posted: 11/4/2003 6:56:00 PM

Is this the place to ask for more reference information on
the chartspace object?

I'm trying to modify some examples in MSDN to create an
xlscatterplot chart and need to know how to find the
constants that apply to chartspace, for example, the
constants that apply to chartspace.type. Is this
documented in MSDN, in Excel 2002, or where?

Also, more detailed info on the entire use of chartspace
would be very helpful.

Leslie



RE: Chartspace
From: Tian Min Huang
Date Posted: 11/5/2003 12:24:00 AM

Hi Leslie,

Thanks for your post.

I recommend you refer to "Microsoft Office Web Components
Object Models" in
MSDN or MSDN onlene at
<http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/owcvba10/h
tml/octocmsowcobjectmodels.asp?frame=true> which provide
detailed
information on chartspace as well as other objects,
methods, properties and
events.

For the Type property specifically, you can access it with
lists of
constants in MSDN or MSDN online at:
Type Property
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/owcvba10/ht
ml/ocproType.asp?frame=true

I believe the following MSDN aritcle is also helpful:
Off the Chart Access
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/dnoffpro01/
html/OfftheChartAccess.asp

By the way, it you have further questions regarding Office
developerment, I
recommend you resort to the following newsgroups:
microsoft.public.office.developer
microsoft.public.officedev

Hope this helps.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD
 
T

Thao Moua [ms]

Here's an example to creating a XYScatter chart using
literal data.

-------------------
dim X_Array()
dim Y_Array()

X_Array(0)=1
X_Array(1)=3
X_Array(2)=4
Y_Array(0)=11
Y_Array(1)=31
Y_Array(2)=41

set c=webchart.constants
webchart.charts(0).type=c.chChartTypeScatterLine
set s1=webchart.charts(0).seriescollection.add
s1.setData c.chDimXValues, c.chDataLiteral, X_Array
s1.setData c.chDimXValues, c.chDataLiteral, Y_Array
---------------------

Thao Moua
OWC Webchart Support

This posting is provided "AS IS" with no warranties, and
confers no rights. Use of included script samples are
subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
 
L

Leslie

Dear Thao,

Thank-you for the example. I tried it and it worked fine.

However, I am using database data as the source for this
XYScatter, and have tried to set it up as indicated in the
HowTo: Use a Dataset with the Office XP Chart Component
and ASP.NET.

When I replace DataLiteral statements with DataBound
statements,
Replace:
cht.SetData c.chDimXValues, c.chDataLiteral, X_Array
cht.SetData c.chDimYValues, c.chDataLiteral, Y_Array

New:
Sub Button1_onclick
Dim c, ch, cht
Set c = cht1.Constants
cht1.charts.add
cht1.charts(0).type = c.chChartTypeScatterLine
set cht = cht1.charts(0).SeriesCollection.add
cht1.ConnectionString = "Provider=MSPersist"
cht1.CommandText = "MakeData.aspx"
cht1.SetData c.chDimXValues, c.chDataBound, "Current"
cht1.SetData c.chDimXValues, c.chDataBound, "Voltage"
'alternate: also does not work
'cht1.SetData c.chDimYValues, c.chDataBound, "Voltage"
End Sub


I get an error "The specified dimension is not valid for
the current chart type." for the line with "Current" at
the end.

My xml data file (makedata.aspx) is:
<xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882"
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns:rs="urn:schemas-microsoft-com:rowset"
xmlns:z="#RowsetSchema">
<s:Schema id="RowsetSchema">
<s:ElementType name="row" content="eltOnly"
rs:CommandTimeout="30">
<s:AttributeType name="Current" rs:number="1"
rs:nullable="true">
<s:datatype dt:type="float" dt:maxLength="8"
rs:precision="15" rs:fixedlength="true" />
</s:AttributeType>
<s:AttributeType name="Voltage" rs:number="2"
rs:nullable="true">
<s:datatype dt:type="float" dt:maxLength="8"
rs:precision="15" rs:fixedlength="true" />
</s:AttributeType>
<s:extends type="rs:rowbase" />
</s:ElementType>
</s:Schema>
<rs:data><z:row Current="2.1" Voltage="1.37"/><z:row
Current="4.11" Voltage="1.5"/><z:row Current="6.07"
Voltage="1.55"/><z:row Current="8.07"
Voltage="1.64"/><z:row Current="10.08"
Voltage="1.74"/><z:row Current="12.08"
Voltage="1.77"/><z:row Current="14.14"
Voltage="1.88"/><z:row Current="16.05"
Voltage="1.88"/><z:row Current="18.1"
Voltage="1.96"/><z:row Current="20.06"
Voltage="2.04"/><z:row Current="22.11"
Voltage="2.08"/><z:row Current="24.12"
Voltage="2.11"/><z:row Current="26.08"
Voltage="2.13"/><z:row Current="28.09"
Voltage="2.17"/><z:row Current="30.09"
Voltage="2.24"/><z:row Current="32.05"
Voltage="2.28"/><z:row Current="34.06"
Voltage="2.32"/><z:row Current="36.07"
Voltage="2.34"/><z:row Current="38.07"
Voltage="2.37"/><z:row Current="40.08"
Voltage="2.43"/><z:row Current="42.08"
Voltage="2.47"/><z:row Current="44.04"
Voltage="2.48"/><z:row Current="46.1"
Voltage="2.53"/><z:row Current="48.01"
Voltage="2.56"/><z:row Current="50.02"
Voltage="2.58"/><z:row Current="52.02"
Voltage="2.59"/><z:row Current="54.08"
Voltage="2.62"/><z:row Current="56.08"
Voltage="2.63"/><z:row Current="58.04"
Voltage="2.63"/><z:row Current="60.09"
Voltage="2.64"/><z:row Current="62.05"
Voltage="2.66"/><z:row Current="64.06"
Voltage="2.68"/><z:row Current="66.07"
Voltage="2.69"/><z:row Current="68.03"
Voltage="2.7"/><z:row Current="70.03"
Voltage="2.71"/><z:row Current="72.08"
Voltage="2.72"/><z:row Current="74.04"
Voltage="2.73"/><z:row Current="76.1"
Voltage="2.74"/><z:row Current="78.06"
Voltage="2.75"/><z:row Current="80.02"
Voltage="2.71"/></rs:data>
</xml>

Once again, I am quite frustrated at being unable to find
any sort of detailed documentation on the parameters
required for the XY Scatter chart. I have spent hours
guessing at what they might be. Surely there is
documentation somewhere?

Leslie
 
L

Leslie

Dear Thao,

PLEASE tell me where I can get complete documentation on
how to set these up.

Unfortunately, your most recent suggestions didn't work.
And I am in the dark on the relationship between the
various statements in this code.

For instance, when I comment out
'cht1.charts.add
cht1.charts(0).type = c.chChartTypeScatterLine

the compiler says that the next line is "invalid
parameter".
If I leave the charts.add statement in then it complains
that for this line "the specified dimension is not valid
for the current chart type"
cht1.SetData c.chDimXValues, c.chDataBound, "Current"

I really need to have complete explanations of how these
things work.

Thanks for your help,

Leslie
 
T

Thao Moua [ms]

One thing that was never stated was what OWC version are
you using? The code I provided will only work for
OWC10/11. For OWC9, the code is totally different.

Thao Moua
OWC Webchart Support

This posting is provided "AS IS" with no warranties, and
confers no rights. Use of included script samples are
subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
 
L

Leslie

Thao,

I'm not entirely sure what exactly you need to know, but
this will probably tell you:

I am running .NET Framework 1.0 with the following DLLs
installed:
Office10\MSOWC.dll, MSOWCF.dll, MSOWCW.dll, and OWSCLT.dll.
Also installed is
Microsoft Shared\WebComponents\10\OWC10.DLL.

This looks like version 10 to me.

Where can I find documentation specific to this particular
version and specific to how to set up an XY Scatter
diagram?

Leslie
 
W

Wei-Dong Xu [MSFT]

Hi Leslie,

Thank you for replying!

For the documentation, you can download the office web component tool pack and check the installed documentation for XY chartter. Please go to:
Microsoft Office XP Web Component Toolpack
http://www.microsoft.com/downloads/...77-2100-4586-A13C-50E56F101720&displaylang=en

Does this answer your question? Thank you for using Microsoft NewsGroup!

Wei-Dong Xu
Microsoft Product Support Services
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
L

Leslie

Dear Wei-Dong,

No, the documentation does not address what I need to know
(that I can find).

I need a specific example of how to set up an XY Scatter
using this technology in my environment where I use an XML
data file as the data source. I have already tried
substantial things with this, and if you reread the posts
on this thread I have provided all the information I can
think of, including specific statements that do not work.

(I am reincluding most of the information below in this
post).

Bottom line: I cannot get this to work and the
documentation you allude to does not specifically address
how to set up an XY Scatter type of graph. Nor does it
address XML data sources.

Surely there is documentation somehwere? ??????

Leslie

. Reply (E-mail) Forward (E-mail)

Subject: Need Documentation on ChartSpace
From: "Leslie" <[email protected]> Sent:
11/8/2003 1:20:42 PM




Thao,

I'm not entirely sure what exactly you need to know, but
this will probably tell you:

I am running .NET Framework 1.0 with the following DLLs
installed:
Office10\MSOWC.dll, MSOWCF.dll, MSOWCW.dll, and OWSCLT.dll.
Also installed is
Microsoft Shared\WebComponents\10\OWC10.DLL.

This looks like version 10 to me.

Where can I find documentation specific to this particular
version and specific to how to set up an XY Scatter
diagram?

Leslie


-----Original Message-----
One thing that was never stated was what OWC version are
you using? The code I provided will only work for
OWC10/11. For OWC9, the code is totally different.

Thao Moua
OWC Webchart Support

This posting is provided "AS IS" with no warranties, and
confers no rights. Use of included script samples are
subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

..






-----Original Message-----
Hi Leslie,

Thank you for replying!

For the documentation, you can download the office web
component tool pack and check the installed documentation
for XY chartter. Please go to:
 
T

Thao Moua [ms]

XYScatter data binding examples.

When the chart is bound to literal data then you need to
call SetData() at the series level.

dim X_Array(), Y_Array()

set c=webchart.constants
webchart.charts(0).type=c.chChartTypeScatterLine
set ScatterSeries=webchart.charts(0).seriescollection.add
ScatterSeries.setData c.chDimXValues, c.chDataLiteral,
X_Array
ScatterSeries.setData c.chDimXValues, c.chDataLiteral,
Y_Array

When the chart is bound to an external data source (ie
pivotlist control, spreadsheet, XML, or databases) then
you need to call SetData() at the Chartspace level.

set c=webchart.constants
webchart.connectionstring = "...."
webchart.commandtext = "...."
OR
webchart.datamember = "...."
webchart.charts(0).type=c.chChartTypeScatterLine
webchart.setData c.chDimXValues, c.chDataBound, "X_Data"
webchart.setData c.chDimYValues, c.chDataBound, "Y_Data"

Thao Moua
OWC Webchart Support

This posting is provided "AS IS" with no warranties, and
confers no rights. Use of included script samples are
subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
 
L

Leslie

Dear MS Support,

I tried the latest syntax you sent me as follows:

set c=cht1.constants

cht1.ConnectionString = "Provider=MSPersist"
cht1.CommandText = "http://localhost/zlwebr/MakeData.aspx"
cht1.charts(0).type=c.chChartTypeScatterLine
cht1.setData c.chDimXValues, c.chDataBound, "Current"
cht1.setData c.chDimYValues, c.chDataBound, "Voltage"

It isn't quite working. Although I do not get a page
error, I get an empty graph with two "buttons" across the
top, one reads "Sum of Current" and the other "Sum of
Voltage".

At the bottom is an empty box that reads "Drop Category
fields here" and on the right is another box that
reads "Drop Series Fields here". The scale on the X axis
goes from 0 to 2000 and on the Y axis from 0 to 100, so I
presume it is at least reading and processing the data
somehow.

But, since I do not know how to get documentation for
debugging this, I have no idea what needs to be fixed.

Please tell me how to fix this.

P.S. To see the XML input data, please refer to earlier
posts on this thread.

A second question is how to set this up so that the user
does not have to press a button to see the chart. I would
rather the chart just appears when they arrive at the page.

Leslie
 
T

Thao Moua [ms]

Here's the code you want.

cht1.ConnectionString = "Provider=MSPersist"
cht1.CommandText = "e:/temp2/test.xml"
cht1.HasPlotDetails = true 'this is very important
cht1.charts(0).type=c.chChartTypeScatterLine
cht1.setData c.chDimXValues, c.chDataBound, "Current"
cht1.setData c.chDimYValues, c.chDataBound, "Voltage"

The HasPlotDetails property is very important and is
often overlooked and under documented. When the chart is
bound to an external data source, the chart automatically
groups the data together and that is why you don't see
any data. The data were SUM up and that's why you saw
two fields saying "Sum of Current" and "Sum of Voltage."
To prevent the chart from aggregating the data, you must
use set the property HasPlotDetails to TRUE. This will
cause the chart to treat the data as individual data
points.

To answer your question about auto binding the chart to
the data source, this depends on whether the chart object
is located client-side or server-side. If the test is
client-side then add your code to the page's Window_Onload
() event. Upon loading the page, your script will bind
the chart to the data source. If there are any cross-
domain security issue between the client and the server
then the user will have to dismiss some popup security
alerts. If the test is server-side, the add the code to
your ASP page and execute the ExportPicture() method
after you have bounded the data. ExportPicture() will
generate a picture of what the chart looks like at that
time. Then add extra code to write out the URL to the
picture. This will be nothing more than writing out
standard HTML code. This way all the data binding is
accomplished on the server and the user just open and
view the picture of the chart.

Thao Moua
OWC Webchart Support

This posting is provided "AS IS" with no warranties, and
confers no rights. Use of included script samples are
subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
-----Original Message-----
Dear MS Support,

I tried the latest syntax you sent me as follows:

set c=cht1.constants

cht1.ConnectionString = "Provider=MSPersist"
cht1.CommandText
= "http://localhost/zlwebr/MakeData.aspx"
 
L

Leslie

Dear Thao,

That did it! It's working! I can hardly believe it!

One more question. I'm now working out the details of
formatting. What property sets the color of the line
joining the points on the scatter plot? (It defaults to a
bright blue and I would like a dark blue).

Leslie
 
G

Guest

The XYScatter chart is a line-base chart. So you will
need this code

webchart.charts(0).seriescollection
(0).line.color="darkblue"

Thao Moua
OWC Webchart Support

This posting is provided "AS IS" with no warranties, and
confers no rights. Use of included script samples are
subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
 
L

Leslie

Thao,

One last question. On the result chart I see fields "Drop
Filter Fields here", "Drop series fields here", "Drop
Category fields here".

Since I am not using them, how do I get rid of those?

Leslie
 
G

Guest

Use this code

CS.DisplayFieldButtons = FALSE

You can either turn all dropzone text ON or OFF.

Thao Moua
OWC Webchart Support

This posting is provided "AS IS" with no warranties, and
confers no rights. Use of included script samples are
subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top