Sign In  Sign Up Live-Chat

Changing the line thickness of a line graph

Last post 05-20-2008, 4:51 AM by Amjad Sahi. 1 replies.
Sort Posts: Previous Next
  •  05-20-2008, 2:37 AM 127800

    Changing the line thickness of a line graph

    Hi,

    I need to set the line thickness of my line chart.

    How do I do it?

    Is there any property for setting the thickness of line graphs?


    Saravana Kumar M.R
     
  •  05-20-2008, 4:51 AM 127822 in reply to 127800

    Re: Changing the line thickness of a line graph

    Hi,

    Please use DataPoint.BorderWidth property for your requirement.

    E.g.,

    Chart c = new Chart();
       c.Height = 300;
       c.Width = 400;

       Series s = new Series();
       s.ChartType = ChartType.Line;
       s.DefaultDataPoint.BorderWidth = 7;
       s.DataPoints.Add(new DataPoint(1, 1));
       s.DataPoints.Add(new DataPoint(2, 2));
       s.DataPoints.Add(new DataPoint(3, 3));
       c.SeriesCollection.Add(s);


       //Save the chart image into a memory stream.
       MemoryStream ms = new MemoryStream();
       c.Save(ms, ImageFormat.Png);

       //Save the chart image from the memory stream to the response.
       Response.Clear();
       Response.ContentType = "image/png";
       Response.OutputStream.Write(ms.ToArray(), 0, (int) ms.Length);

     

    Thank you.

     


    Amjad Sahi
    Support Developer,
    Aspose Nanjing Team
    Contact Us
     
View as RSS news feed in XML