Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
2162 Lượt xem

how to customize bar color in graph view basead on field state.
need the color of the column in the chart to be based on

state = fields.Selection(
[('green', 'Green'),
('yellow', 'Yellow'),
('red', 'Red'),],
string="State", index=True)

custom_render.js

odoo.define('organizational_climate_outtech.custom_graph_renderer', function (require) {
"use strict";

var GraphRenderer = require('web.GraphRenderer');
var core = require('web.core');

var CustomGraphRenderer = GraphRenderer.extend({
// Adicione sua lógica personalizada aqui
COLORS: ["#0c774f", "#ff0017", "#ffef45",],
});

return CustomGraphRenderer;
});


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,
Refer to this blog, It shows How to Change the Color on a Progress Bar in Odoo14


https://www.cybrosys.com/blog/how-to-change-the-color-on-a-progress-bar-in-odoo14

Hope it helps

Ảnh đại diện
Huỷ bỏ
Tác giả

I need to change the color of the bar chart in graph view

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 5 22
3499
0
thg 5 23
3158
1
thg 1 23
7993
1
thg 12 20
7522
1
thg 5 25
8211