My web service needs to do generate some line charts which will then be added to a PDF report that is streamed to the client.
How do I generate the line chart in the web service?
Thanks!
My web service needs to do generate some line charts which will then be added to a PDF report that is streamed to the client.
How do I generate the line chart in the web service?
Thanks!
If you don't want to use a third party control then you can use the System.Drawing namespace for this.
Dont forget to dispose the graphics object as soon as you have finished with it (a using block is best)
Because you are using GDI+ from within a web service, you may want to consider using the Singleton pattern to serialise requests to do the drawing.
Have a look at this webpage here
Drawing Line Charts in ASP.Net
Then instead of requesting the chart from your page_load and returning it in the stream, return it from one of your webservice functions
Edit
Went away and thought about this and then a lightbulb went off - another way of doing this (and also removing you from the GDI+ code) would be to use the GoogleCharts api.
For example http://chart.apis.google.com/chart?cht=p3&chd=t:90,10&chs=250x100&chl=Overflow|Stack renders the following
Line charts
http://code.google.com/apis/chart/docs/gallery/line_charts.html
Also, if you haven't sorted PDF generation yet, have a look at iTextSharp here