I am doing following :
- creating a json file using some logic in python django
- This json file is now used by high chart js code to render the pie chart
code for highchart js is as below :
//high chart json pie chart
$(document).ready(function() {
console.log("hi from high chart from json PIE")
$.getJSON("{% static 'money/data/highchartpie.json' %}", function(json) {
console.log("haha i have read the json")
$('#containerHighChartJSONPie').highcharts({
chart: {
plotBackgroundColor: null,
plotBorderWidth: 1,//null,
plotShadow: false
},
title: {
text: 'Expenses per Types of Expenditures'
},
tooltip: {
pointFormat: '{point.name}: <b>{point.percentage:.1f}%</b>'
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
format: '<b>{point.name}</b>: {point.percentage:.1f} %',
style: {
color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
}
}
}
},
series: [{
type: 'pie',
name: 'Type of Expenditure',
data: json
}]
});
});
});
data as in json is : [["Grocery",50.0],["Miscellaneous",30.0]]
Problem Following generates good pie chart as desired , if any data is changed the graph is also changed however sometimes the graph dosent show the updated data in it . I tried :
- Running it from another browser - it was showing updated graph with new values
- cleared cache and tried again in same browser and now it was showing updated code
So it seems its a cache issue , But is there any way to fix this in highchart code ?