图表分组/缺少类别标签不正确

时间:2016-05-04 19:46:32

标签: kendo-ui

我的图表显示其数据的分组不正确。

以下是可重复性最小的示例:

        $('#chart').kendoChart({
            dataSource: {
                transport:{
                    read: {
                        url: 'url',
                        type: 'post',
                        data: { data: 'data' }
                    }
                },
                group:{
                    field: 'NQSDName'
                }
            },
            seriesDefaults: {
                type: 'column',
                stack: true
            },
            series: [
                {
                    field: 'MeasuresCount',
                }
            ],
            categoryAxis: [{
                field: 'TINShortName'
            }]
        });

这是它返回的数据:

[
  {
    "NQSDName": "Effective Clinical Care",
    "FilterDisplayName": "236- Controlling High Blood Pressure\n\r\n119- Diabetes: Medical Attention for Neuropat\n\r\n113- Colorectal Cancer Screening\n\r\n112- Breast Cancer Screening\n\r\n  1- Diabetes: Hemoglobin A1c Poor Control",
    "TINName": "TinID - #47",
    "TINShortName": "TinID 47",
    "TINID": 47,
    "NQSDID": 3,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 5
  },
  {
    "NQSDName": "Community\/Population Health",
    "FilterDisplayName": "226- Preventive Care and Screening: Tobacco U\n\r\n128- Preventive Care and Screening: Body Mass\n\r\n111- Pneumonia Vaccination Status for Older A\n\r\n110- Preventive Care and Screening: Influenza",
    "TINName": "TinID - #47",
    "TINShortName": "TinID 47",
    "TINID": 47,
    "NQSDID": 2,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 4
  },
  {
    "NQSDName": "Patient Safety",
    "FilterDisplayName": "130- Documentation of Current Medications in ",
    "TINName": "TinID - #47",
    "TINShortName": "TinID 47",
    "TINID": 47,
    "NQSDID": 5,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 1
  },
  {
    "NQSDName": "Effective Clinical Care",
    "FilterDisplayName": "236- Controlling High Blood Pressure\n\r\n113- Colorectal Cancer Screening\n\r\n112- Breast Cancer Screening\n\r\n119- Diabetes: Medical Attention for Neuropat\n\r\n  1- Diabetes: Hemoglobin A1c Poor Control",
    "TINName": "TinID - #55",
    "TINShortName": "TinID 55",
    "TINID": 55,
    "NQSDID": 3,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 5
  },
  {
    "NQSDName": "Community\/Population Health",
    "FilterDisplayName": "226- Preventive Care and Screening: Tobacco U\n\r\n128- Preventive Care and Screening: Body Mass\n\r\n111- Pneumonia Vaccination Status for Older A\n\r\n110- Preventive Care and Screening: Influenza",
    "TINName": "TinID - #55",
    "TINShortName": "TinID 55",
    "TINID": 55,
    "NQSDID": 2,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 4
  },
  {
    "NQSDName": "Patient Safety",
    "FilterDisplayName": "130- Documentation of Current Medications in ",
    "TINName": "TinID - #55",
    "TINShortName": "TinID 55",
    "TINID": 55,
    "NQSDID": 5,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 1
  },
  {
    "NQSDName": "Effective Clinical Care",
    "FilterDisplayName": "119- Diabetes: Medical Attention for Neuropat\n\r\n  1- Diabetes: Hemoglobin A1c Poor Control",
    "TINName": "TinID - #45",
    "TINShortName": "TinID 45",
    "TINID": 45,
    "NQSDID": 3,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 2
  },
  {
    "NQSDName": "Community\/Population Health",
    "FilterDisplayName": "226- Preventive Care and Screening: Tobacco U\n\r\n128- Preventive Care and Screening: Body Mass\n\r\n111- Pneumonia Vaccination Status for Older A\n\r\n110- Preventive Care and Screening: Influenza",
    "TINName": "TinID - #58",
    "TINShortName": "TinID 58",
    "TINID": 58,
    "NQSDID": 2,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 4
  },
  {
    "NQSDName": "Patient Safety",
    "FilterDisplayName": "130- Documentation of Current Medications in ",
    "TINName": "TinID - #58",
    "TINShortName": "TinID 58",
    "TINID": 58,
    "NQSDID": 5,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 1
  },
  {
    "NQSDName": "Effective Clinical Care",
    "FilterDisplayName": "113- Colorectal Cancer Screening\n\r\n112- Breast Cancer Screening\n\r\n119- Diabetes: Medical Attention for Neuropat\n\r\n  1- Diabetes: Hemoglobin A1c Poor Control\n\r\n236- Controlling High Blood Pressure",
    "TINName": "TinID - #58",
    "TINShortName": "TinID 58",
    "TINID": 58,
    "NQSDID": 3,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 5
  },
  {
    "NQSDName": "Effective Clinical Care",
    "FilterDisplayName": "236- Controlling High Blood Pressure\n\r\n113- Colorectal Cancer Screening\n\r\n112- Breast Cancer Screening\n\r\n119- Diabetes: Medical Attention for Neuropat\n\r\n  1- Diabetes: Hemoglobin A1c Poor Control",
    "TINName": "TinID - #51",
    "TINShortName": "TinID 51",
    "TINID": 51,
    "NQSDID": 3,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 5
  },
  {
    "NQSDName": "Community\/Population Health",
    "FilterDisplayName": "226- Preventive Care and Screening: Tobacco U\n\r\n128- Preventive Care and Screening: Body Mass\n\r\n111- Pneumonia Vaccination Status for Older A\n\r\n110- Preventive Care and Screening: Influenza",
    "TINName": "TinID - #51",
    "TINShortName": "TinID 51",
    "TINID": 51,
    "NQSDID": 2,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 4
  },
  {
    "NQSDName": "Patient Safety",
    "FilterDisplayName": "130- Documentation of Current Medications in ",
    "TINName": "TinID - #51",
    "TINShortName": "TinID 51",
    "TINID": 51,
    "NQSDID": 5,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 1
  },
  {
    "NQSDName": "Effective Clinical Care",
    "FilterDisplayName": "119- Diabetes: Medical Attention for Neuropat\n\r\n113- Colorectal Cancer Screening\n\r\n  1- Diabetes: Hemoglobin A1c Poor Control\n\r\n112- Breast Cancer Screening\n\r\n236- Controlling High Blood Pressure",
    "TINName": "TinID - #57",
    "TINShortName": "TinID 57",
    "TINID": 57,
    "NQSDID": 3,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 5
  },
  {
    "NQSDName": "Effective Clinical Care",
    "FilterDisplayName": "236- Controlling High Blood Pressure\n\r\n119- Diabetes: Medical Attention for Neuropat\n\r\n113- Colorectal Cancer Screening\n\r\n112- Breast Cancer Screening\n\r\n  1- Diabetes: Hemoglobin A1c Poor Control",
    "TINName": "TinID - #46",
    "TINShortName": "TinID 46",
    "TINID": 46,
    "NQSDID": 3,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 5
  },
  {
    "NQSDName": "Community\/Population Health",
    "FilterDisplayName": "226- Preventive Care and Screening: Tobacco U\n\r\n128- Preventive Care and Screening: Body Mass\n\r\n111- Pneumonia Vaccination Status for Older A\n\r\n110- Preventive Care and Screening: Influenza",
    "TINName": "TinID - #46",
    "TINShortName": "TinID 46",
    "TINID": 46,
    "NQSDID": 2,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 4
  },
  {
    "NQSDName": "Patient Safety",
    "FilterDisplayName": "130- Documentation of Current Medications in ",
    "TINName": "TinID - #46",
    "TINShortName": "TinID 46",
    "TINID": 46,
    "NQSDID": 5,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 1
  },
  {
    "NQSDName": "Community\/Population Health",
    "FilterDisplayName": "226- Preventive Care and Screening: Tobacco U\n\r\n128- Preventive Care and Screening: Body Mass\n\r\n110- Preventive Care and Screening: Influenza\n\r\n111- Pneumonia Vaccination Status for Older A",
    "TINName": "TinID - #57",
    "TINShortName": "TinID 57",
    "TINID": 57,
    "NQSDID": 2,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 4
  },
  {
    "NQSDName": "Patient Safety",
    "FilterDisplayName": "130- Documentation of Current Medications in ",
    "TINName": "TinID - #57",
    "TINShortName": "TinID 57",
    "TINID": 57,
    "NQSDID": 5,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 1
  },
  {
    "NQSDName": "Community\/Population Health",
    "FilterDisplayName": "226- Preventive Care and Screening: Tobacco U\n\r\n128- Preventive Care and Screening: Body Mass\n\r\n111- Pneumonia Vaccination Status for Older A\n\r\n110- Preventive Care and Screening: Influenza",
    "TINName": "TinID - #48",
    "TINShortName": "TinID 48",
    "TINID": 48,
    "NQSDID": 2,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 4
  },
  {
    "NQSDName": "Patient Safety",
    "FilterDisplayName": "130- Documentation of Current Medications in ",
    "TINName": "TinID - #48",
    "TINShortName": "TinID 48",
    "TINID": 48,
    "NQSDID": 5,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 1
  },
  {
    "NQSDName": "Effective Clinical Care",
    "FilterDisplayName": "113- Colorectal Cancer Screening\n\r\n112- Breast Cancer Screening\n\r\n236- Controlling High Blood Pressure\n\r\n119- Diabetes: Medical Attention for Neuropat\n\r\n  1- Diabetes: Hemoglobin A1c Poor Control",
    "TINName": "TinID - #48",
    "TINShortName": "TinID 48",
    "TINID": 48,
    "NQSDID": 3,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 5
  },
  {
    "NQSDName": "Community\/Population Health",
    "FilterDisplayName": "226- Preventive Care and Screening: Tobacco U\n\r\n128- Preventive Care and Screening: Body Mass\n\r\n111- Pneumonia Vaccination Status for Older A",
    "TINName": "TinID - #52",
    "TINShortName": "TinID 52",
    "TINID": 52,
    "NQSDID": 2,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 3
  },
  {
    "NQSDName": "Patient Safety",
    "FilterDisplayName": "130- Documentation of Current Medications in ",
    "TINName": "TinID - #52",
    "TINShortName": "TinID 52",
    "TINID": 52,
    "NQSDID": 5,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 1
  },
  {
    "NQSDName": "Patient Safety",
    "FilterDisplayName": "130- Documentation of Current Medications in ",
    "TINName": "TinID - #56",
    "TINShortName": "TinID 56",
    "TINID": 56,
    "NQSDID": 5,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 1
  },
  {
    "NQSDName": "Community\/Population Health",
    "FilterDisplayName": "226- Preventive Care and Screening: Tobacco U\n\r\n128- Preventive Care and Screening: Body Mass\n\r\n111- Pneumonia Vaccination Status for Older A\n\r\n110- Preventive Care and Screening: Influenza",
    "TINName": "TinID - #53",
    "TINShortName": "TinID 53",
    "TINID": 53,
    "NQSDID": 2,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 4
  },
  {
    "NQSDName": "Patient Safety",
    "FilterDisplayName": "130- Documentation of Current Medications in ",
    "TINName": "TinID - #53",
    "TINShortName": "TinID 53",
    "TINID": 53,
    "NQSDID": 5,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 1
  },
  {
    "NQSDName": "Effective Clinical Care",
    "FilterDisplayName": "113- Colorectal Cancer Screening\n\r\n112- Breast Cancer Screening\n\r\n119- Diabetes: Medical Attention for Neuropat\n\r\n  1- Diabetes: Hemoglobin A1c Poor Control\n\r\n236- Controlling High Blood Pressure",
    "TINName": "TinID - #53",
    "TINShortName": "TinID 53",
    "TINID": 53,
    "NQSDID": 3,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 5
  },
  {
    "NQSDName": "Community\/Population Health",
    "FilterDisplayName": "226- Preventive Care and Screening: Tobacco U\n\r\n128- Preventive Care and Screening: Body Mass\n\r\n111- Pneumonia Vaccination Status for Older A\n\r\n110- Preventive Care and Screening: Influenza",
    "TINName": "TinID - #56",
    "TINShortName": "TinID 56",
    "TINID": 56,
    "NQSDID": 2,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 4
  },
  {
    "NQSDName": "Effective Clinical Care",
    "FilterDisplayName": "113- Colorectal Cancer Screening\n\r\n112- Breast Cancer Screening\n\r\n119- Diabetes: Medical Attention for Neuropat\n\r\n  1- Diabetes: Hemoglobin A1c Poor Control\n\r\n236- Controlling High Blood Pressure",
    "TINName": "TinID - #56",
    "TINShortName": "TinID 56",
    "TINID": 56,
    "NQSDID": 3,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 5
  },
  {
    "NQSDName": "Community\/Population Health",
    "FilterDisplayName": "226- Preventive Care and Screening: Tobacco U\n\r\n128- Preventive Care and Screening: Body Mass\n\r\n111- Pneumonia Vaccination Status for Older A\n\r\n110- Preventive Care and Screening: Influenza",
    "TINName": "TinID - #54",
    "TINShortName": "TinID 54",
    "TINID": 54,
    "NQSDID": 2,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 4
  },
  {
    "NQSDName": "Patient Safety",
    "FilterDisplayName": "130- Documentation of Current Medications in ",
    "TINName": "TinID - #54",
    "TINShortName": "TinID 54",
    "TINID": 54,
    "NQSDID": 5,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 1
  },
  {
    "NQSDName": "Effective Clinical Care",
    "FilterDisplayName": "113- Colorectal Cancer Screening\n\r\n112- Breast Cancer Screening\n\r\n119- Diabetes: Medical Attention for Neuropat\n\r\n  1- Diabetes: Hemoglobin A1c Poor Control",
    "TINName": "TinID - #54",
    "TINShortName": "TinID 54",
    "TINID": 54,
    "NQSDID": 3,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 4
  },
  {
    "NQSDName": "Community\/Population Health",
    "FilterDisplayName": "226- Preventive Care and Screening: Tobacco U\n\r\n128- Preventive Care and Screening: Body Mass\n\r\n110- Preventive Care and Screening: Influenza\n\r\n111- Pneumonia Vaccination Status for Older A",
    "TINName": "TinID - #50",
    "TINShortName": "TinID 50",
    "TINID": 50,
    "NQSDID": 2,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 4
  },
  {
    "NQSDName": "Patient Safety",
    "FilterDisplayName": "130- Documentation of Current Medications in ",
    "TINName": "TinID - #50",
    "TINShortName": "TinID 50",
    "TINID": 50,
    "NQSDID": 5,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 1
  },
  {
    "NQSDName": "Effective Clinical Care",
    "FilterDisplayName": "236- Controlling High Blood Pressure\n\r\n119- Diabetes: Medical Attention for Neuropat\n\r\n113- Colorectal Cancer Screening\n\r\n112- Breast Cancer Screening\n\r\n  1- Diabetes: Hemoglobin A1c Poor Control",
    "TINName": "TinID - #50",
    "TINShortName": "TinID 50",
    "TINID": 50,
    "NQSDID": 3,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 5
  },
  {
    "NQSDName": "Community\/Population Health",
    "FilterDisplayName": "226- Preventive Care and Screening: Tobacco U\n\r\n128- Preventive Care and Screening: Body Mass\n\r\n111- Pneumonia Vaccination Status for Older A\n\r\n110- Preventive Care and Screening: Influenza",
    "TINName": "TinID - #60",
    "TINShortName": "TinID 60",
    "TINID": 60,
    "NQSDID": 2,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 4
  },
  {
    "NQSDName": "Person and Caregiver-Centered Experience and Outcomes",
    "FilterDisplayName": "143- Oncology: Medical and Radiation \u2013 Pain I",
    "TINName": "TinID - #60",
    "TINShortName": "TinID 60",
    "TINID": 60,
    "NQSDID": 6,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 1
  },
  {
    "NQSDName": "Patient Safety",
    "FilterDisplayName": "130- Documentation of Current Medications in ",
    "TINName": "TinID - #60",
    "TINShortName": "TinID 60",
    "TINID": 60,
    "NQSDID": 5,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 1
  },
  {
    "NQSDName": "Effective Clinical Care",
    "FilterDisplayName": "113- Colorectal Cancer Screening\n\r\n112- Breast Cancer Screening\n\r\n236- Controlling High Blood Pressure",
    "TINName": "TinID - #60",
    "TINShortName": "TinID 60",
    "TINID": 60,
    "NQSDID": 3,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 3
  },
  {
    "NQSDName": "Community\/Population Health",
    "FilterDisplayName": "226- Preventive Care and Screening: Tobacco U\n\r\n128- Preventive Care and Screening: Body Mass\n\r\n111- Pneumonia Vaccination Status for Older A\n\r\n110- Preventive Care and Screening: Influenza",
    "TINName": "TinID - #44",
    "TINShortName": "TinID 44",
    "TINID": 44,
    "NQSDID": 2,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 4
  },
  {
    "NQSDName": "Patient Safety",
    "FilterDisplayName": "130- Documentation of Current Medications in ",
    "TINName": "TinID - #44",
    "TINShortName": "TinID 44",
    "TINID": 44,
    "NQSDID": 5,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 1
  },
  {
    "NQSDName": "Effective Clinical Care",
    "FilterDisplayName": "113- Colorectal Cancer Screening\n\r\n112- Breast Cancer Screening\n\r\n236- Controlling High Blood Pressure\n\r\n119- Diabetes: Medical Attention for Neuropat\n\r\n  1- Diabetes: Hemoglobin A1c Poor Control",
    "TINName": "TinID - #44",
    "TINShortName": "TinID 44",
    "TINID": 44,
    "NQSDID": 3,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 5
  },
  {
    "NQSDName": "Effective Clinical Care",
    "FilterDisplayName": "249- Barrett's Esophagus",
    "TINName": "TinID - #59",
    "TINShortName": "TinID 59",
    "TINID": 59,
    "NQSDID": 3,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 1
  },
  {
    "NQSDName": "Community\/Population Health",
    "FilterDisplayName": "226- Preventive Care and Screening: Tobacco U\n\r\n128- Preventive Care and Screening: Body Mass\n\r\n111- Pneumonia Vaccination Status for Older A\n\r\n110- Preventive Care and Screening: Influenza",
    "TINName": "TinID - #49",
    "TINShortName": "TinID 49",
    "TINID": 49,
    "NQSDID": 2,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 4
  },
  {
    "NQSDName": "Patient Safety",
    "FilterDisplayName": "130- Documentation of Current Medications in ",
    "TINName": "TinID - #49",
    "TINShortName": "TinID 49",
    "TINID": 49,
    "NQSDID": 5,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 1
  },
  {
    "NQSDName": "Effective Clinical Care",
    "FilterDisplayName": "113- Colorectal Cancer Screening\n\r\n112- Breast Cancer Screening",
    "TINName": "TinID - #49",
    "TINShortName": "TinID 49",
    "TINID": 49,
    "NQSDID": 3,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 2
  },
  {
    "NQSDName": "Effective Clinical Care",
    "FilterDisplayName": "119- Diabetes: Medical Attention for Neuropat\n\r\n  1- Diabetes: Hemoglobin A1c Poor Control\n\r\n113- Colorectal Cancer Screening\n\r\n112- Breast Cancer Screening",
    "TINName": "TinID - #52",
    "TINShortName": "TinID 52",
    "TINID": 52,
    "NQSDID": 3,
    "ProviderFilterDisplayName": null,
    "NPIID": 0,
    "MeasuresCount": 4
  }
]

以下是结果(请注意不匹配的" TIN ID"值以及缺少类别标签的两列): Chart with incorrect / missing category labels

1 个答案:

答案 0 :(得分:1)

如果并非所有群组的点数都相同,则应使用 series.categoryField 而不是categoryAxis.field。

  series: [{
      field: "MeasuresCount",
      categoryField: "TINShortName",
      name: "#= group.value #"
  }],

DEMO