def charts(self): if self.show_chart: chart = EWSLineChart("Inventory Management Trends", x_axis=Axis(self.chart_x_label, 'd'), y_axis=Axis(self.chart_y_label, '.1f')) for product, value in self.chart_data.iteritems(): chart.add_dataset(product, value) return [chart] return []
def charts(self): if self.show_chart: chart = EWSLineChart("Inventory Management Trends", x_axis=Axis(self.chart_x_label, 'd'), y_axis=Axis(self.chart_y_label, '.1f')) chart.height = 600 for product, value in self.chart_data.iteritems(): chart.add_dataset(product, value, color='red' if product in ['Understock', 'Overstock'] else None) return [chart] return []
def charts(self): rows = self.rows if self.show_chart: chart = EWSLineChart("Stockout by Product", x_axis=Axis(self.chart_x_label, dateFormat='%b %Y'), y_axis=Axis(self.chart_y_label, 'd')) chart.x_axis_uses_dates = True for key, value in rows.iteritems(): chart.add_dataset(key, value) return [chart] return []
def charts(self): if self.show_chart: loc = SQLLocation.objects.get(location_id=self.config['location_id']) chart = EWSLineChart("Inventory Management Trends", x_axis=Axis(self.chart_x_label, 'd'), y_axis=Axis(self.chart_y_label, '.1f')) chart.height = 600 values = [] for product, value in self.chart_data.iteritems(): values.extend([a['y'] for a in value]) chart.add_dataset(product, value, color='black' if product in ['Understock', 'Overstock'] else None) chart.forceY = [0, loc.location_type.understock_threshold + loc.location_type.overstock_threshold] return [chart] return []
def charts(self): rows = self.rows if self.show_chart: chart = EWSLineChart("Stockout by Product", x_axis=Axis(self.chart_x_label, dateFormat='%b %Y'), y_axis=Axis(self.chart_y_label, 'd')) chart.x_axis_uses_dates = True chart.tooltipFormat = True chart.is_rendered_as_email = self.config.get('is_rendered_as_email') for key, value in rows.iteritems(): chart.add_dataset(key, value) return [chart] return []
def charts(self): if self.show_chart: loc = SQLLocation.objects.get( location_id=self.config['location_id']) chart = EWSLineChart("Inventory Management Trends", x_axis=Axis(self.chart_x_label, 'd'), y_axis=Axis(self.chart_y_label, '.1f')) chart.height = 600 values = [] for product, value in self.chart_data.iteritems(): values.extend([a['y'] for a in value]) chart.add_dataset(product, value, color='black' if product in ['Understock', 'Overstock'] else None) chart.forceY = [ 0, loc.location_type.understock_threshold + loc.location_type.overstock_threshold ] chart.is_rendered_as_email = self.config.get( 'is_rendered_as_email', False) return [chart] return []