<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Felice Pollano Blog - D3</title>
    <link>http://www.felicepollano.com/</link>
    <description>The official Fatica Labs Blog!</description>
    <language>en-us</language>
    <copyright>Felice Pollano</copyright>
    <lastBuildDate>Fri, 07 Oct 2011 16:24:31 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.3.9074.18820</generator>
    <managingEditor>felice@felicepollano.com</managingEditor>
    <webMaster>felice@felicepollano.com</webMaster>
    <item>
      <trackback:ping>http://www.felicepollano.com/Trackback.aspx?guid=654cd3f0-7bb1-4f7f-934c-19c3c589bcde</trackback:ping>
      <pingback:server>http://www.felicepollano.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.felicepollano.com/PermaLink.aspx?guid=654cd3f0-7bb1-4f7f-934c-19c3c589bcde</pingback:target>
      <dc:creator>Felice Pollano</dc:creator>
      <wfw:comment>http://www.felicepollano.com/CommentView.aspx?guid=654cd3f0-7bb1-4f7f-934c-19c3c589bcde</wfw:comment>
      <wfw:commentRss>http://www.felicepollano.com/SyndicationService.asmx/GetEntryCommentsRss?guid=654cd3f0-7bb1-4f7f-934c-19c3c589bcde</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
The current implementation using <strong>SynchroVisible</strong> and <strong>With</strong> fails
when there is more than three chart to synchronize. So I modified the code and added
a central agent to keep in synch more charts. We just need to define an instance of
it as a resource:
</p>
        <p>
          <span style="color: blue">&lt;</span>
          <span style="color: #a31515">Window.Resources</span>
          <span style="color: blue">&gt;<br />
       …</span>
        </p>
        <pre class="code">
          <span style="color: blue">
          </span>
          <span style="color: blue">
            <strong>&lt;</strong>
          </span>
          <strong>
            <span style="color: #a31515">ddd</span>
            <span style="color: blue">:</span>
            <span style="color: #a31515">MultiChartSynchronizer </span>
            <span style="color: red">x</span>
            <span style="color: blue">:</span>
            <span style="color: red">Key</span>
          </strong>
          <span style="color: blue">
            <strong>="mainSynchro"/&gt;</strong> &lt;/</span>
          <span style="color: #a31515">Window.Resources</span>
          <span style="color: blue">&gt; </span>
        </pre>
        <p>
          <span style="color: blue">
          </span>
        </p>
        <a href="http://11011.net/software/vspaste">
        </a>
        <p>
and then “subscribe” each chart to keep in synch with:
</p>
        <pre class="code">
          <span style="color: blue">&lt;</span>
          <span style="color: #a31515">ddd</span>
          <span style="color: blue">:</span>
          <span style="color: #a31515">ChartPlotter </span>
          <span style="color: red">x</span>
          <span style="color: blue">:</span>
          <span style="color: red">Name</span>
          <span style="color: blue">="price" </span>
          <span style="color: red">ddd</span>
          <span style="color: blue">:</span>
          <span style="color: red">SynchroVisible.Axis</span>
          <span style="color: blue">="X" </span>
        </pre>
        <h5>
          <strong>
            <span style="color: red">ddd</span>
            <span style="color: blue">:</span>
            <span style="color: red">SynchroVisible.Using</span>
            <span style="color: blue">="{</span>
            <span style="color: #a31515">StaticResource </span>
            <span style="color: red">mainSynchro</span>
          </strong>
          <span style="color: blue">
            <strong>}"</strong>
          </span>
        </h5>
        <pre class="code">
          <span style="color: blue">
          </span>
          <span style="color: red">LegendVisibility</span>
          <span style="color: blue">="Hidden" </span>
          <span style="color: red">NewLegendVisible</span>
          <span style="color: blue">="False" </span>
          <span style="color: red">Grid.Row</span>
          <span style="color: blue">="1"&gt; </span>
        </pre>
        <pre class="code">
          <a href="http://www.felicepollano.com/public/WindowsLiveWriter/D3Multiplechartsynchronization_102DD/image_2.png">
            <img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.felicepollano.com/public/WindowsLiveWriter/D3Multiplechartsynchronization_102DD/image_thumb.png" width="329" height="248" />
          </a>
        </pre>
        <p>
