Some tricks to remove the right click menù on bar and to color bar and sub bar?
Thanks
Hello Fabrizio,
Thank you for the question.
Please find our answers below:
Removing the right-click menu.
You can use the customizeContextMenu
API call and its viewType
property to disable the right-click menu:
function customizeContextMenuFunction(items, data, viewType) {
if (viewType == "charts") {
return [];
}
}
customizeContextMenu
can be defined in two ways:
flexmonster.customizeContextMenu(customizeFunction: Function)
.new Flexmonster({customizeContextMenu: customizeFunction, ...})
.Changing chart colors.
The following example shows how to change the default colors for charts, check it out on JSFiddle.
To change the sub-bar colors, you can use the customizeChartElement
method:
function customizeChartElementFunction(element, data) {
let newColor = "#ff9999"
if (data.rows && data.rows.length > 1) {
element.style.fill = newColor;
}
}
You are welcome to check the following JSFiddle for reference: https://jsfiddle.net/flexmonster/vxhsw1j2/. Feel free to customize this approach for your use case.
Please let us know if our solution helped. Looking forward to hearing from you.
Kind regards,
Nadia
Hello Fabrizio,
Hope you are doing well.
We were wondering if you had a chance to check the suggested approaches. Could you please confirm if they work for you?
Looking forward to hearing from you.
Kind regards,
Nadia
Yes, perfect! all ok!
I've write two new tickets.
Thanks
Hello,
Thank you for the feedback.
Our team is working on your questions. We will get back to you soon.
You are welcome to contact us in case other questions arise.
Kind regards,
Nadia