Skip to content

Commit

Permalink
Merge pull request #537 from quanpower/patch-1
Browse files Browse the repository at this point in the history
Update quickcharts.rst
  • Loading branch information
dpgaspar committed Jul 5, 2017
2 parents f9f298b + a78a201 commit d18acfc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/quickcharts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ we must create a function to calculate the *college_perc*::
Now we are ready to define our view::

from flask_appbuilder.charts.views import DirectByChartView
from flask_appbuilder.model.sqla.interface import SQLAInterface
from flask_appbuilder.models.sqla.interface import SQLAInterface

class CountryDirectChartView(DirectByChartView):
datamodel = SQLAInterface(CountryStats)
Expand Down Expand Up @@ -76,7 +76,7 @@ Where 'label' and 'formatter' are optional parameters.
So on the same view you can have multiple direct chart definitions, like this::

from flask_appbuilder.charts.views import DirectByChartView
from flask_appbuilder.model.sqla.interface import SQLAInterface
from flask_appbuilder.models.sqla.interface import SQLAInterface

class CountryDirectChartView(DirectByChartView):
datamodel = SQLAInterface(CountryStats)
Expand Down Expand Up @@ -163,7 +163,7 @@ Now we are ready to define our view::

from flask_appbuilder.charts.views import GroupByChartView
from flask_appbuilder.models.group import aggregate_count, aggregate_sum, aggregate_avg
from flask_appbuilder.model.sqla.interface import SQLAInterface
from flask_appbuilder.models.sqla.interface import SQLAInterface


class CountryGroupByChartView(GroupByChartView):
Expand Down Expand Up @@ -195,7 +195,7 @@ A different and interesting example is to group data monthly from all countries,
import calendar
from flask_appbuilder.charts.views import GroupByChartView
from flask_appbuilder.models.group import aggregate_count, aggregate_sum, aggregate_avg
from flask_appbuilder.model.sqla.interface import SQLAInterface
from flask_appbuilder.models.sqla.interface import SQLAInterface

def pretty_month_year(value):
return calendar.month_name[value.month] + ' ' + str(value.year)
Expand Down

0 comments on commit d18acfc

Please sign in to comment.