OWC PivotChart from array?

E

effie.ram

All;
Is it possible to make OWC PivotChart from array?
My DB Query is heavy, so in order to save resourses & loop hitting the
db, i'm using the next sql on asp:
----------------------------------------------
strSQL = "SELECT A, B, C,D FROM tbl_tableA"
RS.Open strSQL , Conn_DB,3, 3, 1
A_Data = RS.GetRows(,,A)
B_Data = RS.GetRows(,,B)
C_Data = RS.GetRows(,,C)
D_Data = RS.GetRows(,,D)

RS.close
set RS = nothing
------------------------
So, i need to insert the above into PivotChart when:
A_Data will be the FilterData
B_Data will be the category
C_Data will be the data
D_data will be the series

Any help will be appreciate!!!

TIA, Effie
 
T

Thao Moua [ms]

If your arrays are delimited then you can just pass them
into the SetData() method like
CS.Charts(0).seriescollection(0).setdata
chValues,chDataLiteral, A_Data

Chart will know how to parse the data.

Thao Moua
OWC Webchart Support
 
E

effie.ram

Tnx, But I'm getting error.
My Array is comma delimited and so far, my code is:
ChartSpace1.Clear
ChartSpace1.Charts.Add
Set chConstants = ChartSpace1.Constants
ChartSpace1.Charts(0).SeriesCollection.Add
ChartSpace1.Charts(0).seriescollection(0).setdata
chValues.chDataLiteral, A_Data

Error "Invalid Parameter"
I think that the error is due to the "ChValue.", but i do not know how to solve it.

TIA, Effie
 
T

Thao Moua [ms]

Your code should be

ChartSpace1.Charts(0).seriescollection(0).setdata
chConstants.chDataLiteral, A_Data

Thao Moua
OWC Webchart Support
 
E

effie.ram

Still, no luck.
Following is an excerpt from the code that combined asp(Server) & vbs
(client)
'--------------------------------
RS.Open strSQL , dbConn,3, 3, 1
%>
<script language=vbs>
Dim A_Data
Dim B_Data
<% do while not RS.EOF %>
A_Data= "<%=trim(RS("A")) %>" & "," & A_Data
B_Data = "<%=trim(RS("B")) %>" & "," & B_Data
<%
RS.MoveNext
loop
%>
</script>
<%
RS.Close
set RS= nothing
dbConn.Close
set dbConn= nothing
%>
<html>
<head>
<body>
<object id=ChartSpace1
classid=CLSID:0002E556-0000-0000-C000-000000000046
style="width:100%;height:350"></object>

<script language=vbs>
ChartSpace1.Clear
ChartSpace1.Charts.Add
Set chConstants = ChartSpace1.Constants
with ChartSpace1.Charts(0).seriescollection(0).
.setdata chConstants.chDataLiteral, A_Data ' error on setdata
end with
</script>
</body>
</html>

'---------------------------------
I'm getting "Type mismatch" on the ".setdata" line during run time.
The code itself working fine as std chart if the .setdata line change
to:
..SetData chConstants.chDimCategories, chConstants.chDataLiteral,
A_Data
But this is not what i'm looking for. In this case , A_Data needs to
be as
a filter.

Thanks for your support, Effie
 
T

Thao Moua [ms]

The SetData() takes three parameters. The correct code is

ChartSpace1.Charts(0).seriescollection(0).Setdata
chConstants.chDimValues, chConstants.chDataLiteral,
A_Data

Thao Moua
OWC Webchart Support
 
E

effie.ram

Can you please post sample code that can demonstrate usage of
pivotchart with simple of 3 data points (1 for row, 1 for data & 1 for
category)

TIA, Effie
 

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