Nevron Forum

black line surrounding chart

https://www.nevron.com/Forum/Topic9235.aspx

By Hans Henrik Friis Pedersen - Monday, June 22, 2015

Hi,

When I export a Chart using the code below, a black line is present around the chart, see the attached chart. How do I remove that black line??


  // set a default file
            this.saveFileDialog1.FileName = "untitled.Png";
            // set filters - this can be done in properties as well
            this.saveFileDialog1.Filter = "Png Files (*.Png)|*.Png";
            this.saveFileDialog1.DefaultExt = "Png";
            if (this.saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                Bitmap bitmap = new Bitmap(this.nChartControl2.ClientSize.Width, this.nChartControl2.ClientSize.Height, PixelFormat.Format24bppRgb);
                this.nChartControl2.ImageExporter.RenderToBitmap(bitmap, false);
                bitmap.Save(this.saveFileDialog1.FileName, ImageFormat.Png);
            }


By Nevron Support - Tuesday, June 23, 2015

Hi Hans,

You need to make the chart background frame invisible:

nChartControl.nChartControl1.BackgroundStyle.FrameStyle.Visible = false;

Let us know if you have any questions.