Jump to content
Software FX Community

Context menu (Legend Box) is disabled


Recommended Posts

please see attachment for the binary file.

It is a 3d bar chart with multiple series.

Another interesting fact, if I show the "Data Editor", then the "Legend Box"

item is enabled.

see attachment.

Thanks

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

news:dPkpZKNUFHA.2608@webserver3.softwarefx.com...

> We will need more details on when this happens, what type of chart,

legends

> set, etc.

>

> If you can reproduce the problem you can export the chart to a binary file

> and attach it to your post.

>

> --

> FP

> Software FX

>

>

Link to post
Share on other sites

Looks like it has something to do with removing items from the context menu.

Here is my sample code:

Command cmd = chart1.Commands[(int)CommandID.ContextMenuBack];

//remove separator and toolbar options

cmd.RemoveSubCommand(0); //remove toolbar --- Comment out this line will

enable "Legend Box" item.

chart1.ClearData(ClearDataFlag.Values);

chart1.SerLeg.Clear();

int series = 1;

chart1.OpenData(COD.Values | COD.AllocHidden, series, (int)COD.Unknown);

chart1.AxisY.DataFormat.Decimals = 2;

// chart1.OpenData(COD.XValues, 1, (int)COD.Unknown);

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

{

int count = series;

Random rand = new Random(100);

chart1.SerLeg.Add("Series " + i + 1);

chart1.AxisX.Label.Add("Item " + i + 1);

for (int k = 0; k < count; k += 1)

{

chart1.Value[i, k] = rand.NextDouble();

// chart1.XValue[0, k] = k;

//chart1.Legend[k] = "Label " + k;

}

}

chart1.CloseData(COD.Values | COD.AllocHidden);

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

news:RVTjvFxUFHA.2236@webserver3.softwarefx.com...

> I'm unable to reproduce the problem.

>

> When I read the binary file you sent, I get the Legend Box option enabled.

>

> I think you encounter a bug that has to do with the order in which you are

> doing things, I would need a little sample program that reproduces the

> problem.

>

> --

> FP

> Software FX

>

>

post-2107-13922379575541_thumb.jpg

Link to post
Share on other sites

I found the problem.

The Add method in SerLeg is not updating the commands,

replace the line:

chart1.SerLeg.Add("Series " + i + 1);

by

chart1.SerLeg[i] = "Series " + i + 1; // Equivalent code

I will log this as a bug so that it gets fixed in the next SP.

--

Francisco Padron

www.chartfx.com

Link to post
Share on other sites

I did try that as well..It doesn't work.

if I commented these 2 lines, then it works (regardless of "Add" or "=" op).

Command cmd = chart1.Commands[(int)CommandID.ContextMenuBack];

cmd.RemoveSubCommand(0); //remove toolbar

Please investigate further.

Minh

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

news:GRdUMNZVFHA.204@webserver3.softwarefx.com...

> I found the problem.

>

> The Add method in SerLeg is not updating the commands,

>

> replace the line:

>

> chart1.SerLeg.Add("Series " + i + 1);

> by

>

> chart1.SerLeg[i] = "Series " + i + 1; // Equivalent code

>

>

> I will log this as a bug so that it gets fixed in the next SP.

>

> --

> Francisco Padron

> www.chartfx.com

>

>

Link to post
Share on other sites

Version: 6.2.1342.0

Yes, I did. See the attached sample project.

Ming

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

news:GRdUMNZVFHA.204@webserver3.softwarefx.com...

> I found the problem.

>

> The Add method in SerLeg is not updating the commands,

>

> replace the line:

>

> chart1.SerLeg.Add("Series " + i + 1);

> by

>

> chart1.SerLeg[i] = "Series " + i + 1; // Equivalent code

>

>

> I will log this as a bug so that it gets fixed in the next SP.

>

> --

> Francisco Padron

> www.chartfx.com

>

>

Link to post
Share on other sites

Yes, you are right!

I thought, the pie chart would be the same.

Since, I got the legend option on and off just based on those 2 lines...

Anyway, I tried your suggestion in my real chart (3D bar), and it fixes the

problem.

Thanks again.

Ming

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

news:GRdUMNZVFHA.204@webserver3.softwarefx.com...

> I found the problem.

>

> The Add method in SerLeg is not updating the commands,

>

> replace the line:

>

> chart1.SerLeg.Add("Series " + i + 1);

> by

>

> chart1.SerLeg[i] = "Series " + i + 1; // Equivalent code

>

>

> I will log this as a bug so that it gets fixed in the next SP.

>

> --

> Francisco Padron

> www.chartfx.com

>

>

Link to post
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.

Loading...
×
×
  • Create New...