// This is the method which will be called when the internal logic of the PdfFormatProvider reaches a chart which has to be rendered. public void RenderChart(FixedContentEditor editor, FloatingChartShape chart) { BitmapSource source = this.chartToImageConverter.GetBitmapSourceFromFloatingChartShape(chart, 300d, 300d); // The editor draws the image in the PDF. editor.DrawImage(this.StreamFromBitmapSource(source), new Size(chart.Width, chart.Height)); }
// This is the method which will be called when the internal logic of the PdfFormatProvider reaches a chart which has to be rendered. public void RenderChart(FixedContentEditor editor, FloatingChartShape chart) { // The ChartModelToImageConverter object is readily available in the Telerik.Windows.Controls.Spreadsheet assembly and // uses internally the RadChartView control to visualize the chart and create an image. BitmapSource source = this.chartToImageConverter.GetBitmapSourceFromFloatingChartShape(chart, 300d, 300d); // The editor draws the image in the PDF. editor.DrawImage(this.StreamFromBitmapSource(source), new Size(chart.Width, chart.Height)); }