c# - Append DataVizualisation Chart Control to text file -


i'm developing system takes data input textboxes, , on button click, saves these values respective listbox ready written text file once process complete.

the next stage has been using data create graphs, has gone i'm looking way add these onto end of text file it's included in 1 place. tried (included in total 'savetofile' function):

        consolefile.writeline(chartbp.text); //chart title         chartbp.saveimage((filename), system.drawing.imaging.imageformat.jpeg);         consolefile.writeline("\n\n"); 

this appeared work ok threw run-time error stating file not accessed because being used process.

i don't think i'm far off need be, don't have enough experience charts know try next. have idea how make work, or method wouldn't produce error? appreciated!

if problem rid of exception, this:

            consolefile.writeline(chartbp.text);             consolefile.close();              filestream imgfile = file.open(filename, filemode.append);             chartbp.saveimage(imgfile, chartimageformat.jpeg);             imgfile.close();              consolefile = new streamwriter(filename, true);             consolefile.writeline("\n\n");             consolefile.close(); 

but remember, you're not going see images in text file, messy stream of characters corresponding binary image, displayed text.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -