Untitled

 avatar
unknown
plain_text
a year ago
3.4 kB
6
Indexable
MonthlyOrderCountComponent.dart    line no 98 to 122

    SfCartesianChart(
            enableAxisAnimation: true,
            enableSideBySideSeriesPlacement: true,
            indicators: [],
            tooltipBehavior: TooltipBehavior(enable: true),
            series: <ChartSeries>[
              SplineAreaSeries<MonthlyOrderCount, String>(
                color: chartColor,
                enableTooltip: true,
                markerSettings: MarkerSettings(isVisible: true),
                dataSource: widget.monthlyCount!,
                xValueMapper: (MonthlyOrderCount exp, _) => exp.date!,
                yValueMapper: (MonthlyOrderCount exp, _) => widget.isPaymentType ? exp.total : exp.total,
              )
              // StackedColumnSeries<MonthlyOrderCount, String>(
              //   color: primaryColor,
              //   enableTooltip: true,
              //   markerSettings: MarkerSettings(isVisible: true),
              //   dataSource: widget.monthlyCount!,
              //   xValueMapper: (MonthlyOrderCount exp, _) => exp.date!,
              //   yValueMapper: (MonthlyOrderCount exp, _) => widget.isPaymentType ? exp.total : exp.total,
              // ),
            ],
            primaryXAxis: CategoryAxis(isVisible: true),
          ),
MonthlyPaymentCountComponent   line no 99 to 144 replace with below code
     SizedBox(
            height: 348,
            child: BarChart(
              [
                Series<MonthlyPaymentCompletedReport, String>(
                  displayName: language.completed,
                  id: 'Completed',
                  domainFn: (MonthlyPaymentCompletedReport data, _) => DateTime.parse(data.date).day.toString(),
                  measureFn: (MonthlyPaymentCompletedReport data, _) => data.totalAmount,
                  data: widget.monthlyCompletePayment,
                  colorFn: (MonthlyPaymentCompletedReport sales, _) {
                    return MaterialPalette.green.shadeDefault;
                  },
                  fillColorFn: (MonthlyPaymentCompletedReport sales, _) {
                    return MaterialPalette.green.shadeDefault;
                  },
                ),
                Series<MonthlyPaymentCompletedReport, String>(
                  displayName: language.cancelled,
                  id: 'Cancelled',
                  domainFn: (MonthlyPaymentCompletedReport data, _) => DateTime.parse(data.date).day.toString(),
                  measureFn: (MonthlyPaymentCompletedReport data, _) => data.totalAmount,
                  data: widget.monthlyCancelPayment,
                  colorFn: (MonthlyPaymentCompletedReport sales, _) {
                    return MaterialPalette.red.shadeDefault;
                  },
                  fillColorFn: (MonthlyPaymentCompletedReport sales, _) {
                    return MaterialPalette.red.shadeDefault;
                  },
                ),
              ],
              animate: true,
              vertical: true,
              barGroupingType: BarGroupingType.grouped,
              behaviors: [
                new SeriesLegend(
                  showMeasures: true,
                  position: BehaviorPosition.top,
                  horizontalFirst: true,
                  measureFormatter: (num? value) {
                    return value == null ? '-' : '${printAmount(value)}';
                  },
                ),
              ],
            ),
          ),
Editor is loading...
Leave a Comment