We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Eventing Timing

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

2 Replies

DJ Davis Jebaraj Syncfusion Team November 9, 2004 08:57 PM UTC

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


AN Andrew November 14, 2004 07:13 PM UTC

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

Loader.
Live Chat Icon For mobile
Up arrow icon