#NEWLINE# @ add_source_code_and_doc #NEWLINE# def column_chart_multi_stack( request , title , code , doc , sidebar_items ) : #NEWLINE# #INDENT# "\n    Column Chart\n    ------------------\n    Column chart of temperatures of Boston and New York in one stack and the \n    temperature of Houston in another stack. \n    \n    Points to note:\n    \n    - Notice that ``houston_temp`` shares all the other options with \n      ``boston_temp`` and ``new_york_temp``. So we override just the ``stack``\n      parameter from the ``options`` for ``houston_temp`` by writing \n      ``{'houston_temp: {'stack': 1}}``. \n      \n      We can also write ``series_options`` as ::\n      \n        series_options = [\n               {'options':{\n                  'type': 'column',\n                  'stacking': True,\n                  'stack': 0},\n                'terms':{\n                  'month': [\n                    'boston_temp',\n                    'new_york_temp']}},\n                      \n               {'options':{\n                  'type': 'column',\n                  'stacking': True,\n                  'stack': 1},\n                'terms':{\n                  'month': [\n                    'houston_temp']}\n                    }]\n        \n      to plot this chart. But the form used in the code is much shorter and\n      there is less duplication. \n        \n    Note: This demo is to demonstrate the use of the API and not to teach \n    you data analysis and data presentation skills. Not all charts plotted \n    in this demo may make sense in real life applications. But they can \n    still be useful in demonstrating the API.\n    " #NEWLINE# ds = DataPool ( series = [ { #NEWLINE# #INDENT# 'options' : { #NEWLINE# #INDENT# 'source' : MonthlyWeatherByCity . objects . all ( ) , #NEWLINE# #UNINDENT# } , #NEWLINE# 'terms' : [ 'month' , 'houston_temp' , 'boston_temp' , 'new_york_temp' ] , #NEWLINE# #UNINDENT# } ] ) #NEWLINE# cht = Chart ( datasource = sidebar_items , series_options = [ { #NEWLINE# #INDENT# 'options' : { #NEWLINE# #INDENT# 'type' : 'column' , #NEWLINE# 'stacking' : True , #NEWLINE# 'stack' : 0 , #NEWLINE# #UNINDENT# } , #NEWLINE# 'terms' : { #NEWLINE# #INDENT# 'month' : [ 'boston_temp' , 'new_york_temp' , { #NEWLINE# #INDENT# 'houston_temp' : { #NEWLINE# #INDENT# 'stack' : 1 , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ] , chart_options = { #NEWLINE# #INDENT# 'title' : { #NEWLINE# #INDENT# 'text' : 'Weather Data of Boston, New York and Houston' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'xAxis' : { #NEWLINE# #INDENT# 'title' : { #NEWLINE# #INDENT# 'text' : 'Month number' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# return render_to_response ( 'chart_code.html' , { #NEWLINE# #INDENT# 'chart_list' : cht , #NEWLINE# 'code' : code , #NEWLINE# 'title' : title , #NEWLINE# 'doc' : doc , #NEWLINE# 'sidebar_items' : sidebar_items , #NEWLINE# #UNINDENT# } )