obviously we can have multiple instance of synchronizer object to create more context
in which chart align.
</p>
        <p>
          <a href="https://bitbucket.org/Felice_Pollano/d3redux">You can find and follow this
project on Bitbucket.</a>
        </p>
        <img width="0" height="0" src="http://www.felicepollano.com/aggbug.ashx?id=654cd3f0-7bb1-4f7f-934c-19c3c589bcde" />
      </body>
      <title>D3 Multiple chart synchronization</title>
      <guid isPermaLink="false">http://www.felicepollano.com/PermaLink.aspx?guid=654cd3f0-7bb1-4f7f-934c-19c3c589bcde</guid>
      <link>http://www.felicepollano.com/2011/10/07/D3MultipleChartSynchronization.aspx</link>
      <pubDate>Fri, 07 Oct 2011 16:24:31 GMT</pubDate>
      <description>&lt;p&gt;
The current implementation using &lt;strong&gt;SynchroVisible&lt;/strong&gt; and &lt;strong&gt;With&lt;/strong&gt; fails
when there is more than three chart to synchronize. So I modified the code and added
a central agent to keep in synch more charts. We just need to define an instance of
it as a resource:
&lt;/p&gt;
&lt;p&gt;
&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Window.Resources&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; …&lt;/span&gt;
&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&lt;/span&gt;&lt;span style="color: blue"&gt; &lt;strong&gt;&amp;lt;&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="color: #a31515"&gt;ddd&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;MultiChartSynchronizer &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Key&lt;/span&gt;&lt;/strong&gt;&lt;span style="color: blue"&gt;&lt;strong&gt;="mainSynchro"/&amp;gt;&lt;/strong&gt; &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Window.Resources&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt; &lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
&lt;span style="color: blue"&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt; 
&lt;p&gt;
and then “subscribe” each chart to keep in synch with:
&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ddd&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;ChartPlotter &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;="price" &lt;/span&gt;&lt;span style="color: red"&gt;ddd&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;SynchroVisible.Axis&lt;/span&gt;&lt;span style="color: blue"&gt;="X" &lt;/span&gt;&lt;/pre&gt;
&lt;h5&gt;&lt;strong&gt;&lt;span style="color: red"&gt;ddd&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;SynchroVisible.Using&lt;/span&gt;&lt;span style="color: blue"&gt;="{&lt;/span&gt;&lt;span style="color: #a31515"&gt;StaticResource &lt;/span&gt;&lt;span style="color: red"&gt;mainSynchro&lt;/span&gt;&lt;/strong&gt;&lt;span style="color: blue"&gt;&lt;strong&gt;}"&lt;/strong&gt;&lt;/span&gt;
&lt;/h5&gt;
&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&lt;/span&gt;&lt;span style="color: red"&gt;LegendVisibility&lt;/span&gt;&lt;span style="color: blue"&gt;="Hidden" &lt;/span&gt;&lt;span style="color: red"&gt;NewLegendVisible&lt;/span&gt;&lt;span style="color: blue"&gt;="False" &lt;/span&gt;&lt;span style="color: red"&gt;Grid.Row&lt;/span&gt;&lt;span style="color: blue"&gt;="1"&amp;gt; &lt;/span&gt;&lt;/pre&gt;&lt;pre class="code"&gt;&lt;a href="http://www.felicepollano.com/public/WindowsLiveWriter/D3Multiplechartsynchronization_102DD/image_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.felicepollano.com/public/WindowsLiveWriter/D3Multiplechartsynchronization_102DD/image_thumb.png" width="329" height="248"&gt;&lt;/a&gt; &lt;/pre&gt;
&lt;p&gt;
obviously we can have multiple instance of synchronizer object to create more context
in which chart align.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="https://bitbucket.org/Felice_Pollano/d3redux"&gt;You can find and follow this
project on Bitbucket.&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.felicepollano.com/aggbug.ashx?id=654cd3f0-7bb1-4f7f-934c-19c3c589bcde" /&gt;</description>
      <comments>http://www.felicepollano.com/CommentView.aspx?guid=654cd3f0-7bb1-4f7f-934c-19c3c589bcde</comments>
      <category>D3</category>
      <category>WPF</category>
    </item>
    <item>
      <trackback:ping>http://www.felicepollano.com/Trackback.aspx?guid=fb3df452-aeeb-49a3-8f8e-405ce85d9717</trackback:ping>
      <pingback:server>http://www.felicepollano.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.felicepollano.com/PermaLink.aspx?guid=fb3df452-aeeb-49a3-8f8e-405ce85d9717</pingback:target>
      <dc:creator>Felice Pollano</dc:creator>
      <wfw:comment>http://www.felicepollano.com/CommentView.aspx?guid=fb3df452-aeeb-49a3-8f8e-405ce85d9717</wfw:comment>
      <wfw:commentRss>http://www.felicepollano.com/SyndicationService.asmx/GetEntryCommentsRss?guid=fb3df452-aeeb-49a3-8f8e-405ce85d9717</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Just add a new feature to decide where to place the vertical axis: left or right aligned
