Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.ajax({
- cache: false,
- dataType: "json",
- url: "{% static 'money/data/highchartpiesam.json' %}" ,
- success: function(json) {
- console.log("haha i have read the json")
- console.log('Success',this.url)
- $('#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
- }]
- });
- }
- });
- $(document).ready(function() {
- console.log("aah document is loaded ")
- console.log("File Name code");
- var a='{% static '.concat(''money/data/highchartpie').concat('{{ user.username }}').concat('.json'').concat("%}");
- console.log("File Name code : Value of initial string is a is ",a);
- var chartFileName=a;
- $.ajax({
- cache: false,
- dataType: "json",
- url: chartFileName ,
- success: function(json) {
- console.log("haha i have read the json")
- console.log('Success',this.url)
- $('#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
- }]
- });
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement