我需要使用趋势线更改图表大号中的值,该趋势线指的是趋势线中的最后一个值,其总和类似于图表大号中的值。 我该如何更改代码 类BigNumberViz(BaseViz):
"""Put emphasis on a single metric with this big number viz"""
viz_type = 'big_number'
verbose_name = _('Big Number with Trendline')
credits = 'a <a href="https://github.com/airbnb/superset">Superset</a> original'
is_timeseries = True
def query_obj(self):
d = super(BigNumberViz, self).query_obj()
metric = self.form_data.get('metric')
if not metric:
raise Exception(_('Pick a metric!'))
d['metrics'] = [self.form_data.get('metric')]
self.form_data['metric'] = metric
return d