<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: WPF graphs: insert plot in Measurement Studio for .NET Languages</title>
    <link>https://forums.ni.com/t5/Measurement-Studio-for-NET/WPF-graphs-insert-plot/m-p/2226208#M13402</link>
    <description>&lt;P&gt;nope, I use LineRenderer, PointRenderer, or both (as a group)&lt;/P&gt;</description>
    <pubDate>Tue, 20 Nov 2012 08:01:26 GMT</pubDate>
    <dc:creator>eugenem</dc:creator>
    <dc:date>2012-11-20T08:01:26Z</dc:date>
    <item>
      <title>WPF graphs: insert plot</title>
      <link>https://forums.ni.com/t5/Measurement-Studio-for-NET/WPF-graphs-insert-plot/m-p/2224926#M13394</link>
      <description>&lt;P&gt;How do I insert or move plot to be the first?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;graph.Plots.Insert(0, _newPlot) &amp;nbsp;throws exception regarding incorrect index&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;graph.Plots.Add( _newPlot ) &amp;nbsp;appends a plot, so it's the last one&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;_newPlot.Index is read-only&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2012 12:43:06 GMT</pubDate>
      <guid>https://forums.ni.com/t5/Measurement-Studio-for-NET/WPF-graphs-insert-plot/m-p/2224926#M13394</guid>
      <dc:creator>eugenem</dc:creator>
      <dc:date>2012-11-19T12:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: WPF graphs: insert plot</title>
      <link>https://forums.ni.com/t5/Measurement-Studio-for-NET/WPF-graphs-insert-plot/m-p/2225840#M13399</link>
      <description>&lt;P&gt;Hi eugenem,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you confirm if you are using any BarPlotRenderers or AreaPlotRenderers in the plots in front of which you are inserting your new plot?&amp;nbsp;I have been able to recreate this issue with those conditions and will file an appropriate report.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As a workaround, if you need to insert on the fly, do not use those PlotRenderers.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2012 22:27:24 GMT</pubDate>
      <guid>https://forums.ni.com/t5/Measurement-Studio-for-NET/WPF-graphs-insert-plot/m-p/2225840#M13399</guid>
      <dc:creator>JeffL</dc:creator>
      <dc:date>2012-11-19T22:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: WPF graphs: insert plot</title>
      <link>https://forums.ni.com/t5/Measurement-Studio-for-NET/WPF-graphs-insert-plot/m-p/2226208#M13402</link>
      <description>&lt;P&gt;nope, I use LineRenderer, PointRenderer, or both (as a group)&lt;/P&gt;</description>
      <pubDate>Tue, 20 Nov 2012 08:01:26 GMT</pubDate>
      <guid>https://forums.ni.com/t5/Measurement-Studio-for-NET/WPF-graphs-insert-plot/m-p/2226208#M13402</guid>
      <dc:creator>eugenem</dc:creator>
      <dc:date>2012-11-20T08:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: WPF graphs: insert plot</title>
      <link>https://forums.ni.com/t5/Measurement-Studio-for-NET/WPF-graphs-insert-plot/m-p/2226762#M13409</link>
      <description>&lt;P&gt;Hmm, I am unable to recreate it with those situations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you post some of your XAML related to the renderers? Or anything else you think is relevant to the renderers.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Nov 2012 15:54:11 GMT</pubDate>
      <guid>https://forums.ni.com/t5/Measurement-Studio-for-NET/WPF-graphs-insert-plot/m-p/2226762#M13409</guid>
      <dc:creator>JeffL</dc:creator>
      <dc:date>2012-11-20T15:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: WPF graphs: insert plot</title>
      <link>https://forums.ni.com/t5/Measurement-Studio-for-NET/WPF-graphs-insert-plot/m-p/2229636#M13430</link>
      <description>&lt;P&gt;I build them from code, but there are some details:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;_newPlot.Renderer&lt;BR /&gt;{PlotRendererGroup}&lt;BR /&gt; [NationalInstruments.Controls.Rendering.PlotRendererGroup]: {PlotRendererGroup}&lt;BR /&gt; base {System.Windows.Freezable}: {PlotRendererGroup}&lt;BR /&gt; SupportedRenderModes: Raster | Vector&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;(_newPlot.Renderer as PlotRendererGroup).PlotRenderers&lt;BR /&gt;{PlotRendererCollection: Count=2}&lt;BR /&gt; [0]: {LinePlotRenderer}&lt;BR /&gt; [1]: {PointPlotRenderer}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;at then I do:&lt;/P&gt;
