Hello !
Someone can advise me to tell me how i can fill a ScatterLineChart without animation ? I don't find how to do !
All the examples are with animation, and i don't need animation my goal is to print the chart.
Other question, in wich control should i put my chart to print it correctly ? Page ? Canvas ?
Thank you so much to ask me.
Stéphanie
(sorry for my poor english, i'm just a swiss :-) )
Hello Stéphanie,
Thank you for using Infragistics WPF Chart. This is the sample which shows how to use Scatter line chart without animation:
<igCA:XamChart Name="ScatterLineChart3D" View3D="False" > <!-- Series --> <igCA:XamChart.Series> <igCA:Series Stroke="Black" ChartType="ScatterLine"> <igCA:Series.DataPoints> <igCA:DataPoint> <igCA:DataPoint.ChartParameters> <igCA:ChartParameter Type="ValueX" Value="2/5/63"/> <igCA:ChartParameter Type="ValueY" Value="8"/> </igCA:DataPoint.ChartParameters> </igCA:DataPoint> <igCA:DataPoint> <igCA:DataPoint.ChartParameters> <igCA:ChartParameter Type="ValueX" Value="2/6/63"/> <igCA:ChartParameter Type="ValueY" Value="3"/> <igCA:ChartParameter Type="ValueZ" Value="10"/> </igCA:DataPoint.ChartParameters> </igCA:DataPoint> <igCA:DataPoint> <igCA:DataPoint.ChartParameters> <igCA:ChartParameter Type="ValueX" Value="2/7/63"/> <igCA:ChartParameter Type="ValueY" Value="9"/> </igCA:DataPoint.ChartParameters> </igCA:DataPoint> <igCA:DataPoint> <igCA:DataPoint.ChartParameters> <igCA:ChartParameter Type="ValueX" Value="2/10/63"/> <igCA:ChartParameter Type="ValueY" Value="6"/> </igCA:DataPoint.ChartParameters> </igCA:DataPoint> <igCA:DataPoint> <igCA:DataPoint.ChartParameters> <igCA:ChartParameter Type="ValueX" Value="2/11/63"/> <igCA:ChartParameter Type="ValueY" Value="7"/> </igCA:DataPoint.ChartParameters> </igCA:DataPoint> <igCA:DataPoint> <igCA:DataPoint.ChartParameters> <igCA:ChartParameter Type="ValueX" Value="2/11/63"/> <igCA:ChartParameter Type="ValueY" Value="3"/> </igCA:DataPoint.ChartParameters> </igCA:DataPoint> </igCA:Series.DataPoints> </igCA:Series> </igCA:XamChart.Series> </igCA:XamChart>
If you want to use printing there are to ways: Normal printing and Hi-res printing. Before we use printing lets first create a chart in xaml:
<igCA:XamChart.Series>
<igCA:Series.DataPoints>
<igCA:DataPoint Value="7"/>
<igCA:DataPoint Value="3"/>
<igCA:Series.Marker>
</igCA:Series.Marker>
</igCA:XamChart.Series>
<Transform3DGroup>
<ScaleTransform3D ScaleX="1" ScaleY="1" ScaleZ="1"/>
<RotateTransform3D.Rotation>
</RotateTransform3D.Rotation>
<TranslateTransform3D OffsetX="0" OffsetY="0" OffsetZ="0"/>
</Transform3DGroup>
</igCA:XamChart>
1. For normal printing you need this code:
printDlg.ShowDialog();
printDlg.PrintVisual(chart3d, "Printing");
2. This is a sample for hi-res printing:
int width = (int)(500.0 / 96.0 * printRect.Width);
bitmap.Render(chart3d);
Image printImage = new Image();
printImage.Source = bitmap;
printImage.Arrange(new Rect(new Point(0, 0), printImage.DesiredSize));
Regards,
GoranS
Thank you so much for your help, it was very helpfully !
I have an other question, always in the subject "Print".
Is it possible to print a chart without rendering it ? I don't need to see it before my printing ! Until now we succeed to print a chart only if we render it !
Thank you !