Generates the Gnuplot script and data files.
@param basepath The base path to use. A number of new files will becreated and their names will all start with this string.
@return The number of data points sent to Gnuplot. This can be lessthan the number of data points involved in the query due to things like aggregation or downsampling.
@throws IOException if there was an error while writing one of the files.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.