&lt;P&gt;graph.Plots.Insert(0, _newPlot);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and get exception:&lt;/P&gt;
&lt;P&gt;Index was out of range. Must be non-negative and less than the size of the collection.&lt;BR /&gt;Parameter name: index&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;even like this it fails:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;_newPlot = new Plot();&lt;/P&gt;
&lt;P&gt;_newPlot.Renderer = new LinePlotRenderer() { Stroke = Brushes.White };&lt;/P&gt;
&lt;P&gt;graph.Plots.Insert(0, _newPlot);&lt;/P&gt;</description>
      <pubDate>Thu, 22 Nov 2012 10:51:59 GMT</pubDate>
      <guid>https://forums.ni.com/t5/Measurement-Studio-for-NET/WPF-graphs-insert-plot/m-p/2229636#M13430</guid>
      <dc:creator>eugenem</dc:creator>
      <dc:date>2012-11-22T10:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: WPF graphs: insert plot</title>
      <link>https://forums.ni.com/t5/Measurement-Studio-for-NET/WPF-graphs-insert-plot/m-p/2233692#M13444</link>
      <description>&lt;P&gt;Does the error message provide any additional information? Can you provide a screenshot? Since that the error is referring to the index of a collection, I would try using the plot collection instead of plot class.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2012 23:30:43 GMT</pubDate>
      <guid>https://forums.ni.com/t5/Measurement-Studio-for-NET/WPF-graphs-insert-plot/m-p/2233692#M13444</guid>
      <dc:creator>Anjelica-W</dc:creator>
      <dc:date>2012-11-26T23:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: WPF graphs: insert plot</title>
      <link>https://forums.ni.com/t5/Measurement-Studio-for-NET/WPF-graphs-insert-plot/m-p/2235400#M13454</link>
      <description>&lt;P&gt;It looks like this is an issue with how the graph handles changing renderers associated with plots.&lt;/P&gt;
&lt;BR /&gt;
&lt;P&gt;To workaround this, I would try adding a call to &lt;CODE&gt;graph.Refresh();&lt;/CODE&gt; after inserting the new plot, which should force the graph to update all plots immediately.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2012 22:07:11 GMT</pubDate>
      <guid>https://forums.ni.com/t5/Measurement-Studio-for-NET/WPF-graphs-insert-plot/m-p/2235400#M13454</guid>
      <dc:creator>phansen</dc:creator>
      <dc:date>2012-11-27T22:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: WPF graphs: insert plot</title>
      <link>https://forums.ni.com/t5/Measurement-Studio-for-NET/WPF-graphs-insert-plot/m-p/2235908#M13458</link>
      <description>&lt;P&gt;Hi, Paul!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But it crashes the moment I insert plot. I won't be able to call Refresh...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, Plots.Add does work, but I'd like to control order of the plots as well.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2012 08:24:51 GMT</pubDate>
      <guid>https://forums.ni.com/t5/Measurement-Studio-for-NET/WPF-graphs-insert-plot/m-p/2235908#M13458</guid>
      <dc:creator>eugenem</dc:creator>
      <dc:date>2012-11-28T08:24:51Z</dc:date>
    </item>
    <item>
      <title>Re: WPF graphs: insert plot</title>
      <link>https://forums.ni.com/t5/Measurement-Studio-for-NET/WPF-graphs-insert-plot/m-p/2237004#M13472</link>
      <description>&lt;P&gt;Sorry that didn’t help (as Jeff mentioned, we are having trouble reproducing your original error, so this may be due to additional state configured on the graph, like render mode or data).&lt;/P&gt;
&lt;BR /&gt;
&lt;P&gt;From your code snippet, it looks like you are only setting the &lt;A href="http://zone.ni.com/reference/en-XX/help/372636F-01/mstudiowebhelp/html/32964ae/" target="_blank"&gt;&lt;CODE&gt;Renderer&lt;/CODE&gt;&lt;/A&gt; property on the new plot. If so, another workaround would be to insert the renderer into the graph’s &lt;A href="http://zone.ni.com/reference/en-XX/help/372636F-01/mstudiowebhelp/html/b8fedabe/" target="_blank"&gt;&lt;CODE&gt;DefaultPlotRenderers&lt;/CODE&gt;&lt;/A&gt; collection, rather than changing the &lt;A href="http://zone.ni.com/reference/en-XX/help/372636F-01/mstudiowebhelp/html/f723b870/" target="_blank"&gt;&lt;CODE&gt;Plots&lt;/CODE&gt;&lt;/A&gt; collection.&lt;/P&gt;
&lt;BR /&gt;
&lt;P&gt;If you do need to configure other plot members, the only other workaround I can think of for the currrent Measurement Studio release would be to use &lt;CODE&gt;Add&lt;/CODE&gt; as you suggested, and assign the renderer to &lt;CODE&gt;graph.Plots[insertIndex]&lt;/CODE&gt; instead of to &lt;CODE&gt;_newPlot&lt;/CODE&gt; (and update the properties of all plots after the insert index).&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2012 19:35:24 GMT</pubDate>
      <guid>https://forums.ni.com/t5/Measurement-Studio-for-NET/WPF-graphs-insert-plot/m-p/2237004#M13472</guid>
      <dc:creator>phansen</dc:creator>
      <dc:date>2012-11-28T19:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: WPF graphs: insert plot</title>
      <link>https://forums.ni.com/t5/Measurement-Studio-for-NET/WPF-graphs-insert-plot/m-p/2378214#M14051</link>
      <description>&lt;P&gt;Just wanted to let you know this issue was fixed in the &lt;A href="http://www.ni.com/white-paper/14476/en" target="_blank"&gt;Measurement Studio 2013&lt;/A&gt; release.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2013 17:49:58 GMT</pubDate>
      <guid>https://forums.ni.com/t5/Measurement-Studio-for-NET/WPF-graphs-insert-plot/m-p/2378214#M14051</guid>
      <dc:creator>phansen</dc:creator>
      <dc:date>2013-04-05T17:49:58Z</dc:date>
    </item>
  </channel>
</rss>

