Jump to content
Software FX Community

Speed issues with adding a lot of labels


User (Legacy)
 Share

Recommended Posts

Hi,

I have a problem/question concerning labels. I was wondering why they

seem to take so long to be added? Example code follows:

m_pChartFX->OpenDataEx((CfxCod) (COD_VALUES|COD_REMOVE), 1, 25000);

for(i=0;i<=25000;i++) {

double val = rand();

m_pChartFX->GetSeries()->GetItem( 0 )->PutYvalue( i, val );

}

m_pChartFX->CloseData(COD_VALUES);

int i1 = GetTickCount();

ICfxAxisPtr axis = chart_fx->GetAxis()->GetItem( AXIS_X );

for(i=0;i<=25000;i++) {

axis->PutLabel( i, "aa" );

}

int i2 = GetTickCount();

int t = i2 - i1;

m_pChartFX->RecalcScale();

When the second loop finally terminated it too almost 7 minutes...just to

add the labels!! Is it supposed to take that long, or is this a possible

bug of some sort? Is there any way that I might be able to speed this

process up at all? I believe that you max is 32,767 labels per axis or

legend( please correct me if I am incorrect )? Thank you.

-Mac Dyer

Link to comment
Share on other sites

Two things that will dramatically improve your speed:

1) Call ClearLabels BEFORE your OpenDataEx to start with an empty label

list, this is much faster than replacing labels that are already there.

2) To further improve performance you can use the StyleEx's CSE_FASTLABELS

this flag however will take away some of the functionality. Check the help

file for details (look for StyleEx).

--

FP

Software FX, Inc.

Link to comment
Share on other sites

what object is CSE_FASTLABELS a flag for?  Is it in Chartfx client/server 5?

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

news:pfZJi$23CHA.1844@webserver1.softwarefx.com...

> Two things that will dramatically improve your speed:

>

> 1) Call ClearLabels BEFORE your OpenDataEx to start with an empty label

> list, this is much faster than replacing labels that are already there.

>

> 2) To further improve performance you can use the StyleEx's CSE_FASTLABELS

> this flag however will take away some of the functionality. Check the help

> file for details (look for StyleEx).

>

> --

> FP

> Software FX, Inc.

>

>

Link to comment
Share on other sites

sorry meant to ask if it was supposed to be CSE_FASTLEGENDS?

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

news:pfZJi$23CHA.1844@webserver1.softwarefx.com...

> Two things that will dramatically improve your speed:

>

> 1) Call ClearLabels BEFORE your OpenDataEx to start with an empty label

> list, this is much faster than replacing labels that are already there.

>

> 2) To further improve performance you can use the StyleEx's CSE_FASTLABELS

> this flag however will take away some of the functionality. Check the help

> file for details (look for StyleEx).

>

> --

> FP

> Software FX, Inc.

>

>

Link to comment
Share on other sites

Also the clearlabels call did not help speed it up very noticeably....maybe

a couple of seconds...if that....

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

news:pfZJi$23CHA.1844@webserver1.softwarefx.com...

> Two things that will dramatically improve your speed:

>

> 1) Call ClearLabels BEFORE your OpenDataEx to start with an empty label

> list, this is much faster than replacing labels that are already there.

>

> 2) To further improve performance you can use the StyleEx's CSE_FASTLABELS

> this flag however will take away some of the functionality. Check the help

> file for details (look for StyleEx).

>

> --

> FP

> Software FX, Inc.

>

>

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...