使用图表选项中的“图表”选项时,在显示的图表中会得到不同的结果。示例1将显示字幕,但不显示背景色。示例2将显示背景色,但不显示字幕。还有人遇到过这种行为吗?在
Python 2.7.5版
Django v1.10
django chartit v0.2.7版
django highcharts v0.1.7版
Example 1: displays subtitle, not backgroundColor
#Create the PivotChart object
site_prod_pivotcht = PivotChart(
datasource = site_prod_ds,
series_options = [
{'options':{
'type': 'column',
'stacking': False},
'terms': [
'prod_value',
'wx_adj_value']}
],
chart_options =
{'title': {
'text': 'Actual versus Wx Adjusted Production Data'},
'subtitle': {
'text': report_range},
'backgroundColor': '#7FFFD4',
'xAxis': {
'title': {
'text': 'Group:Sites'}}
}
Example 2: displays backgroundColor, not subtitle
#Create the PivotChart object
site_prod_pivotcht = PivotChart(
datasource = site_prod_ds,
series_options = [
{'options':{
'type': 'column',
'stacking': False},
'terms': [
'prod_value',
'wx_adj_value']}
],
chart_options =
{'chart':{
'title': {
'text': 'Actual versus Wx Adjusted Production Data'},
'subtitle': {
'text': report_range},
'backgroundColor': '#7FFFD4',
'xAxis': {
'title': {
'text': 'Group:Sites'}}}
}
经过一点尝试和错误,我发现了以下工作的意图。在
相关问题 更多 >
编程相关推荐