to the plot area. Here the property usage:
</p>
        <pre class="code">
          <span style="color: blue">&lt;</span>
          <span style="color: #a31515">ddd</span>
          <span style="color: blue">:</span>
          <span style="color: #a31515">ChartPlotter </span>
          <span style="color: red">
            <font style="background-color: #ffff00">MainVerticalAxisPlacement</font>
          </span>
          <span style="color: blue">
            <font style="background-color: #ffff00">="Right"</font>
          </span>
          <span style="color: red">…</span>
          <span style="color: blue">&gt; </span>
        </pre>
        <p>
 
</p>
        <p align="justify">
A modification was necessary even in the <strong><em>WidthSpring</em></strong> element,
the one that allow us to keep more than one chart synchronized on the X axis ignoring
the space taken by the label area. It is now possible to specify that the <em><strong>WidthSpring</strong></em> must
act on the left of the chart. Here the usage with the new properties:
</p>
        <pre class="code">
          <span style="color: blue">&lt;</span>
          <span style="color: #a31515">ddd</span>
          <span style="color: blue">:</span>
          <span style="color: #a31515">WidthSpring </span>
          <span style="color: red">
            <font style="background-color: #ffff00">ActiveOnSide</font>
          </span>
          <span style="color: blue">
            <font style="background-color: #ffff00">="Right"</font>
          </span>
          <span style="color: red">SourcePanel</span>
          <span style="color: blue">="{</span>
          <span style="color: #a31515">Binding </span>
          <span style="color: red">
            <font style="background-color: #ffff00">RightPanel</font>
          </span>
          <span style="color: blue">, </span>
          <span style="color: red">ElementName</span>
          <span style="color: blue">=volume}"/&gt; </span>
        </pre>
        <p>
 
</p>
        <p>
by this addition the chart behave correctly even with the right side placed vertical
axis:
</p>
        <p>
          <a href="http://www.felicepollano.com/public/Windows-Live-Writer/Dynamic-data-display-Right-aligned-verti_128C9/r4_2.png">
            <img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="r4" border="0" alt="r4" src="http://www.felicepollano.com/public/Windows-Live-Writer/Dynamic-data-display-Right-aligned-verti_128C9/r4_thumb.png" width="76" height="244" />
          </a>
        </p>
        <p>
