Multiple sources on same chart

This example demonstrates data from two different models MonthlyWeatherByCity and MonthlyWeatherSeattle on the same chart and on the same x-axis. Notice that we've mixed RawQuerySet and QuerySet sources together!

code

ds = DataPool(
        series=[{
            'options': {
                'source': MonthlyWeatherByCity.objects.raw(
                          "SELECT * FROM demoproject_monthlyweatherbycity"
                          )
            },
            'terms': [
                'month',
                'houston_temp',
                'boston_temp'
            ]}, {
            'options': {
                'source': MonthlyWeatherSeattle.objects.all()
            },
            'terms': [
                {'month_seattle': 'month'},
                'seattle_temp'
            ]}
         ]
)

cht = Chart(
        datasource=ds,
        series_options=[{
            'options': {
                'type': 'line',
                'stacking': False
            },
            'terms': {
                'month': [
                    'boston_temp',
                    'houston_temp'],
                'month_seattle': ['seattle_temp']
            }
        }],
        chart_options={
            'title': {
                'text': 'Weather by Month (from 2 different tables)'},
            'xAxis': {
                'title': {
                    'text': 'Month number'
                }
            }
        }
)