This is a migrated thread and some comments may be shown as answers.

Printing from ViewModel

2 Answers 24 Views
Chart
This is a migrated thread and some comments may be shown as answers.
jay
Top achievements
Rank 1
jay asked on 03 Mar 2011, 05:01 PM
I'm attempting to build a linechart from the view model for printing.  The chart shows up, however there is no data graphed.  I've reviewed several samples and have been unable to find the problem.  Here is the code that builds the chart:

RadChart

 

 

rptChart= new RadChart();

 

 

rptChart.DefaultView.ChartArea.PaletteBrushes.Add(

 

new SolidColorBrush(Colors.Blue));

 

 

rptChart.DefaultView.ChartArea.Margin =

 

new Thickness(0,0,0,5);

 

 

rptChart.DefaultView.ChartArea.AxisX.IsDateTime =

 

true;

 

 

rptChart.DefaultView.ChartArea.AxisX.AutoRange =

 

false;

 

 

rptChart.DefaultView.ChartArea.AxisX.DefaultLabelFormat =

 

"MM/dd/yyyy";

 

 

rptChart.DefaultView.ChartArea.AxisX.LabelRotationAngle = 25;

 

rptChart.DefaultView.ChartArea.AxisX.Step = 1;

 

rptChart.DefaultView.ChartArea.AxisX.LabelStep = 5;

 

rptChart.DefaultView.ChartArea.AxisX.MaxValue = MaxDateShown;

 

rptChart.DefaultView.ChartArea.AxisX.MinValue = MinDateShown;

 

rptChart.DefaultView.ChartLegend.Visibility =

 

Visibility.Collapsed;

 

 

rptChart.ItemsSource = Data; //Data is an observableCollection

 

rptChart.MaxHeight = 200;

 

rptChart.MaxWidth = 450;

 

rptChart.MinWidth = 350;

 

rptChart.MinHeight = 150;

 

Telerik.Windows.Controls.Charting.

 

SeriesMapping sm = new Telerik.Windows.Controls.Charting.SeriesMapping();

 

 

sm.LegendLabel =

 

"legendLabel";

 

 

sm.SeriesDefinition =

 

new Telerik.Windows.Controls.Charting.LineSeriesDefinition();

 

 

sm.ItemMappings.Add(

 

new Telerik.Windows.Controls.Charting.ItemMapping("ReportDate", Telerik.Windows.Controls.Charting.DataPointMember.XValue));

 

 

sm.ItemMappings.Add(

 

new Telerik.Windows.Controls.Charting.ItemMapping("Quantity", Telerik.Windows.Controls.Charting.DataPointMember.YValue));

 

 

rptChart.SeriesMappings.Add(sm);

I then add the chart to the grid for printing.  Any ideas on what is preventing the line from showing up?  The chart shows up on the printed page formatted correctly, just no line.

Thanks,
Jay.

2 Answers, 1 is accepted

Sort by
0
jay
Top achievements
Rank 1
answered on 03 Mar 2011, 05:46 PM
I have tried what was suggested in another thread (http://www.telerik.com/community/forums/silverlight/chart/line-series-not-showing-when-printing-chart.aspx).  I set ChartArea.EnableAnimations = false;  This did not fix the issue for me.
0
Giuseppe
Telerik team
answered on 09 Mar 2011, 11:14 AM
Hello jay,

We have addressed your inquiry in the other forum thread you have opened on the printing topic.


Greetings,
Giuseppe
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
Chart
Asked by
jay
Top achievements
Rank 1
Answers by
jay
Top achievements
Rank 1
Giuseppe
Telerik team
Share this question
or