Monday, 15 March 2010

c# - Generate Image with Microsoft .NET Chart Controls Library without Control -


Generate images (JPEG, PNG, etc.) using any Microsoft Charts Control Library without a WinForm or ASP Is Net Control Class Possible? In all the examples I have seen the use of a control component. I need to create a library that includes simple methods that take data to plot and give a new chart image Example: Public Byte [] Generated Plate (ILIIT & LT; Serijdata & gt; Series) / JPEG Generate and Return JPEG Generate Plate (ILIIT and LT; Series Dta & G; Series, Stream Outputstream) {// Generate Jpeg and write on Stream}

It is not possible:

  1. Do you always ask the user to call the generated plate (call) method?
  2. Would you recommend?

Thanks

Yes, this is possible:

  By using the system.window.form.dataVisualization. Charting; Using System.IO; ... Public Zero GeneratePlot (IList & lt; DataPoint> series, stream output stream) {(var ch = New chart ()) {ch.ChartAreas.Add (New ChartArea ()); Var s = new series (); Foreach (var pnt in series) s.Points.Add (pnt); Ch.Series.Add (s); Ch.SaveImage (OutputStream, Chart Image Format .jpg); }}  

No comments:

Post a Comment