Source for this <a href="https://bitbucket.org/Felice_Pollano/d3redux" target="_blank">project
can be found here</a>.
</p>
        <img width="0" height="0" src="http://www.felicepollano.com/aggbug.ashx?id=fb3df452-aeeb-49a3-8f8e-405ce85d9717" />
      </body>
      <title>Dynamic data display: Right aligned vertical axis</title>
      <guid isPermaLink="false">http://www.felicepollano.com/PermaLink.aspx?guid=fb3df452-aeeb-49a3-8f8e-405ce85d9717</guid>
      <link>http://www.felicepollano.com/2011/06/07/DynamicDataDisplayRightAlignedVerticalAxis.aspx</link>
      <pubDate>Tue, 07 Jun 2011 19:15:50 GMT</pubDate>
      <description>&lt;p&gt;
Just add a new feature to decide where to place the vertical axis: left or right aligned
to the plot area. Here the property usage:
&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ddd&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;ChartPlotter &lt;/span&gt;&lt;span style="color: red"&gt;&lt;font style="background-color: #ffff00"&gt;MainVerticalAxisPlacement&lt;/font&gt;&lt;/span&gt;&lt;span style="color: blue"&gt;&lt;font style="background-color: #ffff00"&gt;="Right"&lt;/font&gt; &lt;/span&gt;&lt;span style="color: red"&gt;…&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt; &lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p align="justify"&gt;
A modification was necessary even in the &lt;strong&gt;&lt;em&gt;WidthSpring&lt;/em&gt;&lt;/strong&gt; element,
the one that allow us to keep more than one chart synchronized on the X axis ignoring
the space taken by the label area. It is now possible to specify that the &lt;em&gt;&lt;strong&gt;WidthSpring&lt;/strong&gt;&lt;/em&gt; must
act on the left of the chart. Here the usage with the new properties:
&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ddd&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;WidthSpring &lt;/span&gt;&lt;span style="color: red"&gt;&lt;font style="background-color: #ffff00"&gt;ActiveOnSide&lt;/font&gt;&lt;/span&gt;&lt;span style="color: blue"&gt;&lt;font style="background-color: #ffff00"&gt;="Right"&lt;/font&gt; &lt;/span&gt;&lt;span style="color: red"&gt;SourcePanel&lt;/span&gt;&lt;span style="color: blue"&gt;="{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding &lt;/span&gt;&lt;span style="color: red"&gt;&lt;font style="background-color: #ffff00"&gt;RightPanel&lt;/font&gt;&lt;/span&gt;&lt;span style="color: blue"&gt;, &lt;/span&gt;&lt;span style="color: red"&gt;ElementName&lt;/span&gt;&lt;span style="color: blue"&gt;=volume}"/&amp;gt; &lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
by this addition the chart behave correctly even with the right side placed vertical
axis:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.felicepollano.com/public/Windows-Live-Writer/Dynamic-data-display-Right-aligned-verti_128C9/r4_2.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="r4" border="0" alt="r4" src="http://www.felicepollano.com/public/Windows-Live-Writer/Dynamic-data-display-Right-aligned-verti_128C9/r4_thumb.png" width="76" height="244"&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Source for this &lt;a href="https://bitbucket.org/Felice_Pollano/d3redux" target="_blank"&gt;project
can be found here&lt;/a&gt;.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.felicepollano.com/aggbug.ashx?id=fb3df452-aeeb-49a3-8f8e-405ce85d9717" /&gt;</description>
      <comments>http://www.felicepollano.com/CommentView.aspx?guid=fb3df452-aeeb-49a3-8f8e-405ce85d9717</comments>
      <category>D3</category>
      <category>WPF</category>
    </item>
    <item>
      <trackback:ping>http://www.felicepollano.com/Trackback.aspx?guid=493280d8-4de2-46c4-9fc2-6055f46329ae</trackback:ping>
      <pingback:server>http://www.felicepollano.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.felicepollano.com/PermaLink.aspx?guid=493280d8-4de2-46c4-9fc2-6055f46329ae</pingback:target>
      <dc:creator>Felice Pollano</dc:creator>
      <wfw:comment>http://www.felicepollano.com/CommentView.aspx?guid=493280d8-4de2-46c4-9fc2-6055f46329ae</wfw:comment>
      <wfw:commentRss>http://www.felicepollano.com/SyndicationService.asmx/GetEntryCommentsRss?guid=493280d8-4de2-46c4-9fc2-6055f46329ae</wfw:commentRss>
      <slash:comments>5</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
