Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
2163 มุมมอง

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;
});


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง
ผู้เขียน

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

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
พ.ค. 22
3499
0
พ.ค. 23
3158
1
ม.ค. 23
7993
ReferenceError: instance is not defined แก้ไขแล้ว
1
ธ.ค. 20
7522
how to read field values using js แก้ไขแล้ว
1
พ.ค. 25
8211