Ваші коментарі
You can use the `Transform` method of the axis to get the length on the screen, but it will be a bit difficult to calculate the scale of the other axis. I think you need to consider the width of the control, the margins, and set the `Minimum` and `Maximum` of the second axis.
I think this should be covered by the following feature request: https://github.com/oxyplot/oxyplot/issues/13
I think this should be covered by the following feature request: https://github.com/oxyplot/oxyplot/issues/13
Служба підтримки клієнтів працює на UserEcho
Here is an example using WebAPI:
namespace WebApplication4.Controllers { using System; using System.IO; using System.Net; using System.Net.Http; using System.Net.Http.Headers; using System.Web.Http; using OxyPlot; using OxyPlot.Series; using OxyPlot.WindowsForms; public class PlotsController : ApiController { public HttpResponseMessage Get(int id) { var model = new PlotModel { Title = "Plot #" + id }; model.Series.Add(new FunctionSeries(Math.Sqrt, 0, 100, 0.01, "sqrt(x)")); var memoryStream = new MemoryStream(); var exporter = new PngExporter(); exporter.Export(model, memoryStream); var result = new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new ByteArrayContent(memoryStream.ToArray()) }; result.Content.Headers.ContentType = new MediaTypeHeaderValue("image/png"); result.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("inline") { FileName = string.Format("plot{0}.png", id) }; return result; } } }The result is: