File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
WooCommerce/Classes/ViewRelated/Dashboard/Stats v4 Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,12 @@ final class StoreStatsV4PeriodViewController: UIViewController {
6363 return ServiceLocator . currencySettings. symbol ( from: ServiceLocator . currencySettings. currencyCode)
6464 }
6565
66- private var orderStatsIntervals : [ OrderStatsV4Interval ] = [ ]
66+ private var orderStatsIntervals : [ OrderStatsV4Interval ] = [ ] {
67+ didSet {
68+ orderStatsIntervalLabels = createOrderStatsIntervalLabels ( orderStatsIntervals: orderStatsIntervals)
69+ }
70+ }
71+ private var orderStatsIntervalLabels : [ String ] = [ ]
6772
6873 private var revenueItems : [ Double ] {
6974 orderStatsIntervals. map ( { ( $0. revenueValue as NSDecimalNumber ) . doubleValue } )
@@ -485,7 +490,7 @@ extension StoreStatsV4PeriodViewController: IAxisValueFormatter {
485490 }
486491
487492 if axis is XAxis {
488- let intervalLabels = createOrderStatsIntervalLabels ( )
493+ let intervalLabels = orderStatsIntervalLabels
489494 let index = Int ( value)
490495 if index >= intervalLabels. count {
491496 DDLogInfo ( " 🔴 orderStatsIntervals count: \( orderStatsIntervals. count) ; value: \( value) ; index: \( index) ; interval labels: \( intervalLabels) " )
@@ -508,7 +513,7 @@ extension StoreStatsV4PeriodViewController: IAxisValueFormatter {
508513 }
509514 }
510515
511- private func createOrderStatsIntervalLabels( ) -> [ String ] {
516+ private func createOrderStatsIntervalLabels( orderStatsIntervals : [ OrderStatsV4Interval ] ) -> [ String ] {
512517 let helper = StoreStatsV4ChartAxisHelper ( )
513518 let intervalDates = orderStatsIntervals. map ( { $0. dateStart ( timeZone: siteTimezone) } )
514519 return helper. generateLabelText ( for: intervalDates,
You can’t perform that action at this time.
0 commit comments