Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't zoom plot unless I add another "dummy" plot

Solved!
Go to solution

I have a weird situation...

I programmatically add plots to my ni :Graph (C#)

 

ChartCollection<double, double> chartCollection = new ChartCollection<double, double>();
Plot plot = new Plot(label);
plot.Renderer = new LinePlotRenderer() { Stroke = brush, StrokeThickness = 0.5 };
graph.Data.Add(chartCollection);
graph.Plots.Add(plot);

.....
chartCollection.Append(Initializer.DictionaryOfAllPossibleFrequencySteps[frequencyStep].frequencyVal, realVal);

 

Everything works nicely except when I try to zoom using GraphInteractionPalette, the very LAST added plot stays static while everything else is zooming.

For some reason if I add a "dummy" plot (with no data) when I'm done adding real plots, everything zooms fine... including the last plot.  It's almost like the last plot is not being "released" or something.  Am I missing some call?

 

Thank you.

0 Kudos
Message 1 of 4
(4,688 Views)

Based on your example code, I was able to reproduce the issue and have created a task to fix this for the next release of Measurement Studio.


As a workaround, adding the plot to the graph before the data is added seems to avoid the problem:


    graph.Plots.Add(plot);
    graph.Data.Add(chartCollection);

~ Paul H
0 Kudos
Message 2 of 4
(4,678 Views)
Solution
Accepted by topic author kirko7

Just wanted to let you know this issue (#476665) was fixed in the Measurement Studio 2015 release.

~ Paul H
0 Kudos
Message 3 of 4
(4,328 Views)

Yes, thank you... I tried it right away when got 2015 and confirmed it but forgot to mention here.

Also, offtopic....  GraphInteractionPalette doesn't delay WPF wondow loading anymore.  I know there was a thread about it but not originated by me,

Thanks!

0 Kudos
Message 4 of 4
(4,326 Views)