Jump to content
Software FX Community

Re: Array problem when creating a chart


User (Legacy)

Recommended Posts

My first guess (I don't do Java!) is you're using the wrong variables.

You tell me -- doesn't the following line fill the variable arVF with the Fields array?

var arVF = Conn.get_arFields(); // an array containing int fields

and the following fill the arDags with the Dates array

var arDags = Conn.get_arDates(); // an array containing dates

Then the AddArray needs to be:

CfxArray.AddArray(arVF);

CfxArray.AddArray(arDags);

Steve

uba <unnur@kveikir.is> wrote in message news:pZkNI3vqAHA.1808@sfxserver.softwarefx.com...

> Hi!

> Thank you for your help, but my code still isn't working.

> This is what I do (using Javascript inside an ASP page):

>

> **********************************************************************

> <%

> var chart, Conn;

> chart = Server.CreateObject("ChartFX.WebServer");

>

> chart.Axis(AXIS_Y).Min = 900;

> chart.Axis(AXIS_Y).STEP = 50;

> chart.Axis(AXIS_Y).Format = "####,";

>

> Conn = Server.CreateObject("myComObject.wsc"); // reference to my COM

> object

>

> var CfxArray;

> CfxArray = Server.CreateObject("CfxData.Array");

>

> var arVF = Conn.get_arFields(); // an array containing int fields

> var arDags = Conn.get_arDates(); // an array containing dates

>

> CfxArray.AddArray(arFields);

> CfxArray.AddArray(arDates);

>

> chart.DataType(0) = CDT_XVALUE;

> chart.DataType(1) = CDT_VALUE;

>

> chart.GetExternalData (CfxArray);

>

> Conn = null;

>

> %>

> <%=chart.GetHtmlTag("673","381","Auto","chart")%>

>

> **********************************************************************

>

> Do you see what's wrong with it? It doesn't show any errors but just hangs

> after I call the asp page.

>

> Thank you,

> uba

>

>

> "SteveT" <stephent@compassadv.com> wrote in message

> news:2vP3UENqAHA.1808@sfxserver.softwarefx.com...

> Uba,

>

> Show some more code.

> You say your array has numbers and dates? The AddArray will only take

> single dimension arrays.

>

> From the help file:

> "However, you can not pass multidimensional arrays to Chart FX. This means,

> if you create a matrix or a multidimensional array as nData(10,10) Chart FX

> will not know how to process this information. An error will occur."

>

> Here is their example:

>

> 'Create the Chart FX Data provider array

> Dim CfxArray As CfxDataArray

>

> 'nValues and nLegend are previously filled arrays

> Dim nValues(10) As Integer

> Dim nLegend(10) As Variant

>

> 'Add the nValues and nLegend arrays to the data provider

> CfxArray.AddArray nValues

> CfxArray.AddArray nLegend

>

> 'Let Chart FX take the information from the data provider

> ChartFX1.GetExternalData CfxArray

>

>

> Steve

>

>

>

> uba <unnur@kveikir.is> wrote in message

> news:VDsh#kKqAHA.2592@sfxserver.softwarefx.com...

> > Hi all,

> >

> > I'm having problems with creating a chart. I get an array from a com

> object

> > and I add it to the CfxArray. Then I try calling

> > chart.GetExternalData(CfxArray) but nothing happens, it just seems to be

> > looping - no error messages.

> > Does anyone know why my chart is not appearing? My array contains numbers

> > and dates so it shouldn't be a problem creating a chart out of it.

> >

> > Many thanks,

> >

> > uba

> >

> >

> >

> >

>

>

>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...