Example #1
0
 public static bool SaveChart(System.Windows.Forms.DataVisualization.Charting.Chart chart1)
 {
     SaveFileDialog sfd = new SaveFileDialog();
     sfd.Filter = "*Картинка формата png (*.png)|*.png";
     if(sfd.ShowDialog()==DialogResult.OK)
     {
         try
         {
             chart1.SaveImage(sfd.FileName, ChartImageFormat.Png);
             return true;
         }
         catch
         {
             return false;
         }
     }
     return false;
 }
Example #2
0
        private void AddImageToHTML(HtmlTextWriter writer, string base_name, string aero_element, System.Web.UI.DataVisualization.Charting.Chart chart)
        {
            chart.Page = this;
            chart.SaveImage(AeroReader.DefPath + base_name);

            //chart.RenderControl(writer);
            writer.Write("<img style='display:inline-block;width:{0}px;height:{1}px;border-width:0px' src='{2}' alt='{3}'/>\n", 
                ChartWidth ,ChartHeight,
                base_name, aero.Description(aero_element));
//            writer.Write("<img style='display:inline-block;height:7cm;width:5cm;border-width:0px' src='{0}' alt='{1}'/>\n", base_name, aero.Description(aero_element));
        }