Profile Picture

black line surrounding chart

Posted By Hans Henrik Friis Pedersen... 9 Years Ago
Author
Message
Hans Henrik Friis Pedersen...
Question Posted 9 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)

Group: Forum Members
Last Active: 8 Years Ago
Posts: 28, Visits: 136
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);
            }




Attachments
untitled.Png (316 views, 71.00 KB)
Nevron Support
Posted 9 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Yesterday @ 1:54 AM
Posts: 3,054, Visits: 4,009
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.


Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic