OWC Charting Problem

Fulge

Newcomer
Joined
Sep 24, 2003
Messages
2
Hi everyone...Im trying to use the OWC on my ASP.NET pages, but i can seem to get it working. I follow an example of a page, step by step, but the graphic doesn't appear...the code is this

ChartSpace1 = New OWC.ChartSpace()
ChartSpace1.Charts.Add(0)
ChartSpace1.Charts(0).SeriesCollection.Add(0)
ChartSpace1.Charts(0).SeriesCollection(0).Type = OWC.ChartChartTypeEnum.chChartTypeScatterMarkers
ChartSpace1.Charts(0).SeriesCollection(0).SetData(OWC.ChartDimensionsEnum.chDimSeriesNames, CType(OWC10.ChartSpecialDataSourcesEnum.chDataLiteral, Int32), aN)
ChartSpace1.Charts(0).SetData(OWC.ChartDimensionsEnum.chDimXValues, OWC.ChartSpecialDataSourcesEnum.chDataLiteral, aX)
ChartSpace1.Charts(0).SetData(OWC.ChartDimensionsEnum.chDimYValues, OWC.ChartSpecialDataSourcesEnum.chDataLiteral, aY)


this suppose to be a Scatter type of graphic, Where aN is the array wich contians the name of the points, and aX and aY ara the arrays that have the (X,Y) Coordanates of this points....the thing is that the code runs without a problem, but it doessn't create the graphic, and when i debug it I found that the line:

ChartSpace1.Charts(0).SeriesCollection(0).SetData(OWC.ChartDimensionsEnum.chDimSeriesNames, CType(OWC10.ChartSpecialDataSourcesEnum.chDataLiteral, Int32), aN)

always return "Expression does not produce a value" and so the line that suppose to setdata for the X axis and Y axis....does anyone knows what to do?...any Ideas??....any articles on how to make a graphic with this components??....thanks!!
 
Idea

Hi, I've been using Scatter Chart for a while and I do have some things to tell you about and maybe they could work...

Maybe you could try to get the data from the array to a string like this...in C#, you can migrate to another language is it's the case...

string aXStr = "";

for(int i = 0; i < aX.length; i++){
aXStr += aX + "\t";
}

//the "\t" is the reference which OWC is going to know where a data is ending and other data is begining...

you do the same to Y axis (aY)

Now one thing chDimSeriesNames displays the value in the legend for that series... the aX gotta have all the values in the X Axis, and the Y all the values in the Y Axis

for Instance:

X Y
2 5 so, the aXStr must be = "2\t6\t3\t"
6 9 and the aYStr = "5\t9\t8\t"
3 8
the Y axis doesn't have to have the X and Y values together... maybe that's the problem... try what I told you... It worked for me!

Good Luck!
Pablo
 
Back
Top