Jump to content
Software FX Community

Problem with adding a second series using OPENDataEx, ADDPOINTS and ValueEX


User (Legacy)

Recommended Posts

basically i want to add points to the graph real-time. The first series

works ok but i cant figure out how to get the second series

an example of what i want to do would be:

Dim i as integer,j as integer

for i = 0 to 3

for j = 0 to 49

ChartFX1.OpenDataEx COD_VALUES Or COD_ADDPOINTS, 1, 1

ChartFX1.ValueEx(i, 0) = j

ChartFX1.CloseData COD_VALUES Or COD_REALTIMESCROLL

next j

next i

the first series (0) is correctly displayed but once i try to addpoints to

series(1) it just continues to add on to the initial series. Is there

something i need to do to reset the COD_ADDPOINTS pointer? I thought that

when using ValueEx the first parameter is the series index.

The application has no fore knowledge of how many series there will be

Link to comment
Share on other sites

My Actual example involves something a little more complex. but I'm running

into:

Run-time error '-2147417848 (80010108)':

Method 'ValueEx' of object 'IChartFX' failed

basically it's an activeX component representing a device gathering

real-time data. There can be multiple devices running at any time and all

are staggered start. (collecting data at different times)

so when i want to start collecting data i basically raise an event within

the component:

Private Sub oX_SetSeries(Index As Integer)

oX(Index).series = ChartFX1.NSeries

End Sub

This sets the device to the next series index (chartfx1.nseries is 1 based

and the actual series when called with valueex is 0based)

then i start a timer that every oh...half second or so raises:

Private Sub oX_ShowData(Index As Integer, series As Integer, activity As

Integer)

ChartFX1.OpenDataEx COD_VALUES Or COD_ADDPOINTS, 1, 1

ChartFX1.ValueEx(series, 0) = activity

If series = mSelectedControl then

ChartFX1.CloseData COD_VALUES Or COD_REALTIMESCROLL

Else

ChartFX1.CloseData COD_VALUES

End If

End Sub

so if i start oX(0), then later start oX(1), (2) and so forth oX_ShowData

should add points to each series as they're collected and only show realtime

scrolling for the "activate" series.

Link to comment
Share on other sites

>"SoftwareFX Support" <noreply@softwarefx.com> wrote in message

>news:CGxirVjhEHA.3888@webserver3.softwarefx.com...

> ChartFX1.OpenDataEx COD_VALUES Or COD_ADDPOINTS, 1, 1

>

> Is especifying ONE series.

but i only want to specify one value for one series at a time....

so in my first example i would actually want to use 4,1 as there are four

series

-----------------------

for i = 0 to 3

for j = 0 to 49

ChartFX1.OpenDataEx COD_VALUES Or COD_ADDPOINTS, 4, 1

ChartFX1.ValueEx(i, 0) = j

ChartFX1.CloseData COD_VALUES Or COD_REALTIMESCROLL

next j

next i

----------------------

>"SoftwareFX Support" <noreply@softwarefx.com> wrote:

> Assuming the chart has two series. You need to initialize the chart with

TWO

> series prior to making this call.

Also i cant find any documentation about initializing the # of series the

chart will have besides setting the # of series in the Data/Behavior tab of

the design-time properties.

finally, i've tried using the series object with the same results....

OpenDataEx with COD_ADDPOINTS just continues to append values to the end of

the first series no matter which method i use:

-----

ChartFX1.ValueEx(i, 0) = j

or

ChartFX1.series(i).Yvalue(0) = j

-----

Link to comment
Share on other sites

This won't work.

All series in Chart FX have to have the SAME number of points. You can not

add to one series and leave the other one behind.

You may add a Hidden point to the other series, but then when the value

actually comes you won't be doing COD_ADDPOINTS but rather a regular

OpenData to set the point that was left behind.

--

FP

Software FX

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...