In  the <a href="http://www.felicepollano.com/2011/05/15/MultipleChartsWithWPFDynamicDataDisplay.aspx" target="_blank">previous
sample</a> we shown how to present multiple chart by keeping them aligned in order
to be comparable on the horizontal axis by using the <strong><em>WidthSpring</em></strong> feature.
But D3 charting can automatically pan and zoom ( both by rect zoom by pressing control
and left dragging the mouse on the chart, or by the wheel ) and in this case we loose
the axis synchronization. Here below the undesired behavior:
</p>
        <table border="1" cellpadding="2" cellspacing="0" width="579">
          <tbody>
            <tr>
              <td valign="top" width="358">
                <a href="http://www.felicepollano.com/public/Windows-Live-Writer/677f9a9a9e6b_12B29/image_2.png">
                  <img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" alt="image" src="http://www.felicepollano.com/public/Windows-Live-Writer/677f9a9a9e6b_12B29/image_thumb.png" border="0" height="252" width="334" />
                </a>
              </td>
              <td valign="top" width="219">
On the left we see the top chart zoomed, the other ones show the horizontal range
thus there is no more relation among the three charts.</td>
            </tr>
          </tbody>
        </table>
        <p>
So we create an attached property as below:
</p>
        <pre class="code">
          <span style="color: blue">&lt;</span>
          <span style="color: #a31515">ddd</span>
          <span style="color: blue">:</span>
          <span style="color: #a31515">ChartPlotter </span>
          <span style="color: red">x</span>
          <span style="color: blue">:</span>
          <span style="color: red">Name</span>
          <span style="color: blue">="price" </span>
          <span style="color: red">ddd</span>
          <span style="color: blue">:</span>
          <span style="color: red">SynchroVisible.Axis</span>
          <span style="color: blue">="X" </span>
          <span style="color: red">ddd</span>
          <span style="color: blue">:</span>
          <span style="color: red">SynchroVisible.With</span>
          <span style="color: blue">="{</span>
          <span style="color: #a31515">Binding </span>
          <span style="color: red">ElementName</span>
          <span style="color: blue">=volume}"
…&gt;</span>
        </pre>
        <pre class="code"> </pre>
        <p>
by applying this property we choose which axis synchronize ( X in the example, but
can be Y or XY ) and which chart keep synchronized with, in this case we bind with
the chart named “volume”. By repeating the property two chart by two chart:
</p>
        <pre class="code">
          <span style="color: blue">&lt;</span>
          <span style="color: #a31515">ddd</span>
          <span style="color: blue">:</span>
          <span style="color: #a31515">ChartPlotter </span>
          <span style="color: red">x</span>
          <span style="color: blue">:</span>
          <span style="color: red">Name</span>
          <span style="color: blue">="volume" </span>
          <span style="color: red">ddd</span>
          <span style="color: blue">:</span>
          <span style="color: red">SynchroVisible.Axis</span>
          <span style="color: blue">="X" </span>
          <span style="color: red">ddd</span>
          <span style="color: blue">:</span>
          <span style="color: red">SynchroVisible.With</span>
          <span style="color: blue">="{</span>
          <span style="color: #a31515">Binding </span>
          <span style="color: red">ElementName</span>
          <span style="color: blue">=ma}"
