我这里有个突如其来的飞车-https://stackblitz.com/edit/d3-bar-stacked-update?embed=1&file=index.js&hideNavigation=1
我正在尝试创建一个堆积的条形图,以使用D3更新模式进行更新。
我有轴更新,但条形图没有更新
当页面首次加载时,将调用update函数,数据更新并且update函数起作用
我确实尝试在此处添加代码,但是我总是会出错
答案 0 :(得分:1)
您需要先更新组,然后再更新条:
class Hr_transf_employee(models.Model):
_name = 'hr.employee.transfer'
_rec_name = 'employee_id'
@api.multi
def transfert(self):
self.date_cration == "date_transfer"
if self.region_new :
self.state_work_id = self.region_new.id
if self.country_work_id_new :
self.country_work_id = self.country_work_id_new.id
date_cration = fields.Date(string='Date order', required=True, default=datetime.today())
date_transfer = fields.Date(string='Date transfer')
employee_id = fields.Many2one('hr.employee',string='Employee', required=True)
job_id_new = fields.Many2one('hr.job',string='Job title', required=True)
country_work_id_new = fields.Many2one('res.country', 'Country work new')
state = fields.Selection([
('draft', 'Draft'),
('accept', 'Accept'),
('done', 'Done'),
('cancel', 'Cancel'),
], string='Order Status', readonly=True, copy=False, store=True, default='draft')