Jump to content
Software FX Community

Pocket Chart FX .NET - real time possible?


User (Legacy)
 Share

Recommended Posts

I need to update the chart approximately twice per second, with some

reasonible amount of series ( 2+) up to probably about 500 data points, or

so.

I've simulated this type of graph on a 400mhz PDA, and there is a

significant redraw time required (on the order of several seconds per

update).

I cannot use the C++ version of pocket chart because we are using Pocket OS

2003, and the C++ version will not work on this platform.

Is there any way to achieve this type of performance using Pocket Chart FX?

Thanks,

Link to comment
Share on other sites

One of the most important factor here is the display refresh rate also the 

way you are setting the data to the chart.

Can you please give us some more details. What code is running every time

the chart needs to be refreshed ? Where are you reading this data from ?

An easy way to verify whether the display is the bottleneck is to make the

chart invisible and keep running the same code.

--

FP

Software FX

Link to comment
Share on other sites

I put a timer in the main form set for 500ms.  When the timer ticks, I

create a new Random object and fill in new data points for each series. The

application itself is not doing anything else (it is not connected to the

data collection device). This is the code:

Random random = new Random();

chart1.OpenData(COD.Values | COD.Unchange, NUM_CHART_SERIES,

NUM_CHART_POINTS);

if ( m_chartPos < NUM_CHART_POINTS )

{

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

chart1.Value[i, m_chartPos] = i + random.NextDouble();

m_chartPos++;

}

else

{

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

{

for (int j=0; j < NUM_CHART_POINTS - 1; j++)

chart1.Value[i,j] = chart1.Value[i,j+1];

chart1.Value[i, NUM_CHART_POINTS - 1] = i + random.NextDouble();

}

}

chart1.CloseData(COD.Values);

chart1.Refresh();

I've allocated a fixed amount of data points and series in InitChart()

private void InitChart()

{

// Clear out chart data

chart1.OpenData(COD.Values | COD.AllocHidden | COD.Remove,

NUM_CHART_SERIES, NUM_CHART_POINTS);

chart1.CloseData(COD.Values);

m_chartPos = 0;

chart1.AxisX.Min = 0;

chart1.AxisX.Max = 120;

chart1.AxisY.Max = 10;

chart1.AxisY.Min = 0;

}

num series is 2, num points is 240.

When this runs on the PDA, you can actually see each series being drawn,

with a noticeable flicker before each update. As the number of data points

displayed grows, the refresh time increases.

We're writing a data collection app, and it would be really nice if the

chart could give me some kind of reasonable refresh rate. Right now, it

looks like there's no buffering of the display going on at all.

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

news:1Q1bVQtjEHA.3888@webserver3.softwarefx.com...

> One of the most important factor here is the display refresh rate also the

> way you are setting the data to the chart.

>

> Can you please give us some more details. What code is running every time

> the chart needs to be refreshed ? Where are you reading this data from ?

>

> An easy way to verify whether the display is the bottleneck is to make the

> chart invisible and keep running the same code.

>

> --

> FP

> Software FX

>

>

Link to comment
Share on other sites

One thing, accessing:

chart1.Value[i,j+1];

At some point is accessing chart1.Value[i, NUM_CHART_POINTS] (when j =

NUM_CHART_POINTS - 1) which re-allocates the data and can cause a

performance hit.

Other than I don't see anything that can be optimized as far as this code.

> Right now, it looks like there's no buffering of the display going on at

> all.

Unfortunately, I believe Double Buffering is not supported in the .NET

Compact Framework. I will double-check.

Did you check making the chart invisible ? If making the chart invisible

runs at a "reasonable speed" then we don't need to look at this code but we

need to look at chart settings that may improve your drawing performance.

Things that will affect the drawing performance:

- Gallery Type: An Area chart for example will be in most cases, slower than

a line chart.

- If markers are being shown, circular markers are slower than rectangles

and other shapes

- Having borders around the markers (Border property) also affects the

performance

- Having Per-Point attributes affects the performance

--

FP

Software FX

Link to comment
Share on other sites

I guess I missed some info:

- the chart type is X line

- there are no markers being shown

- there are no per-point attributes

just straight xy line graphing, as far as I could make it.

The code you mentioned is for scrolling the window, which actually has never

been called, since I only run the demo for 30 seconds to watch performance.

I'm not sure about your comment about "making the chart invisible and check

for reasonable speed". At present, the chart is the only object being

updated with random data - there is no other code running that impacts

performance. What I'm trying to test is whether the graph can update

quickly enough for a pleasant display, e.g. quick updates and no flicker.

If I make the chart invisible, I would get flicker, certainly.

Are there any plans to support the COD.Realtime type features on pocket

chart Fx.NET? If not, are there plans to update Pocket Chart to support

Pocket PC 2003? (it does have a real-time property)

Thanks

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

news:IeneN%231jEHA.3152@webserver3.softwarefx.com...

> One thing, accessing:

>

> chart1.Value[i,j+1];

>

> At some point is accessing chart1.Value[i, NUM_CHART_POINTS] (when j =

> NUM_CHART_POINTS - 1) which re-allocates the data and can cause a

> performance hit.

>

> Other than I don't see anything that can be optimized as far as this code.

>

> > Right now, it looks like there's no buffering of the display going on at

> > all.

>

> Unfortunately, I believe Double Buffering is not supported in the .NET

> Compact Framework. I will double-check.

>

>

> Did you check making the chart invisible ? If making the chart invisible

> runs at a "reasonable speed" then we don't need to look at this code but

we

> need to look at chart settings that may improve your drawing performance.

>

> Things that will affect the drawing performance:

>

> - Gallery Type: An Area chart for example will be in most cases, slower

than

> a line chart.

> - If markers are being shown, circular markers are slower than rectangles

> and other shapes

> - Having borders around the markers (Border property) also affects the

> performance

> - Having Per-Point attributes affects the performance

>

> --

> FP

> Software FX

>

>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...