…</span>
          <span style="color: blue">&gt; </span>
        </pre>
        <pre class="code">
          <span style="color: blue">&lt;</span>
          <span style="color: #a31515">ddd</span>
          <span style="color: blue">:</span>
          <span style="color: #a31515">ChartPlotter </span>
          <span style="color: red">x</span>
          <span style="color: blue">:</span>
          <span style="color: red">Name</span>
          <span style="color: blue">="ma" </span>
          <span style="color: red">ddd</span>
          <span style="color: blue">:</span>
          <span style="color: red">SynchroVisible.Axis</span>
          <span style="color: blue">="X" </span>
          <span style="color: red">ddd</span>
          <span style="color: blue">:</span>
          <span style="color: red">SynchroVisible.With</span>
          <span style="color: blue">="{</span>
          <span style="color: #a31515">Binding </span>
          <span style="color: red">ElementName</span>
          <span style="color: blue">=price}"
…</span>
          <span style="color: blue">&gt; </span>
        </pre>
        <p>
 
</p>
        <p>
so we achieve this interesting result <strong>without any code behind</strong>:
</p>
        <table border="1" cellpadding="2" cellspacing="0" width="544">
          <tbody>
            <tr>
              <td valign="top" width="200">
                <a href="http://www.felicepollano.com/public/Windows-Live-Writer/677f9a9a9e6b_12B29/image_4.png">
                  <img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" alt="image" src="http://www.felicepollano.com/public/Windows-Live-Writer/677f9a9a9e6b_12B29/image_thumb_1.png" border="0" height="259" width="306" />
                </a>
              </td>
              <td valign="top" width="342">
This is the result after panning the chart ( by dragging the mouse pointer into the
chart area in any of the three chart ) as you can see the other chart properly follow…</td>
            </tr>
            <tr>
              <td valign="top" width="200">
                <a href="http://www.felicepollano.com/public/Windows-Live-Writer/677f9a9a9e6b_12B29/image_6.png">
                  <img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" alt="image" src="http://www.felicepollano.com/public/Windows-Live-Writer/677f9a9a9e6b_12B29/image_thumb_2.png" border="0" height="259" width="305" />
                </a>
              </td>
              <td valign="top" width="342">
The same apply if we zoom on the chart area ( by pressing ctrl while dragging, or
by the mouse wheel ) other chart amplify the resolution on the synchronized axis and
the start position accordingly.</td>
            </tr>
          </tbody>
        </table>
        <p>
Check out the source for this example <a href="https://bitbucket.org/Felice_Pollano/d3redux/get/b2cb81b28116.zip" target="_blank">here</a>.
</p>
        <img width="0" height="0" src="http://www.felicepollano.com/aggbug.ashx?id=493280d8-4de2-46c4-9fc2-6055f46329ae" />
      </body>
      <title>Dynamic Data Display: synchronize axis</title>
      <guid isPermaLink="false">http://www.felicepollano.com/PermaLink.aspx?guid=493280d8-4de2-46c4-9fc2-6055f46329ae</guid>
      <link>http://www.felicepollano.com/2011/05/25/DynamicDataDisplaySynchronizeAxis.aspx</link>
      <pubDate>Wed, 25 May 2011 20:49:37 GMT</pubDate>
      <description>&lt;p&gt;
