@@ -41,7 +41,7 @@ DashboardWidget::DashboardWidget(PIVXGUI* _window, QWidget *parent) :
4141 ui->left ->setProperty (" cssClass" , " container" );
4242 ui->left ->setContentsMargins (0 ,0 ,0 ,0 );
4343 ui->right ->setProperty (" cssClass" , " container-right" );
44- ui->right ->setContentsMargins (20 ,20 ,20 ,20 );
44+ ui->right ->setContentsMargins (20 ,20 ,20 ,0 );
4545
4646 // Title
4747 ui->labelTitle ->setProperty (" cssClass" , " text-title-screen" );
@@ -269,7 +269,7 @@ void DashboardWidget::changeTheme(bool isLightTheme, QString& theme){
269269 this ->changeChartColors ();
270270}
271271
272- const char * monthsNames[ 12 ] = {" Jan" , " Feb" , " Mar" , " Apr" , " May" , " Jun" , " Jul" , " Aug" , " Sep" , " Oct" , " Nov" , " Dec" };
272+ const QStringList monthsNames = {" Jan" , " Feb" , " Mar" , " Apr" , " May" , " Jun" , " Jul" , " Aug" , " Sep" , " Oct" , " Nov" , " Dec" };
273273
274274void DashboardWidget::loadChart (){
275275 int size = stakesFilter->rowCount ();
@@ -279,9 +279,7 @@ void DashboardWidget::loadChart(){
279279 ui->emptyContainerChart ->setVisible (false );
280280 initChart ();
281281 monthFilter = QDate::currentDate ().month ();
282- for (int i = 1 ; i < 13 ; ++i) {
283- ui->comboBoxMonths ->addItem (QString (monthsNames[i-1 ]), QVariant (i));
284- }
282+ for (int i = 1 ; i < 13 ; ++i) ui->comboBoxMonths ->addItem (QString (monthsNames[i-1 ]), QVariant (i));
285283 ui->comboBoxMonths ->setCurrentIndex (monthFilter - 1 );
286284 connect (ui->comboBoxMonths , SIGNAL (currentIndexChanged (const QString&)), this ,SLOT (onChartMonthChanged (const QString&)));
287285 }
@@ -603,11 +601,15 @@ std::pair<int, int> DashboardWidget::getChartRange(QMap<int, std::pair<qint64, q
603601 }
604602}
605603
606- void DashboardWidget::updateAxisX (const char *arg[] ) {
604+ void DashboardWidget::updateAxisX (const QStringList* args ) {
607605 axisX->clear ();
608606 QStringList months;
609607 std::pair<int ,int > range = getChartRange (amountsByCache);
610- for (int i = range.first ; i < range.second ; i++) months << ((arg) ? arg[i-1 ] : QString::number (i));
608+ if (args) {
609+ months = *args;
610+ } else {
611+ for (int i = range.first ; i < range.second ; i++) months << QString::number (i);
612+ }
611613 axisX->append (months);
612614}
613615
@@ -618,7 +620,7 @@ void DashboardWidget::windowResizeEvent(QResizeEvent *event){
618620 isChartMin = false ;
619621 switch (chartShow) {
620622 case YEAR: {
621- updateAxisX (monthsNames);
623+ updateAxisX (& monthsNames);
622624 break ;
623625 }
624626 case ALL: {
0 commit comments