diff --git a/src/Charts/GenericChart.cpp b/src/Charts/GenericChart.cpp new file mode 100644 index 000000000..a09674e92 --- /dev/null +++ b/src/Charts/GenericChart.cpp @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2020 Mark Liversedge (liversedge@gmail.com) + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "GenericChart.h" + +#include "Colors.h" +#include "TabView.h" +#include "RideFileCommand.h" +#include "Utils.h" + +#include + +GenericChart::GenericChart(QWidget *parent, Context *context) : QWidget(parent), context(context) +{ + // intitialise state info + mainLayout = new QVBoxLayout(this); + mainLayout->setSpacing(0); + mainLayout->setContentsMargins(0,0,0,0); + + plot = new GenericPlot(this,context); + mainLayout->addWidget(plot); +} + +// set chart settings +bool +GenericChart::initialiseChart(QString title, int type, bool animate, int legendpos, bool stack, int orientation) +{ + // for now ... + Q_UNUSED(stack) + Q_UNUSED(orientation) + + return plot->initialiseChart(title, type, animate, legendpos); +} + +// add a curve, associating an axis +bool +GenericChart::addCurve(QString name, QVector xseries, QVector yseries, QString xname, QString yname, + QStringList labels, QStringList colors, + int line, int symbol, int size, QString color, int opacity, bool opengl) +{ + + return plot->addCurve(name, xseries, yseries, xname, yname, labels, colors, line, symbol, size, color, opacity, opengl); +} + +// configure axis, after curves added +bool +GenericChart::configureAxis(QString name, bool visible, int align, double min, double max, + int type, QString labelcolor, QString color, bool log, QStringList categories) +{ + return plot->configureAxis(name, visible, align, min, max, type, labelcolor, color, log, categories); +} + +// post processing clean up / add decorations / helpers etc +void +GenericChart::finaliseChart() +{ + plot->finaliseChart(); +} diff --git a/src/Charts/GenericChart.h b/src/Charts/GenericChart.h new file mode 100644 index 000000000..983e25e12 --- /dev/null +++ b/src/Charts/GenericChart.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2020 Mark Liversedge (liversedge@gmail.com) + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef _GC_GenericChart_h +#define _GC_GenericChart_h 1 + +#include "GoldenCheetah.h" +#include "Settings.h" +#include "Context.h" +#include "Athlete.h" +#include "Colors.h" +#include "RCanvas.h" + +#include "GenericSelectTool.h" +#include "GenericLegend.h" +#include "GenericPlot.h" + +// the chart +class GenericChart : public QWidget { + + Q_OBJECT + + public: + + friend class GenericSelectTool; + friend class GenericLegend; + + GenericChart(QWidget *parent, Context *context); + + public slots: + + // set chart settings + bool initialiseChart(QString title, int type, bool animate, int legendpos, bool stack, int orientation); + + // add a curve, associating an axis + bool addCurve(QString name, QVector xseries, QVector yseries, QString xname, QString yname, + QStringList labels, QStringList colors, + int line, int symbol, int size, QString color, int opacity, bool opengl); + + // configure axis, after curves added + bool configureAxis(QString name, bool visible, int align, double min, double max, + int type, QString labelcolor, QString color, bool log, QStringList categories); + + // post processing clean up / add decorations / helpers etc + void finaliseChart(); + + protected: + + // legend and selector need acces to these + QVBoxLayout *mainLayout; + GenericPlot *plot; // for now... + + // layout options + bool stack; // stack series instead of on same chart + Qt::Orientation orientation; // layout horizontal or vertical + + private: + Context *context; +}; + + +#endif diff --git a/src/Charts/PythonChart.cpp b/src/Charts/PythonChart.cpp index 9d238bca5..869ef2408 100644 --- a/src/Charts/PythonChart.cpp +++ b/src/Charts/PythonChart.cpp @@ -450,11 +450,11 @@ PythonChart::setWeb(bool x) } // setup the chart - plot = new GenericPlot(NULL,context); //XXX todo: null to avoid crash on close... + plot = new GenericChart(NULL,context); //XXX todo: null to avoid crash on close... renderlayout->insertWidget(0,plot); // signals to update it - connect(this, SIGNAL(emitChart(QString,int,bool,int)), plot, SLOT(initialiseChart(QString,int,bool,int))); + connect(this, SIGNAL(emitChart(QString,int,bool,int,bool,int)), plot, SLOT(initialiseChart(QString,int,bool,int,bool,int))); connect(this, SIGNAL(emitCurve(QString,QVector,QVector,QString,QString,QStringList,QStringList,int,int,int,QString,int,bool)), plot, SLOT( addCurve(QString,QVector,QVector,QString,QString,QStringList,QStringList,int,int,int,QString,int,bool))); connect(this, SIGNAL(emitAxis(QString,bool,int,double,double,int,QString,QString,bool,QStringList)), diff --git a/src/Charts/PythonChart.h b/src/Charts/PythonChart.h index e0e7b3811..27d9bfd4a 100644 --- a/src/Charts/PythonChart.h +++ b/src/Charts/PythonChart.h @@ -39,13 +39,7 @@ #include "Context.h" #include "Athlete.h" #include "Colors.h" -#include "GenericPlot.h" - -// keep aligned to library.py -#define GC_CHART_LINE 1 -#define GC_CHART_SCATTER 2 -#define GC_CHART_BAR 3 -#define GC_CHART_PIE 4 +#include "GenericChart.h" class PythonChart; @@ -120,7 +114,7 @@ class PythonChart : public GcChartWindow, public PythonHost { // rendering via a web page or a generic plot QWebEngineView *canvas; - GenericPlot *plot; + GenericChart *plot; void emitUrl(QUrl x) { emit setUrl(x); } @@ -141,7 +135,7 @@ class PythonChart : public GcChartWindow, public PythonHost { signals: void setUrl(QUrl); - void emitChart(QString title, int type, bool animate, int legpos); + void emitChart(QString title, int type, bool animate, int legpos, bool stack, int orientation); void emitCurve(QString name, QVector xseries, QVector yseries, QString xname, QString yname, QStringList labels, QStringList colors, int line, int symbol, int size, QString color, int opacity, bool opengl); diff --git a/src/Python/SIP/Bindings.cpp b/src/Python/SIP/Bindings.cpp index 90a7dfb7c..ddc6714b1 100644 --- a/src/Python/SIP/Bindings.cpp +++ b/src/Python/SIP/Bindings.cpp @@ -58,9 +58,9 @@ Bindings::webpage(QString url) const } bool -Bindings::configChart(QString title, int type, bool animate, int pos) const +Bindings::configChart(QString title, int type, bool animate, int pos, bool stack, int orientation) const { - python->chart->emitChart(title, type, animate, pos); + python->chart->emitChart(title, type, animate, pos, stack, orientation); return true; } diff --git a/src/Python/SIP/Bindings.h b/src/Python/SIP/Bindings.h index b0e01ddee..cd7bf2b84 100644 --- a/src/Python/SIP/Bindings.h +++ b/src/Python/SIP/Bindings.h @@ -114,7 +114,7 @@ class Bindings { bool postProcess(QString processor, PyObject *activity = NULL) const; // working with charts - bool configChart(QString title, int type, bool animate, int pos) const; + bool configChart(QString title, int type, bool animate, int pos, bool stack, int orientation) const; bool setCurve(QString name, PyObject *xseries, PyObject *yseries, QString xname, QString yname, QStringList labels, QStringList colors, int line, int symbol, int symbolsize, QString color, int opacity, bool opengl) const; diff --git a/src/Python/SIP/goldencheetah.sip b/src/Python/SIP/goldencheetah.sip index dde7c73f3..084fb6d1b 100644 --- a/src/Python/SIP/goldencheetah.sip +++ b/src/Python/SIP/goldencheetah.sip @@ -388,7 +388,7 @@ public: bool postProcess(QString processor, PyObject *activity = NULL) const; // working with qt charts - bool configChart(QString title, int type, bool animate, int legpos) const; + bool configChart(QString title, int type, bool animate, int legpos, bool stack, int orientation) const; bool setCurve(QString name, PyObject *xseries, PyObject *yseries, QString xname, QString yname, QStringList labels, QStringList colors, int line, int symbol, int symbolsize, QString color, int opacity, bool opengl) const; diff --git a/src/Python/SIP/sipAPIgoldencheetah.h b/src/Python/SIP/sipAPIgoldencheetah.h index 0d7527dfd..0c613058b 100644 --- a/src/Python/SIP/sipAPIgoldencheetah.h +++ b/src/Python/SIP/sipAPIgoldencheetah.h @@ -47,142 +47,146 @@ #define sipName_athleteZones &sipStrings_goldencheetah[237] #define sipNameNr_configChart 250 #define sipName_configChart &sipStrings_goldencheetah[250] -#define sipNameNr_postProcess 262 -#define sipName_postProcess &sipStrings_goldencheetah[262] -#define sipNameNr_seasonPeaks 274 -#define sipName_seasonPeaks &sipStrings_goldencheetah[274] -#define sipNameNr_xdataSeries 286 -#define sipName_xdataSeries &sipStrings_goldencheetah[286] -#define sipNameNr_QStringList 298 -#define sipName_QStringList &sipStrings_goldencheetah[298] -#define sipNameNr___setitem__ 310 -#define sipName___setitem__ &sipStrings_goldencheetah[310] -#define sipNameNr___getitem__ 322 -#define sipName___getitem__ &sipStrings_goldencheetah[322] -#define sipNameNr_configAxis 334 -#define sipName_configAxis &sipStrings_goldencheetah[334] -#define sipNameNr_categories 345 -#define sipName_categories &sipStrings_goldencheetah[345] -#define sipNameNr_labelcolor 356 -#define sipName_labelcolor &sipStrings_goldencheetah[356] -#define sipNameNr_symbolsize 367 -#define sipName_symbolsize &sipStrings_goldencheetah[367] -#define sipNameNr_seriesUnit 378 -#define sipName_seriesUnit &sipStrings_goldencheetah[378] -#define sipNameNr_xdataNames 389 -#define sipName_xdataNames &sipStrings_goldencheetah[389] -#define sipNameNr_seriesLast 400 -#define sipName_seriesLast &sipStrings_goldencheetah[400] -#define sipNameNr_seriesName 411 -#define sipName_seriesName &sipStrings_goldencheetah[411] -#define sipNameNr_activities 422 -#define sipName_activities &sipStrings_goldencheetah[422] -#define sipNameNr_processor 433 -#define sipName_processor &sipStrings_goldencheetah[433] -#define sipNameNr_seasonPmc 443 -#define sipName_seasonPmc &sipStrings_goldencheetah[443] -#define sipNameNr_setCurve 453 -#define sipName_setCurve &sipStrings_goldencheetah[453] -#define sipNameNr_duration 462 -#define sipName_duration &sipStrings_goldencheetah[462] -#define sipNameNr_activity 471 -#define sipName_activity &sipStrings_goldencheetah[471] -#define sipNameNr_threadid 480 -#define sipName_threadid &sipStrings_goldencheetah[480] -#define sipNameNr_Bindings 489 -#define sipName_Bindings &sipStrings_goldencheetah[489] -#define sipNameNr_visible 498 -#define sipName_visible &sipStrings_goldencheetah[498] -#define sipNameNr_opacity 506 -#define sipName_opacity &sipStrings_goldencheetah[506] -#define sipNameNr_yseries 514 -#define sipName_yseries &sipStrings_goldencheetah[514] -#define sipNameNr_xseries 522 -#define sipName_xseries &sipStrings_goldencheetah[522] -#define sipNameNr_animate 530 -#define sipName_animate &sipStrings_goldencheetah[530] -#define sipNameNr_metrics 538 -#define sipName_metrics &sipStrings_goldencheetah[538] -#define sipNameNr_compare 546 -#define sipName_compare &sipStrings_goldencheetah[546] -#define sipNameNr_athlete 554 -#define sipName_athlete &sipStrings_goldencheetah[554] -#define sipNameNr_webpage 562 -#define sipName_webpage &sipStrings_goldencheetah[562] -#define sipNameNr_version 570 -#define sipName_version &sipStrings_goldencheetah[570] -#define sipNameNr___len__ 578 -#define sipName___len__ &sipStrings_goldencheetah[578] -#define sipNameNr___str__ 586 -#define sipName___str__ &sipStrings_goldencheetah[586] -#define sipNameNr_QString 594 -#define sipName_QString &sipStrings_goldencheetah[594] -#define sipNameNr_opengl 602 -#define sipName_opengl &sipStrings_goldencheetah[602] -#define sipNameNr_symbol 609 -#define sipName_symbol &sipStrings_goldencheetah[609] -#define sipNameNr_colors 616 -#define sipName_colors &sipStrings_goldencheetah[616] -#define sipNameNr_labels 623 -#define sipName_labels &sipStrings_goldencheetah[623] -#define sipNameNr_legpos 630 -#define sipName_legpos &sipStrings_goldencheetah[630] -#define sipNameNr_metric 637 -#define sipName_metric &sipStrings_goldencheetah[637] -#define sipNameNr_series 515 -#define sipName_series &sipStrings_goldencheetah[515] -#define sipNameNr_season 644 -#define sipName_season &sipStrings_goldencheetah[644] -#define sipNameNr_filter 651 -#define sipName_filter &sipStrings_goldencheetah[651] -#define sipNameNr_result 658 -#define sipName_result &sipStrings_goldencheetah[658] -#define sipNameNr_remove 665 -#define sipName_remove &sipStrings_goldencheetah[665] -#define sipNameNr_append 672 -#define sipName_append &sipStrings_goldencheetah[672] -#define sipNameNr_align 679 -#define sipName_align &sipStrings_goldencheetah[679] -#define sipNameNr_color 361 -#define sipName_color &sipStrings_goldencheetah[361] -#define sipNameNr_yname 685 -#define sipName_yname &sipStrings_goldencheetah[685] -#define sipNameNr_xname 691 -#define sipName_xname &sipStrings_goldencheetah[691] -#define sipNameNr_title 697 -#define sipName_title &sipStrings_goldencheetah[697] -#define sipNameNr_index 703 -#define sipName_index &sipStrings_goldencheetah[703] -#define sipNameNr_group 709 -#define sipName_group &sipStrings_goldencheetah[709] -#define sipNameNr_xdata 715 -#define sipName_xdata &sipStrings_goldencheetah[715] -#define sipNameNr_sport 721 -#define sipName_sport &sipStrings_goldencheetah[721] -#define sipNameNr_value 727 -#define sipName_value &sipStrings_goldencheetah[727] -#define sipNameNr_build 733 -#define sipName_build &sipStrings_goldencheetah[733] -#define sipNameNr_line 739 -#define sipName_line &sipStrings_goldencheetah[739] -#define sipNameNr_join 744 -#define sipName_join &sipStrings_goldencheetah[744] -#define sipNameNr_name 686 -#define sipName_name &sipStrings_goldencheetah[686] -#define sipNameNr_type 749 -#define sipName_type &sipStrings_goldencheetah[749] -#define sipNameNr_date 754 -#define sipName_date &sipStrings_goldencheetah[754] -#define sipNameNr_log 759 -#define sipName_log &sipStrings_goldencheetah[759] +#define sipNameNr_orientation 262 +#define sipName_orientation &sipStrings_goldencheetah[262] +#define sipNameNr_postProcess 274 +#define sipName_postProcess &sipStrings_goldencheetah[274] +#define sipNameNr_seasonPeaks 286 +#define sipName_seasonPeaks &sipStrings_goldencheetah[286] +#define sipNameNr_xdataSeries 298 +#define sipName_xdataSeries &sipStrings_goldencheetah[298] +#define sipNameNr_QStringList 310 +#define sipName_QStringList &sipStrings_goldencheetah[310] +#define sipNameNr___setitem__ 322 +#define sipName___setitem__ &sipStrings_goldencheetah[322] +#define sipNameNr___getitem__ 334 +#define sipName___getitem__ &sipStrings_goldencheetah[334] +#define sipNameNr_configAxis 346 +#define sipName_configAxis &sipStrings_goldencheetah[346] +#define sipNameNr_categories 357 +#define sipName_categories &sipStrings_goldencheetah[357] +#define sipNameNr_labelcolor 368 +#define sipName_labelcolor &sipStrings_goldencheetah[368] +#define sipNameNr_symbolsize 379 +#define sipName_symbolsize &sipStrings_goldencheetah[379] +#define sipNameNr_seriesUnit 390 +#define sipName_seriesUnit &sipStrings_goldencheetah[390] +#define sipNameNr_xdataNames 401 +#define sipName_xdataNames &sipStrings_goldencheetah[401] +#define sipNameNr_seriesLast 412 +#define sipName_seriesLast &sipStrings_goldencheetah[412] +#define sipNameNr_seriesName 423 +#define sipName_seriesName &sipStrings_goldencheetah[423] +#define sipNameNr_activities 434 +#define sipName_activities &sipStrings_goldencheetah[434] +#define sipNameNr_processor 445 +#define sipName_processor &sipStrings_goldencheetah[445] +#define sipNameNr_seasonPmc 455 +#define sipName_seasonPmc &sipStrings_goldencheetah[455] +#define sipNameNr_setCurve 465 +#define sipName_setCurve &sipStrings_goldencheetah[465] +#define sipNameNr_duration 474 +#define sipName_duration &sipStrings_goldencheetah[474] +#define sipNameNr_activity 483 +#define sipName_activity &sipStrings_goldencheetah[483] +#define sipNameNr_threadid 492 +#define sipName_threadid &sipStrings_goldencheetah[492] +#define sipNameNr_Bindings 501 +#define sipName_Bindings &sipStrings_goldencheetah[501] +#define sipNameNr_visible 510 +#define sipName_visible &sipStrings_goldencheetah[510] +#define sipNameNr_opacity 518 +#define sipName_opacity &sipStrings_goldencheetah[518] +#define sipNameNr_yseries 526 +#define sipName_yseries &sipStrings_goldencheetah[526] +#define sipNameNr_xseries 534 +#define sipName_xseries &sipStrings_goldencheetah[534] +#define sipNameNr_animate 542 +#define sipName_animate &sipStrings_goldencheetah[542] +#define sipNameNr_metrics 550 +#define sipName_metrics &sipStrings_goldencheetah[550] +#define sipNameNr_compare 558 +#define sipName_compare &sipStrings_goldencheetah[558] +#define sipNameNr_athlete 566 +#define sipName_athlete &sipStrings_goldencheetah[566] +#define sipNameNr_webpage 574 +#define sipName_webpage &sipStrings_goldencheetah[574] +#define sipNameNr_version 582 +#define sipName_version &sipStrings_goldencheetah[582] +#define sipNameNr___len__ 590 +#define sipName___len__ &sipStrings_goldencheetah[590] +#define sipNameNr___str__ 598 +#define sipName___str__ &sipStrings_goldencheetah[598] +#define sipNameNr_QString 606 +#define sipName_QString &sipStrings_goldencheetah[606] +#define sipNameNr_opengl 614 +#define sipName_opengl &sipStrings_goldencheetah[614] +#define sipNameNr_symbol 621 +#define sipName_symbol &sipStrings_goldencheetah[621] +#define sipNameNr_colors 628 +#define sipName_colors &sipStrings_goldencheetah[628] +#define sipNameNr_labels 635 +#define sipName_labels &sipStrings_goldencheetah[635] +#define sipNameNr_legpos 642 +#define sipName_legpos &sipStrings_goldencheetah[642] +#define sipNameNr_metric 649 +#define sipName_metric &sipStrings_goldencheetah[649] +#define sipNameNr_series 527 +#define sipName_series &sipStrings_goldencheetah[527] +#define sipNameNr_season 656 +#define sipName_season &sipStrings_goldencheetah[656] +#define sipNameNr_filter 663 +#define sipName_filter &sipStrings_goldencheetah[663] +#define sipNameNr_result 670 +#define sipName_result &sipStrings_goldencheetah[670] +#define sipNameNr_remove 677 +#define sipName_remove &sipStrings_goldencheetah[677] +#define sipNameNr_append 684 +#define sipName_append &sipStrings_goldencheetah[684] +#define sipNameNr_align 691 +#define sipName_align &sipStrings_goldencheetah[691] +#define sipNameNr_color 373 +#define sipName_color &sipStrings_goldencheetah[373] +#define sipNameNr_yname 697 +#define sipName_yname &sipStrings_goldencheetah[697] +#define sipNameNr_xname 703 +#define sipName_xname &sipStrings_goldencheetah[703] +#define sipNameNr_stack 709 +#define sipName_stack &sipStrings_goldencheetah[709] +#define sipNameNr_title 715 +#define sipName_title &sipStrings_goldencheetah[715] +#define sipNameNr_index 721 +#define sipName_index &sipStrings_goldencheetah[721] +#define sipNameNr_group 727 +#define sipName_group &sipStrings_goldencheetah[727] +#define sipNameNr_xdata 733 +#define sipName_xdata &sipStrings_goldencheetah[733] +#define sipNameNr_sport 739 +#define sipName_sport &sipStrings_goldencheetah[739] +#define sipNameNr_value 745 +#define sipName_value &sipStrings_goldencheetah[745] +#define sipNameNr_build 751 +#define sipName_build &sipStrings_goldencheetah[751] +#define sipNameNr_line 757 +#define sipName_line &sipStrings_goldencheetah[757] +#define sipNameNr_join 762 +#define sipName_join &sipStrings_goldencheetah[762] +#define sipNameNr_name 698 +#define sipName_name &sipStrings_goldencheetah[698] +#define sipNameNr_type 767 +#define sipName_type &sipStrings_goldencheetah[767] +#define sipNameNr_date 772 +#define sipName_date &sipStrings_goldencheetah[772] +#define sipNameNr_log 777 +#define sipName_log &sipStrings_goldencheetah[777] #define sipNameNr_max 120 #define sipName_max &sipStrings_goldencheetah[120] -#define sipNameNr_min 763 -#define sipName_min &sipStrings_goldencheetah[763] -#define sipNameNr_all 767 -#define sipName_all &sipStrings_goldencheetah[767] -#define sipNameNr_url 771 -#define sipName_url &sipStrings_goldencheetah[771] +#define sipNameNr_min 781 +#define sipName_min &sipStrings_goldencheetah[781] +#define sipNameNr_all 785 +#define sipName_all &sipStrings_goldencheetah[785] +#define sipNameNr_url 789 +#define sipName_url &sipStrings_goldencheetah[789] #define sipMalloc sipAPI_goldencheetah->api_malloc #define sipFree sipAPI_goldencheetah->api_free diff --git a/src/Python/SIP/sipgoldencheetahBindings.cpp b/src/Python/SIP/sipgoldencheetahBindings.cpp index b1ce96d97..81359de9f 100644 --- a/src/Python/SIP/sipgoldencheetahBindings.cpp +++ b/src/Python/SIP/sipgoldencheetahBindings.cpp @@ -1057,6 +1057,8 @@ static PyObject *meth_Bindings_configChart(PyObject *sipSelf, PyObject *sipArgs, int a1; bool a2; int a3; + bool a4; + int a5; const ::Bindings *sipCpp; static const char *sipKwdList[] = { @@ -1064,13 +1066,15 @@ static PyObject *meth_Bindings_configChart(PyObject *sipSelf, PyObject *sipArgs, sipName_type, sipName_animate, sipName_legpos, + sipName_stack, + sipName_orientation, }; - if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, NULL, "BJ1ibi", &sipSelf, sipType_Bindings, &sipCpp, sipType_QString,&a0, &a0State, &a1, &a2, &a3)) + if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, NULL, "BJ1ibibi", &sipSelf, sipType_Bindings, &sipCpp, sipType_QString,&a0, &a0State, &a1, &a2, &a3, &a4, &a5)) { bool sipRes; - sipRes = sipCpp->configChart(*a0,a1,a2,a3); + sipRes = sipCpp->configChart(*a0,a1,a2,a3,a4,a5); sipReleaseType(a0,sipType_QString,a0State); return PyBool_FromLong(sipRes); diff --git a/src/Python/SIP/sipgoldencheetahcmodule.cpp b/src/Python/SIP/sipgoldencheetahcmodule.cpp index e17fe504f..3ab30054e 100644 --- a/src/Python/SIP/sipgoldencheetahcmodule.cpp +++ b/src/Python/SIP/sipgoldencheetahcmodule.cpp @@ -35,6 +35,7 @@ const char sipStrings_goldencheetah[] = { 'a', 'c', 't', 'i', 'v', 'i', 't', 'y', 'W', 'b', 'a', 'l', 0, 'a', 't', 'h', 'l', 'e', 't', 'e', 'Z', 'o', 'n', 'e', 's', 0, 'c', 'o', 'n', 'f', 'i', 'g', 'C', 'h', 'a', 'r', 't', 0, + 'o', 'r', 'i', 'e', 'n', 't', 'a', 't', 'i', 'o', 'n', 0, 'p', 'o', 's', 't', 'P', 'r', 'o', 'c', 'e', 's', 's', 0, 's', 'e', 'a', 's', 'o', 'n', 'P', 'e', 'a', 'k', 's', 0, 'x', 'd', 'a', 't', 'a', 'S', 'e', 'r', 'i', 'e', 's', 0, @@ -84,6 +85,7 @@ const char sipStrings_goldencheetah[] = { 'a', 'l', 'i', 'g', 'n', 0, 'y', 'n', 'a', 'm', 'e', 0, 'x', 'n', 'a', 'm', 'e', 0, + 's', 't', 'a', 'c', 'k', 0, 't', 'i', 't', 'l', 'e', 0, 'i', 'n', 'd', 'e', 'x', 0, 'g', 'r', 'o', 'u', 'p', 0, diff --git a/src/Resources/python/library.py b/src/Resources/python/library.py index 247ae919d..7fe242914 100644 --- a/src/Resources/python/library.py +++ b/src/Resources/python/library.py @@ -29,8 +29,8 @@ def __GCactivityXdata(name="", activity=None): return rd # setting up the chart -def __GCsetChart(title="",type=1,animate=False,legpos=2): - GC.configChart(title,type,animate,legpos) +def __GCsetChart(title="",type=1,animate=False,legpos=2,stack=False,orientation=2): + GC.configChart(title,type,animate,legpos,stack,orientation) # add a curve def __GCsetCurve(name="",x=list(),y=list(),xaxis="x",yaxis="y", labels=list(), colors=list(),line=1,symbol=0,size=15,color="cyan",opacity=0,opengl=True): @@ -52,6 +52,10 @@ GC.setChart=__GCsetChart GC.addCurve=__GCsetCurve GC.setAxis=__GCconfigAxis +# orientation +GC_VERTICAL=1 +GC_HORIZONTAL=2 + # line style GC_LINE_NONE=0 GC_LINE_SOLID=1 diff --git a/src/src.pro b/src/src.pro index 7327d8237..766779d81 100644 --- a/src/src.pro +++ b/src/src.pro @@ -668,8 +668,8 @@ greaterThan(QT_MAJOR_VERSION, 4) { # generic chart DEFINES += GC_HAVE_GENERIC - HEADERS += Charts/GenericPlot.h Charts/GenericSelectTool.h Charts/GenericLegend.h - SOURCES += Charts/GenericPlot.cpp Charts/GenericSelectTool.cpp Charts/GenericLegend.cpp + HEADERS += Charts/GenericChart.h Charts/GenericPlot.h Charts/GenericSelectTool.h Charts/GenericLegend.h + SOURCES += Charts/GenericChart.cpp Charts/GenericPlot.cpp Charts/GenericSelectTool.cpp Charts/GenericLegend.cpp } }