Jump to content
Software FX Community

Mouse over causes null refeence exception


User (Legacy)

Recommended Posts

I have a chart that has multiple series and multiple axis. After the chart

is created, if I mouse over it, a Null Reference Exception is thrown by the

chart FX dll. Initially I thought it has to do with the tooltip/tag I set.

But after I comment out the tag setting lines, the exception still happens.

I am not catching any mouse over event.

What could this be? I know it is difficult to pin point it without seeing

the code. But can you give me some general pointers as what would be the

likely reasons?

Thanks.

- Harry

Link to comment
Share on other sites

Two things that could help us troubleshoot this issue

- Save the chart (using the export method), hopefully when we import the

file we will be able to repro this exception and fix it

- Send us the stack of the NullReferenceException.

--

Regards,

JC

Software FX Support

"Hai Ning" <ninghai@gmail.com> wrote in message

news:%23bFURT64EHA.1120@webserver3.softwarefx.com...

>I have a chart that has multiple series and multiple axis. After the chart

> is created, if I mouse over it, a Null Reference Exception is thrown by

> the

> chart FX dll. Initially I thought it has to do with the tooltip/tag I set.

> But after I comment out the tag setting lines, the exception still

> happens.

> I am not catching any mouse over event.

>

> What could this be? I know it is difficult to pin point it without seeing

> the code. But can you give me some general pointers as what would be the

> likely reasons?

>

> Thanks.

>

> - Harry

>

>

Link to comment
Share on other sites

Here is the exported chart in binary format.

There is no detailed stack information other than the following:

An unhandled exception of type "System.NullReferenceException" ocurred in

chartfx.dll

Additional Information: Object reference not set to an instance of an

object.

- Harry

"Software FX Support" <noreply@none.com> wrote in message

news:Q3Jm%23U74EHA.1120@webserver3.softwarefx.com...

> Two things that could help us troubleshoot this issue

>

> - Save the chart (using the export method), hopefully when we import the

> file we will be able to repro this exception and fix it

>

> - Send us the stack of the NullReferenceException.

>

> --

> Regards,

>

> JC

> Software FX Support

> "Hai Ning" <ninghai@gmail.com> wrote in message

> news:%23bFURT64EHA.1120@webserver3.softwarefx.com...

> >I have a chart that has multiple series and multiple axis. After the

chart

> > is created, if I mouse over it, a Null Reference Exception is thrown by

> > the

> > chart FX dll. Initially I thought it has to do with the tooltip/tag I

set.

> > But after I comment out the tag setting lines, the exception still

> > happens.

> > I am not catching any mouse over event.

> >

> > What could this be? I know it is difficult to pin point it without

seeing

> > the code. But can you give me some general pointers as what would be the

> > likely reasons?

> >

> > Thanks.

> >

> > - Harry

> >

> >

>

>

Link to comment
Share on other sites

I am attaching a chart that causes the problem. also i managed to get a

screenshot of the the error stack. please ignore the other attachment i made

yesterday.

also, i suspect it has to do the way i create multi axes. the description in

the documentation is kind of vague. for instance, after numerous experiment,

i found that i have to call chart.Axis[i].Visible = true LAST otherwise it

throws exceptions, and i have to set the min of the axis to 0 AFTER i

populate the chart, otherwise it throws exception...

here is what i am doing:

=====================================

for (i=0; i < numOfAxis; i++)

{

chart.Series[i].YAxis = (YAxis)i;

// make the axes appear on alternate side of the chart.

chart.Axis[i].Position = (i%2 == 0 ? AxisPosition.Near :

AxisPosition.Far);

chart.Axis[i].Visible = true;

}

PopulateChart();

for (i = 0; i < numOfAxis; i +)

chart.Axis[i].Min = 0;

chart.AxesStyle = AxesStyle.Math;

chart.RecalcScale():

=====================================

can you tell me if there is anything wrong with this? or what is the proper

sequence of code for adding additional chart axes.

thank you.

- harry

"Software FX Support" <noreply@none.com> wrote in message

news:Q3Jm%23U74EHA.1120@webserver3.softwarefx.com...

> Two things that could help us troubleshoot this issue

>

> - Save the chart (using the export method), hopefully when we import the

> file we will be able to repro this exception and fix it

>

> - Send us the stack of the NullReferenceException.

>

> --

> Regards,

>

> JC

> Software FX Support

> "Hai Ning" <ninghai@gmail.com> wrote in message

> news:%23bFURT64EHA.1120@webserver3.softwarefx.com...

> >I have a chart that has multiple series and multiple axis. After the

chart

> > is created, if I mouse over it, a Null Reference Exception is thrown by

> > the

> > chart FX dll. Initially I thought it has to do with the tooltip/tag I

set.

> > But after I comment out the tag setting lines, the exception still

> > happens.

> > I am not catching any mouse over event.

> >

> > What could this be? I know it is difficult to pin point it without

seeing

> > the code. But can you give me some general pointers as what would be the

> > likely reasons?

> >

> > Thanks.

> >

> > - Harry

> >

> >

>

>

Link to comment
Share on other sites

Code looks ok.

What do I have to do to get the exception ? I tried highlighting random cell

in the data editor but I was unable to get it to crash.

As for the order in which things are done, it shouldn't matter.

You can call chart.Axis[i].Visible = true before or after setting the data.

If you have a sample that produces a crash when you do it in a different

order please send it to us.

Min and Max can be set either before or after the data, however doing after

will ensure that those are the values that remain. Otherwise the process of

setting data may modify Min and Max to accommodate new values. Set AutoScale

= false if you don't want this.

One thing that is your responsibility is leaving all axes properly

initialized. If by the time the chart is drawn, the Min and Max of an axis

is not initialized (it is reset but never assigned) you will run into

problems.

For debugging purposes you may list the values of Min and Max of all you

axis after the data is set and after RecalcScale is called to makes sure all

of them are correct.

--

FP

Software FX

Link to comment
Share on other sites

This is one that is sure to crash.

What is wrong with my chart? I generated this chart using code, and exported

to binary format. I am attaching a C# project that can load this chart and

display it.

Whenever I mouse over the chart, the legend or the data editor row of the

second and the third series, a ChartFX NullReferenceException is thrown.

Can you please take a look and tell me why this happens? The way I

generated this chart is quite complicated, but the resulting chart itself is

very simply. Am I missing something when I generate the chart?

Thanks.

Link to comment
Share on other sites

CharFX.dll version:

6.2.1539.21391

Thanks.

- Harry

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

news:yHSa$MR6EHA.3492@webserver3.softwarefx.com...

> I run your app, hover the mouse over the data editor, series legend (any

> series), or the chart and get no exception.

>

> Are you using the latest SP ?

>

> What is the file version of your ChartFX.dll ?

>

> --

> FP

> Software FX

>

>

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...