41 #include <qwt_plot_marker.h>
42 #include <qwt_plot_curve.h>
51 class QwtPlotMagnifier;
128 Graph (
int x = 0,
int y = 0,
int width = 500,
int height = 400, QWidget* parent=0, Qt::WFlags f=0);
155 void select(QWidget *l,
bool add =
false);
176 QwtPlotItem*
closestCurve(
int xpos,
int ypos,
int &dist,
int &point);
201 void print(QPainter *,
const QRect &rect,
const QwtPlotPrintFilter & = QwtPlotPrintFilter());
227 static QString escapeTeXSpecialCharacters(
const QString &);
228 static QString texSuperscripts(
const QString &);
260 int firstColor,
int startRow = 0,
int endRow = -1,
bool visible =
true,
261 double d_start_azimuth = 270,
double d_view_angle = 90,
double d_thickness = 33,
262 double d_horizontal_offset = 0.0,
double d_edge_dist = 25,
bool d_counter_clockwise =
false,
263 bool d_auto_labeling =
true,
bool d_values =
false,
bool d_percentages =
true,
264 bool d_categories =
false,
bool d_fixed_labels_pos =
true);
271 bool addCurves(
Table* w,
const QStringList& names,
int style = 0,
double lWidth = 1,
int sSize = 3,
int startRow = 0,
int endRow = -1);
274 DataCurve*
insertCurve(
Table* w,
const QString& xColName,
const QString& yColName,
int style,
int startRow = 0,
int endRow = -1);
280 void showCurve(
int index,
bool visible =
true);
327 void updateCurveNames(
const QString& oldName,
const QString& newName,
bool updateTableName =
true);
345 QPixmap
graphPixmap(
const QSize& size = QSize(),
double scaleFontsFactor = 1.0,
bool transparent =
false);
348 void exportSVG(
const QString& fname,
const QSizeF& customSize = QSizeF(),
int unit =
FrameWidget::Pixel,
double fontsFactor = 1.0);
349 void exportEMF(
const QString& fname,
const QSizeF& customSize = QSizeF(),
int unit =
FrameWidget::Pixel,
double fontsFactor = 1.0);
350 void exportTeX(
const QString& fname,
bool color =
true,
bool escapeStrings =
true,
bool fontSizes =
true,
351 const QSizeF& customSize = QSizeF(),
int unit =
FrameWidget::Pixel,
double fontsFactor = 1.0);
353 bool isExportingTeX(){
return d_is_exporting_tex;};
354 void setTeXExportingMode(
bool on =
true){d_is_exporting_tex = on;};
355 bool escapeTeXStrings(){
return d_tex_escape_strings;};
356 void setEscapeTeXStringsMode(
bool on =
true){d_tex_escape_strings = on;};
358 void exportVector(
const QString& fileName,
int res = 0,
bool color =
true,
359 const QSizeF& customSize = QSizeF (),
int unit =
FrameWidget::Pixel,
double fontsFactor = 1.0);
360 void exportVector(QPrinter *printer,
int res = 0,
bool color =
true,
361 const QSizeF& customSize = QSizeF (),
int unit =
FrameWidget::Pixel,
double fontsFactor = 1.0);
362 void exportImage(
const QString& fileName,
int quality = 100,
bool transparent =
false,
363 int dpi = 0,
const QSizeF& customSize = QSizeF (),
366 void draw(QPaintDevice *,
const QSize& size,
double fontsFactor = 1.0);
367 static QSize
customPrintSize(
const QSizeF& customSize,
int unit,
int dpi);
375 const QString& errColName,
int type = 1,
double width = 1,
int cap = 8,
const QColor& color = QColor(Qt::black),
376 bool through =
true,
bool minus =
true,
bool plus =
true);
379 int type = 1,
double width = 1,
int cap = 8,
const QColor& color = QColor(Qt::black),
380 bool through =
true,
bool minus =
true,
bool plus =
true);
383 int type = 1,
double width = 1,
int cap = 8,
const QColor& color = QColor(Qt::black),
384 bool through =
true,
bool minus =
true,
bool plus =
true);
388 void loadErrorBars(QList<ErrorBarsCurve *> errBars, QList<int> mcIndexes);
406 void setScale(
int axis,
double start,
double end,
double step = 0.0,
407 int majorTicks = 5,
int minorTicks = 5,
int type = 0,
bool inverted =
false,
408 double left_break = -DBL_MAX,
double right_break = DBL_MAX,
int pos = 50,
409 double stepBeforeBreak = 0.0,
double stepAfterBreak = 0.0,
int minTicksBeforeBreak = 4,
410 int minTicksAfterBreak = 4,
bool log10AfterBreak =
false,
int breakWidth = 4,
bool breakDecoration =
true);
426 void zoomed (
const QwtDoubleRect &);
463 static QString
rgbaName(
const QColor& color);
474 void insertLegend(
const QStringList& lst,
int fileVersion);
478 QString
legendText(
bool layerSpec =
false,
int fromIndex = 0);
494 void addArrow(QStringList list,
int fileVersion);
499 void drawLine(
bool on,
bool arrow =
false);
560 void initFonts(
const QFont &scaleTitleFnt,
const QFont &numbersFnt);
577 void showAxis(
int axis,
int type,
const QString& formatInfo,
Table *table,
bool axisOn,
578 int majTicksType,
int minTicksType,
bool labelsOn,
const QColor& c,
int format,
579 int prec,
int rotation,
int baselineDist,
const QString& formula,
const QColor& labelsColor,
581 const QString& prefix = QString::null,
const QString& suffix = QString::null);
605 void setAxisTicksLength(
int axis,
int majTicksType,
int minTicksType,
int minLength,
int majLength);
627 void setCanvasFrame(
int width = 1,
const QColor& color = QColor(Qt::black));
651 void initTitle(
bool on,
const QFont& fnt);
669 void setFrame(
int width = 1,
const QColor& color = Qt::black);
685 int range(QwtPlotCurve *c,
double *start,
double *end);
693 double start,
double end,
int points,
const QMap<QString, double>& constants);
694 FunctionCurve*
addFunction(
const QStringList &formulas,
double start,
double end,
int points = 100,
const QString &var =
"x",
int type = 0,
const QString& title = QString::null);
710 void updateVectorsLayout(
int curve,
const QColor& color,
double width,
int arrowLength,
int arrowAngle,
bool filled,
int position,
711 const QString& xEndColName = QString(),
const QString& yEndColName = QString());
717 void plotBox(
Table *w,
const QStringList& names,
int startRow = 0,
int endRow = -1);
856 void printFrame(QPainter *painter,
const QRect &rect)
const;
857 void printCanvas(QPainter *painter,
const QRect &canvasRect,
858 const QwtScaleMap map[axisCnt],
const QwtPlotPrintFilter &pfilter)
const;
859 virtual void printScale (QPainter *,
int axisId,
int startDist,
int endDist,
860 int baseDist,
const QRect &)
const;
861 virtual void drawItems (QPainter *painter,
const QRect &rect,
862 const QwtScaleMap map[axisCnt],
const QwtPlotPrintFilter &pfilter)
const;
865 const QwtScaleMap&map,
int axis,
bool min,
bool maj)
const;
866 void drawBreak(QPainter *painter,
const QRect &rect,
const QwtScaleMap &map,
int axis)
const;
910 bool d_is_exporting_tex;
911 bool d_tex_escape_strings;
935 virtual QFont
font(
const QFont &f, Item item)
const
940 if (item == Title || item == AxisScale || item == AxisTitle || item == Marker){
942 fnt.setPointSizeF(
d_factor*f.pointSizeF());