Jump to content
Software FX Community

Clearing bug or...


User (Legacy)

Recommended Posts

Ok,

I may have multiple problems here - but lets start with the first. All

I'm trying to do is set some data to a XY chart, clear it, and send some new

data. The code I use is as follows:

int numpoints = 100;

chart1.ClearData(ClearDataFlag.Values | ClearDataFlag.XValues);

chart1.OpenData(COD.Values | COD.AddPoints,1,numpoints);

chart1.OpenData(COD.XValues | COD.AddPoints,1,numpoints);

for(int i = 0; i < numpoints; i++)

{

chart1.XValue[0,i] = i;

chart1.Value[0,i] = Math.Sin(2*Math.PI*i/(double)(numpoints - 1) +

phase);

}

chart1.CloseData(COD.Values);

chart1.CloseData(COD.XValues);

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

I increase the phase on a mouse click event to see the data changing.

Problem is, the first point appears to remain at zero. Am i doing something

wrong or is this a bug? Attached is a project demonstrating the problem.

Thanks in Advance,

Robert Conde

Link to comment
Share on other sites

COD.AddPoints is to be used in Real-Time charts to add points to a chart

that already has data.

What you want to do is much simpler:

chart1.OpenData(COD.Values | COD.Remove,1,numpoints);

chart1.OpenData(COD.XValues | COD.Remove,1,numpoints);

for(int i = 0; i < numpoints; i++)

{

chart1.XValue[0,i] = i;

chart1.Value[0,i] = Math.Sin(2*Math.PI*i/(double)(numpoints - 1) +

phase);

}

chart1.CloseData(COD.Values);

chart1.CloseData(COD.XValues);

--

FP

Software FX

xytesting.zip

Link to comment
Share on other sites

ok - let me explain what i want to do in the end and maybe you can enlighten

me. I would like to graph multiple x/y series as fast as possible. But

there will be an initially set maximum number of points. The points will not

be evenly spaced in general. After the maximum number of points are reached,

I need to go through the graphed data, throw away half, and then continue

graphing. When the maximum number points is reached the same thing happens

again. I'd like to use real time plotting, but it gets messed up when i try

to do the point culling and I'm not quite sure if it will work for a

non-scrolling plot. I really need some help as chartfx is turning out to be

otherwise slower than the ancient proessentials library we used previously -

I doubt that should be the case so I must be doing something wrong. Thanks.

Rob Conde

a.i. solutions

Link to comment
Share on other sites

I think the best for you will be to contact our support dept.

In this newsgroup, you will only find answers to very specific. I think what

you are looking for is more of a general guidance on how to go about

building this chart.

You can send your code to support@softwarefx.com along with your

questions/concerns.

--

FP

Software FX

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...