You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Google charts are not working due to content security policy. I have allowed https://www.gstatic.com, but instead of graph it is showing invalid json string for options of charts.
If i add unsafe-eval charts are working properly, but its open security risk.Can i use google charts without adding unsafe-eval in csp? This is my code for google charts
var trader = parseInt($('#scr-trader-data').val());
var service_provider = parseInt($('#scr-service-provider-data').val());
var manufacturer = parseInt($('#scr-manufacturer-data').val());
var bl_undisclosed = parseInt($('#scr-bl-undisclosed').val());
var data = google.visualization.arrayToDataTable([
['Task', 'Hours per Day'],
['Trader', trader ],
['Service Provider', service_provider ],
['Manufacturer', manufacturer ],
['Undisclosed', bl_undisclosed ]
]);
// console.log(data);
var options = {
title: '',
legend: { position: 'bottom', alignment: 'start' },
chartArea: {width: 230, height: 200},
slices: {0: {color: '#696969'}, 1:{color: '#a3fc83'}, 2:{color: '#87CEFA'}, 3:{color: '#000000'}}
};
var chart = new google.visualization.PieChart(document.getElementById('piechart1'));
google.visualization.events.addListener(chart, 'select', selectHandler);
chart.draw(data, options);
function selectHandler() {
var selectedItem = chart.getSelection()[0];
var topping = data.getValue(selectedItem.row, 0);
console.log(topping);
locationq = "/management/procurement/search/business_line/" + topping;
window.location = locationq;
}
chart.draw(data, options);
The text was updated successfully, but these errors were encountered:
Google charts are not working due to content security policy. I have allowed https://www.gstatic.com, but instead of graph it is showing invalid json string for options of charts.
If i add unsafe-eval charts are working properly, but its open security risk.Can i use google charts without adding unsafe-eval in csp? This is my code for google charts
var trader = parseInt($('#scr-trader-data').val());
var service_provider = parseInt($('#scr-service-provider-data').val());
var manufacturer = parseInt($('#scr-manufacturer-data').val());
var bl_undisclosed = parseInt($('#scr-bl-undisclosed').val());
The text was updated successfully, but these errors were encountered: