Graph load bug

Nov 25, 2010 at 11:29 AM
Edited Nov 25, 2010 at 12:45 PM

Hello,

Before I create a new issue post I want to know your opinion about the following.

I made a sample project. The application has an tab control with 2 tab items.
A ChartPlotter with an InjectedPlotter and two axes is created in the constructor of the window.
The window is interested in the loaded event of the ChartPlotter. If the event occured then tabcontrol index will set to the second tab item.

Now the issue. Selecting the first tab item releases following exception.
"Cannot add item to Plotter - first it should be removed from another Plotter." in Microsoft.Research.DynamicDataDisplay.Plotter.OnChildAdded(IPlotterElement child)

In my opinion the issue is related to "Dispatcher.BeginInvoke((Action)(() => ExecuteWaitingChildrenAdditions()), DispatcherPriority.Background);" in
the "void IPlotterElement.OnPlotterAttached(Plotter plotter)" method of the InjectedPlotter class.

Please try it out and give me response what I can do or what you will do to solve the problem.

(I used the nightly build 0.3.4703.0)

http://dl.dropbox.com/u/15682053/GraphLoadBug.zip

 

Best regards,

Björn

Editor
Nov 25, 2010 at 12:54 PM

Hello, Björn,

You know, i have forgotten why did I create InjectedPlotter. If you (or somebody else) can explain me what behavior should be in TwoIndependentAxes sample, I will be very much grateful to you!

My mail is thecentury@gmail.com,

Skype- mikhail.brinchuk

 

Best regards,

Mikhail.

Nov 25, 2010 at 1:00 PM

Hi Mikhail,

One of the things that you can do with the InjectedPlotter and Plotter is to plot two charts with different verticle axis but the same horizontal axis and be able to move the charts so that they overlay each other.

David

Editor
Nov 25, 2010 at 1:03 PM

David,

Am I right that two charts should both pan while panning horizontal axis?

And only one chart should move when panning any vertical axes?

Mikhail.

 

P.S. I have started a new D3 branch here - http://d3future.codeplex.com/, so you are welcome to move all discussions there.

It doesn't contain any stable yet, but I'm working hard)

Nov 25, 2010 at 1:04 PM

D3 - Independent Y-Axis on ChartPlotter Jul 28  - david

Nov 25, 2010 at 1:05 PM

Yes, you are correct; however, they should zoom together.  - david

Dec 7, 2010 at 9:46 AM

Hello,

I played a little bit with the source code of InjectedPlotter.
Result was that when you delete the following code, the problem was fixed.

        protected override void OnChildAdded(IPlotterElement child)
        {
            base.OnChildAdded(child);

            if (plotter != null)
            {
                plotter.PerformChildChecks = false;
                try
                {
                    plotter.Children.Add(child);
                }
                finally
                {
                    plotter.PerformChildChecks = true;
                }
            }
        }

I also deleted protected override void OnChildRemoving(IPlotterElement child)
The plotter in the method is the ChartPlotter object.
Know the question. Can someone tell me why a child is explicitly added to a ChartPlotter.
What problems could happen if i decide to remove the overridden method.

Here are the sample projects. One is working with the described changes.

http://dl.dropbox.com/u/15682053/GraphLoadBug_fixed.zip

http://dl.dropbox.com/u/15682053/GraphLoadBug.zip

 

 

Editor
Dec 20, 2010 at 12:30 PM
Hi David,
can you please take a look at TwoIndependentAxes sample in D3.Current solution in http://d3future.codeplex.com/SourceControl/list/changesets
Seems like I have implemented what you want.
--
Best regards,
Mikhail Brinchuk,
My freelance CV - searching for remote work
Jan 26, 2012 at 2:12 PM

This was exactly what I was looking for! The conjunction works also now for the y-axis!

Great job!