Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1531
Copy to Clipboard excludes the legend
posted

I'm using the XamDataChart with a common legend similar to many of the examples in both the help and Feature Browser.  When copying the chart to the clipboard, the legend is not included in the image.  Is there a different approach to either building the legend or copying the chart that will include the legend?

Thanks, Steve

My Xaml looks like this:

<ig:XamDock x:Name="xmDockContainer" Margin="10">

    <ig:XamDataChart x:Name="xmDataChart"

                     Legend="{Binding ElementName=xmLegend}"

                     Margin="10,10,10,10">

        <ig:XamDataChart.Series>

            <ig:LineSeries Title="Volume Series"

                           ItemsSource="{Binding}"

                           ValueMemberPath="Volume"

                           XAxis="{Binding ElementName=xmXAxis}"

                           YAxis="{Binding ElementName=xmYAxis2}">

            </ig:LineSeries>

                <ig:FinancialPriceSeries Title="Price Series"

                                         DisplayType="Candlestick"

                                         ItemsSource="{Binding}"

                                         OpenMemberPath="Open"

                                         CloseMemberPath="Close"

                                         HighMemberPath="High"

                                         LowMemberPath="Low"

                                         VolumeMemberPath="Volume"

                                         XAxis="{Binding ElementName=xmXAxis}"

                                         YAxis="{Binding ElementName=xmYAxis}">

                </ig:FinancialPriceSeries>

            </ig:XamDataChart.Series>

    </ig:XamDataChart>

    <ig:Legend x:Name="xmLegend"

               Content="Common Legend"

               Margin="10"

               ig:XamDock.Edge="InsideRight">

     </ig:Legend>

</ig:XamDock>

 

My copy to clipboard code looks like this:

RenderTargetBitmap bmp = new RenderTargetBitmap((int)xmDataChart.ActualWidth, (int)xmDataChart.ActualHeight, 96, 96, PixelFormats.Default);

bmp.Render(xamDataChart);

Clipboard.Clear();

Clipboard.SetImage(bmp);

 

 

Parents
  • 30692
    Offline posted

    You should pass the dock panel to RenderTargetBitmap rather than the chart. The chart doesn't contain the legend. The dock contains both.

    Hope this helps!

    -Graham

Reply Children