When I use ExportToStream or ExportToImage, I am not setting series data. When you look at the output, the Axis are setup, and properly marked, but there's just no samples on the screen at all.
A few important notes:
-It only happens when I use the overload where you specify width and height.
-I never displayed the graph. I assembled it in code, then called export. It was never visible on the screen
-It doesn't matter if i do export to stream or file
And I'm HOPING this isn't related, but i'm using a modified lightning chart. This chart has changes so that the sample data is coming from an unmanaged buffer. I don't think this is related on account of the fact that it works with the 'export' overload with no height\width data.
Below are two images. One that worked (did not specify width\height), and one that did not (width\height)
Please help!
Here are the function i'm using for export to stream or image, with overloads for width\height
Code: Select all
public void ExportImage(string filename)
{
this.PrimaryChart.SaveToFile(filename);
}
public void ExportImage(string filename, int width, int height)
{
this.PrimaryChart.SaveToFile(filename, width, height);
}
public Image ExportToStream(int width, int height)
{
var stream = new MemoryStream();
this.PrimaryChart.SaveToStream(stream, TargetImageFormat.Bmp, width, height);
var image = Image.FromStream(stream);
return image;
}
public Image ExportToStream()
{
var stream = new MemoryStream();
this.PrimaryChart.SaveToStream(stream, TargetImageFormat.Bmp);
var image = Image.FromStream(stream);
return image;
}