SharePoint 2013中的Morris Charts实现 - 如何使用Json从Status字段获取数据? [英] Morris Charts Implementation in SharePoint 2013 - How to get data from Status field using Json?

查看:57
本文介绍了SharePoint 2013中的Morris Charts实现 - 如何使用Json从Status字段获取数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友们,

我正在尝试在SharePoint中实现Morris折线图,但我无法从状态(SharePoint下拉字段)获取数据。我想显示请求和已完成的项目数量,如下图所示。

I am trying to implement Morris Line Chart in SharePoint and I was not able to get the data from the Status(SharePoint Drop-down field). I want to show the number of items Requested and Completed as shown in the image below.

如上图所示,我想在给定日期显示已完成和已请求项目的计数。我正在使用字段
ID 来获取项目,但这不是我想要的实际数据。

As in the Image above, I want to show the count of Completed and Requested items on the given date. I was taking the field ID to get the items, but it was not the actual data I want.

请帮我找一个解决方案。

Kindly help me to find a solution.

谢谢

推荐答案

Hi Shajanhan,

Hi Shajanhan,

您可以使用Rest API根据日期过滤掉"状态"字段值,以获取请求/已完成项目的计数如下:

You could use Rest API to filter out the Status field value based on date to get the Requested/Completed items count like this:

<script type="text/javascript">


(document).ready(function(){
(document).ready(function(){


.ajax
({
url:_spPageContextInfo.webAbsoluteUrl +" / _ api / web / lists / GetByTitle('DemoList1')/ items?
.ajax ({ url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/GetByTitle('DemoList1')/items?


这篇关于SharePoint 2013中的Morris Charts实现 - 如何使用Json从Status字段获取数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