The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Hello,
I''m experiencing issues with the firing of events in the chart control. I have a function on my windows form that creates the desired chart from values returned from a database. This works fine, my problem comes with printing the chart.
I have a print routine that calls the function that creates the desired chart.
Call InitializeChartData(forum_id, cust_id)
A few lines down I make the call to the print function: pd.Print();
The problem I am having is that a red line I paint on the axis is not printing. Here is the function that draws the line:
Private Sub chartControl1_ChartAreaPaint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles ChartCntrlStrScrd.ChartAreaPaint
Dim chartAreaRect As Rectangle = Me.ChartCntrlStrScrd.GetChartAreaBounds
Dim rangeLength As Double = Me.ChartCntrlStrScrd.PrimaryXAxis.Range.Max - Me.ChartCntrlStrScrd.PrimaryXAxis.Range.Min
If (Me.ChartCntrlStrScrd.PrimaryXAxis.Range.Max > 0) And (Me.ChartCntrlStrScrd.PrimaryXAxis.Range.Min < 0) Then
Dim xposition As Double = chartAreaRect.Width * Me.ChartCntrlStrScrd.PrimaryXAxis.Range.Max / rangeLength
e.Graphics.DrawLine(New Pen(Color.Red), New Point(CInt(xposition), 0), New Point(CInt(xposition), chartAreaRect.Width))
End If
End Sub
How come this is being called after the print function has completed, hence the red line doesn''t appear on my printed chart?
Thanks,
Andrew
DJDavis Jebaraj Syncfusion Team November 9, 2004 03:57 PM
Hi Andrew,
The ChartAreaPaint event is not taken into account when the document is printed. We will need to modify the behavior to provide a alternative or invoke this event during the printing and saving to a image.
I have submitted a fix for this issue and it will be available in a build at the earliest.
Thank you for your patience.
Regards,
Davis
ANAndrewNovember 14, 2004 02:13 PM
Thank you for the explanation, I look forward to the next available build.
Thanks,
Andrew
>Hi Andrew,
>
>The ChartAreaPaint event is not taken into account when the document is printed. We will need to modify the behavior to provide a alternative or invoke this event during the printing and saving to a image.
>
>I have submitted a fix for this issue and it will be available in a build at the earliest.
>
>Thank you for your patience.
>
>Regards,
>
>Davis