In&amp;nbsp; the &lt;a href="http://www.felicepollano.com/2011/05/15/MultipleChartsWithWPFDynamicDataDisplay.aspx" target="_blank"&gt;previous
sample&lt;/a&gt; we shown how to present multiple chart by keeping them aligned in order
to be comparable on the horizontal axis by using the &lt;strong&gt;&lt;em&gt;WidthSpring&lt;/em&gt;&lt;/strong&gt; feature.
But D3 charting can automatically pan and zoom ( both by rect zoom by pressing control
and left dragging the mouse on the chart, or by the wheel ) and in this case we loose
the axis synchronization. Here below the undesired behavior:
&lt;/p&gt;
&lt;table border="1" cellpadding="2" cellspacing="0" width="579"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="358"&gt;
&lt;a href="http://www.felicepollano.com/public/Windows-Live-Writer/677f9a9a9e6b_12B29/image_2.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" alt="image" src="http://www.felicepollano.com/public/Windows-Live-Writer/677f9a9a9e6b_12B29/image_thumb.png" border="0" height="252" width="334"&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td valign="top" width="219"&gt;
On the left we see the top chart zoomed, the other ones show the horizontal range
thus there is no more relation among the three charts.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;
So we create an attached property as below:
&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ddd&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;ChartPlotter &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;="price" &lt;/span&gt;&lt;span style="color: red"&gt;ddd&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;SynchroVisible.Axis&lt;/span&gt;&lt;span style="color: blue"&gt;="X" &lt;/span&gt;&lt;span style="color: red"&gt;ddd&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;SynchroVisible.With&lt;/span&gt;&lt;span style="color: blue"&gt;="{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding &lt;/span&gt;&lt;span style="color: red"&gt;ElementName&lt;/span&gt;&lt;span style="color: blue"&gt;=volume}"
…&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="code"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;p&gt;
by applying this property we choose which axis synchronize ( X in the example, but
can be Y or XY ) and which chart keep synchronized with, in this case we bind with
the chart named “volume”. By repeating the property two chart by two chart:
&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ddd&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;ChartPlotter &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;="volume" &lt;/span&gt;&lt;span style="color: red"&gt;ddd&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;SynchroVisible.Axis&lt;/span&gt;&lt;span style="color: blue"&gt;="X" &lt;/span&gt;&lt;span style="color: red"&gt;ddd&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;SynchroVisible.With&lt;/span&gt;&lt;span style="color: blue"&gt;="{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding &lt;/span&gt;&lt;span style="color: red"&gt;ElementName&lt;/span&gt;&lt;span style="color: blue"&gt;=ma}"
…&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt; &lt;/span&gt;&lt;/pre&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ddd&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;ChartPlotter &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;="ma" &lt;/span&gt;&lt;span style="color: red"&gt;ddd&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;SynchroVisible.Axis&lt;/span&gt;&lt;span style="color: blue"&gt;="X" &lt;/span&gt;&lt;span style="color: red"&gt;ddd&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;SynchroVisible.With&lt;/span&gt;&lt;span style="color: blue"&gt;="{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding &lt;/span&gt;&lt;span style="color: red"&gt;ElementName&lt;/span&gt;&lt;span style="color: blue"&gt;=price}"
…&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt; &lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
so we achieve this interesting result &lt;strong&gt;without any code behind&lt;/strong&gt;:
&lt;/p&gt;
&lt;table border="1" cellpadding="2" cellspacing="0" width="544"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="200"&gt;
&lt;a href="http://www.felicepollano.com/public/Windows-Live-Writer/677f9a9a9e6b_12B29/image_4.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" alt="image" src="http://www.felicepollano.com/public/Windows-Live-Writer/677f9a9a9e6b_12B29/image_thumb_1.png" border="0" height="259" width="306"&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td valign="top" width="342"&gt;
This is the result after panning the chart ( by dragging the mouse pointer into the
chart area in any of the three chart ) as you can see the other chart properly follow…&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top" width="200"&gt;
&lt;a href="http://www.felicepollano.com/public/Windows-Live-Writer/677f9a9a9e6b_12B29/image_6.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" alt="image" src="http://www.felicepollano.com/public/Windows-Live-Writer/677f9a9a9e6b_12B29/image_thumb_2.png" border="0" height="259" width="305"&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td valign="top" width="342"&gt;
The same apply if we zoom on the chart area ( by pressing ctrl while dragging, or
by the mouse wheel ) other chart amplify the resolution on the synchronized axis and
the start position accordingly.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;
Check out the source for this example &lt;a href="https://bitbucket.org/Felice_Pollano/d3redux/get/b2cb81b28116.zip" target="_blank"&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.felicepollano.com/aggbug.ashx?id=493280d8-4de2-46c4-9fc2-6055f46329ae" /&gt;</description>
      <comments>http://www.felicepollano.com/CommentView.aspx?guid=493280d8-4de2-46c4-9fc2-6055f46329ae</comments>
      <category>Charting</category>
      <category>D3</category>
      <category>WPF</category>
    </item>
  </channel>
</rss>