Infragistics Home

Infragistics Forums

Infragistics community online discussions.
Welcome to Infragistics Forums Sign in | FAQ
in Search

How to include Page Break in Bar Chart

Last post 07-08-2008 14:47 by [Infragistics] David Negley. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 06-12-2008 15:42

    How to include Page Break in Bar Chart

    I am using a Bar Chart, which displays very big amount of data, almost more than 2 pages.

    I am converting this Whole Web page to PDF using another tool.

    Now the problem is i need to use the page break in chart at 45 th bar,does any body has idea how do i can include page break in a chart.

    Thanks in advance 

     

     

     

    Filed under: , ,
    • Post Points: 20
  • 06-12-2008 16:17 In reply to

    • joerattz
    • Not Ranked
    • Joined on 06-12-2008
    • Points 20

    Re: How to include Page Break in Bar Chart

    This may not help you any, and it has nothing to do with the chart control, but I have handled page breaks for other things using the CSS "page-break-before: always" style.  Something like this:

    <tr style="page-break-before: always;"> 

    If you could get access to the style on the 46th row and inject that style into it, you may get the page break you want.  There is also a page-break-after and page-break-inside style. 

    • Post Points: 20
  • 06-13-2008 7:59 In reply to

    Re: How to include Page Break in Bar Chart

    Hi Joe,

    Thanks for the reply.

    But i didn't find any properties in Ultrachart to assign the styles, that is the problem.

    Thanks,

     

     

    • Post Points: 20
  • 06-19-2008 12:52 In reply to

    Re: How to include Page Break in Bar Chart

     how about this:

    this.UltraChart1.Style["page-break-before"] = "always";

    • Post Points: 20
  • 06-19-2008 13:07 In reply to

    Re: How to include Page Break in Bar Chart

    I need to break the Bar chart in between.

    For example if the bar chart  has 100 bars, then i need to break the chart at 40th bar and also at 80th bar.

    • Post Points: 20
  • 06-26-2008 15:13 In reply to

    Re: How to include Page Break in Bar Chart

     maybe you could save the chart as an image, then split that up into three images?  this would probably not use the regular PDF rendering code, and you couldn't tell the chart where to break based on what bar you're on, you'd have to base the image splitting off pixel coordinates.

    • Post Points: 20
  • 06-26-2008 15:26 In reply to

    Re: How to include Page Break in Bar Chart

    Hi David, Thanks for the response.

    Can you give an example to split the image in ASP.Net code. 

     

    • Post Points: 20
  • 07-08-2008 14:47 In reply to

    Re: How to include Page Break in Bar Chart

    using (MemoryStream imageStream = new MemoryStream())
    {
        this.UltraChart1.SaveTo(imageStream, RenderingType.Image);

        using (Image chartImage = Image.FromStream(imageStream))
        {
            Bitmap topImage = new Bitmap(chartImage.Width, chartImage.Height / 2);
            Bitmap bottomImage = new Bitmap(chartImage.Width, chartImage.Height / 2);

            Graphics topGraphics = Graphics.FromImage(topImage);
            Graphics bottomGraphics = Graphics.FromImage(bottomImage);

            int halfHeight = chartImage.Height / 2;
            Rectangle destRect = new Rectangle(Point.Empty, topImage.Size);

            topGraphics.DrawImage(chartImage, destRect, 0, 0, chartImage.Width, halfHeight, GraphicsUnit.Pixel);
            bottomGraphics.DrawImage(chartImage, destRect, 0, halfHeight, chartImage.Width, halfHeight, GraphicsUnit.Pixel);

            topImage.Save(@"C:\top.png", ImageFormat.Png);
            bottomImage.Save(@"C:\bottom.png", ImageFormat.Png);

            topGraphics.Dispose();
            bottomGraphics.Dispose();

            topImage.Dispose();
            bottomImage.Dispose();
        }
    }

    • Post Points: 5
Page 1 of 1 (8 items)
Powered by Community Server (Commercial Edition), by Telligent Systems