Пример #1
0
        private void plotbutton_Click(object sender, EventArgs e)
        {
            //var engine = REngine.GetInstance();

            Engine.Evaluate(string.Format("png('{0}', {1}, {2})", TempImagePath.Replace('\\', '/'), this.graph_pictureBox.Width, this.graph_pictureBox.Height));
            Engine.Evaluate(Code);
            Engine.Evaluate("dev.off()");
            this.graph_pictureBox.ImageLocation = TempImagePath;
        }
Пример #2
0
 //for plotting the graph
 //it uses PlotData function from libs.R
 private void PlotData(string id)
 {
     if (string.IsNullOrEmpty(id) == false)
     {
         Engine.Evaluate(string.Format("png('{0}', {1}, {2})", TempImagePath.Replace('\\', '/'), graph_pictureBox.Width, graph_pictureBox.Height));
         Code = string.Format("PlotData('{0}',db)", id);
         Engine.Evaluate(Code);
         Engine.Evaluate("dev.off()");
         graph_pictureBox.ImageLocation = TempImagePath;
     }
 }