GoogleChart.

Dependents:   GoogleChart_TestProgram

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers DataSet.h Source File

DataSet.h

00001 /**
00002  * GoogleChart API interface driver. (Version 0.0.1)
00003  *
00004  * Copyright (C) 2010 Shinichiro Nakamura (CuBeatSystems)
00005  * http://shinta.main.jp/
00006  */
00007 
00008 #ifndef _DATA_SET_H_
00009 #define _DATA_SET_H_
00010 
00011 #include <string>
00012 
00013 class DataSet {
00014 public:
00015     typedef enum {
00016         Simple,
00017         Extended,
00018         Text
00019     } EncodeType;
00020     
00021     DataSet(std::string label, int number, int size, EncodeType encodeType = Text);
00022     ~DataSet();
00023     
00024     std::string getLabel();
00025     int getNumber();
00026     int getSize();
00027     void setEncodeType(EncodeType encodeType);
00028     EncodeType getEncodeType();
00029     
00030     void clearAllData();
00031     void addData(double data);
00032     int getDataCount();
00033     double getData(int index);
00034     
00035     void setScale(double min, double max) {
00036         DataSet::min = min;
00037         DataSet::max = max;
00038     }
00039     double getMin() { return min; }
00040     double getMax() { return max; }
00041     
00042 private:
00043 
00044     const std::string label;
00045     const int number;
00046     const int size;
00047     EncodeType encodeType;
00048     double *datalist;
00049     int dataCount;
00050     double min;
00051     double max;
00052 };
00053 
00054 #endif