current position:Home>[Django CI system] echarts dataset standard writing - 20220509

[Django CI system] echarts dataset standard writing - 20220509

2022-05-15 03:36:34i see the future

echarts Of dataset Standard writing

option = {
    
  dataset: [
    {
    
      dimensions: ['name', 'score'],
      source: [
        ['Hannah Krause', 41,],
        ['Zhao Qian', 20, ],
        ['Jasmin Krause ', 52,],
      ]
    },
    {
    
      transform: {
    
        type: 'sort',
        config: {
     dimension: 'score', order: 'desc' }
      }
    }
  ],
  title: {
    
    text: 'Referer of a Website',
    subtext: 'Fake Data',
    left: 'center'
  },
  tooltip: {
    
    trigger: 'item'
  },
  legend: {
    
    orient: 'vertical',
    left: 'left'
  },
  series: [
    {
    
      name: 'Access From',
      type: 'pie',
      radius: '50%',
      emphasis: {
    
        itemStyle: {
    
          shadowBlur: 10,
          shadowOffsetX: 0,
          shadowColor: 'rgba(0, 0, 0, 0.5)'
        }
      }
    }
  ]
};

 Insert picture description here

Back end construction dataset

The output of the following function conforms to dataset The format of :
json.dumps(value12A) [[‘ Process quality department ’, 4], [‘ General personnel department ’, 1], [‘ Product R & D department ’, 1], [‘ Logistics Department ’, 1], [‘ The operation Department of the general manager's office ’, 3], [‘ raw Foaming production ’, 1], [‘ Production assembly ’, 1], [‘EHS’, 1], [‘ Finance Department &IT’, 2]]

    # main12 Parameter extraction 
    list_of_dept_review_count = []
    dict_of_sum_dept_review_count = {
    }
    for de in dept_review.objects.all():
        list_of_dept_review_count.append(de.dept_review_suggestion_dept_reviewer)
    for each_dept in list_of_dept_review_count:
        dept_sum = dept_review.objects.filter(Q(dept_review_suggestion_dept_reviewer=each_dept) & Q(dept_review_suggestion_finished_review=' Approved ')).aggregate(each_dept=Count('dept_review_suggestion_employee_id'))
        process_dict = {
    each_dept : dept_sum['each_dept']}
        dict_of_sum_dept_review_count.update(process_dict)
    print('dict_of_sum_dept_review_count',dict_of_sum_dept_review_count) #{' Process quality department ': 5, ' The operation Department of the general manager's office ': 1}
    value12A = []
    for key,value in dict_of_sum_suggestion_dept_count.items():
        listA = []
        listA.append(key)
        listA.append(value)
        value12A.append(listA)
    print('json.dumps(value12A)',json.dumps(value12A))
    print('json.dumps(value12A)',json.loads(json.dumps(value12A)))

copyright notice
author[i see the future],Please bring the original link to reprint, thank you.
https://en.pythonmana.com/2022/131/202205111536124412.html

Random recommended