Pareto Chart

Pivot Chart plotted as a pareto chart w.r.t the total sales quantity.

code

ds = PivotDataPool(
      series=[
       {'options': {
          'source': SalesHistory.objects.all(),
          'categories': [
            'bookstore__city__state',
            'bookstore__city__city'],
          'legend_by': 'book__genre__name'},
        'terms': {
          'tot_sales': Sum('sale_qty')}}],
      top_n=5,
      top_n_term='tot_sales',
      pareto_term='tot_sales')

pivcht = PivotChart(
          datasource=ds,
          series_options=[
            {'options': {
               'type': 'column',
               'stacking': True,
               'xAxis': 0,
               'yAxis': 0},
             'terms': ['tot_sales']}])