//=-- DataGraph.h - Interface to graph applet ----------------------*- C++ -*-=
//
//  This class is used to interface a DataTable object to the outside world...
//    specifically, formatting the output in a format readable by the Graph
//    java applet.  This class provides nice way to isolate the details of the
//    applet from the function that is displaying it.
//
//=---------------------------------------------------------------------------=
//  This file is copyright (c) 1997-2000 Chris Lattner
//=---------------------------------------------------------------------------=

#ifndef DATAGRAPH_H
#define DATAGRAPH_H

#include "MSString.h"
#include "DataTable.h"

class VTExp;
template <class Key, class Value> class Table;

class MSAPI DataGraph : public DataTable {
private :
  int    Width, Height;
  String BarColor, BarEndColor, BGColor, TableColumnHeadColor;
  int    BarStyle, BarCenter;
  int    ASCIIMaxBarLength, ImageMaxBarLength, MaxListLength;
  String ImageBarImage, Format;
  VTExp *LinkToURL;

public :
  DataGraph(Table<CSString,VTExp*> &Params) { 
    LoadParams(Params);
  }

  void LoadParams(Table<CSString,VTExp*> &Params);
  int WriteHTML(ostream &O);

private :
  void OutputRowLabel(ostream &o, int i, LLLink<String> *&RowLabel);
};

#endif

