Results 1 to 6 of 6
Hi,
Does anybody know how to generate excel charts from C, or if it's possible at all?
For example, if I had 2 arrays that I wanted to export to ...
- 02-24-2011 #1Just Joined!
- Join Date
- Feb 2011
- Posts
- 10
generating excel charts from c
Hi,
Does anybody know how to generate excel charts from C, or if it's possible at all?
For example, if I had 2 arrays that I wanted to export to excel and graph against each other. I know how to export it to a csv file, that's no problem, but I have no idea where to start with generating a graph of the data. I can't seem to find any examples anywhere.
I'd appreciate if someone could point me in the right direction.
Just a simple example to show you what I mean:
ThanksCode:char arr1[] = {'a','b','c'}; int arr2[] = {10,20,30}; int main () { FILE *myfile= fopen ("example1.csv","w"); for (int i=0; i<3; i++) fprintf(myfile, "%c,%d\n",arr1[i],arr2[i]); fclose(myfile); return 0; }
- 02-24-2011 #2
Not sure why you'd be thinking of Excel in a Linux environment, but you could likely do your charting using rrdtool.
- 02-25-2011 #3Just Joined!
- Join Date
- Feb 2011
- Posts
- 10
oops sorry, i wrote down excel without thinking, i meant to say openoffice or something similar.
I'll look into rrdtool too though, thanks.
- 02-25-2011 #4Linux Newbie
- Join Date
- Dec 2010
- Posts
- 146
- 02-25-2011 #5Just Joined!
- Join Date
- Nov 2007
- Posts
- 4
If you don't need formatting, you can try exporting to CSV format.
- 02-25-2011 #6
It's clear that you know how to output CSV already and that you don't need to do that or XML.
For rrd sample code in C, have a look at the Xymon project on Sourceforge. All of its data storage and charting is rrd-based.


Reply With Quote
