Forum Replies Created
-
AuthorPosts
-
Hi Alexander,
It’s the Associated Items Summary Field who is getting the error.
I don’t knwo why.
I created a calculated field equal to Associated Items Summary Field.
And replace the second by the first on chart.
and it’s working now.Hi,
I have on the same page other charts setting up with the same list as source.
And these charts are working.
There must one or 2 fields on the chart who is corrupted.
Let me try to rebuild the same chart by adding field one by one and see what field cause the error.Ok. I get it.
So i can’t get in one row 2 columns from different list(different structure).
The custom data is made to get data from duplicate list.
Per exemple i have one list who is full(limit 5000 rows)
i want to archive and duplicate it, to get a new list(same structure).
But i need to get data from the 2 list in one chart.
So i can use custom data joint the list.
Am i right?Hello Alexander,
Thanx for the answer.
I choose to replace the text field “Equipe” by people picker.
it’s Look like the java script is working now.
But the chart still not loading.
See Error in the picture belowJava script files:
function getChartCustomDatasource(chartId) {
var deferred = jQuery.Deferred(), deferreds = [];
if (spjs.charts.customData === undefined) {
spjs.charts.customData = {};
}
spjs.charts.customData[chartId] = [];
deferreds.push(getDataList1(chartId));
deferreds.push(getDataList2(chartId));
jQuery.when.apply(jQuery, deferreds).then(function () {
deferred.resolve(spjs.charts.customData[chartId]);
});
return deferred.promise();
}// Get data from list 1
function getDataList1(chartId) {
var d = jQuery.Deferred();
spjs.charts.getItemsREST({
“listId”: “{566BEAF5-742B-43CA-A2B7-74CA72B02067}”,
“listBaseUrl”: _spPageContextInfo.webServerRelativeUrl,
“select”: [
“ID”,
“Title”,
“NBMATCH”,
“Equipe/Title”
],
“expand”: [“Equipe”],
“filter”: “”
}).done(function (data) {
jQuery.each(data, function (i, item) {
// A people picker is returned as an object and need to be changed to a string.
item.Equipe = item.Equipe.Title;
spjs.charts.customData[chartId].push(item);
});
d.resolve();
}).fail(function (err) {
// console.log(err);
});
return d.promise();
}// Get data from list 2
function getDataList2(chartId) {
var d = jQuery.Deferred();
spjs.charts.getItemsREST({
“listId”: “{970B6E59-A6A2-42D6-81B2-9AC114AC4011}”,
“listBaseUrl”: _spPageContextInfo.webServerRelativeUrl,
“select”: [
“ID”,
“Title”,
“NBWIN”,
“Equipe/Title”
],
“expand”: [“Equipe”],
“filter”: “”
}).done(function (data) {
jQuery.each(data, function (i, item) {
// A people picker is returned as an object and need to be changed to a string.
item.Equipe = item.Equipe.Title;
// If the fields are not the same in list 1 and 2 you must map the value to the correct field name like this:
// item.field_name_in_list_1 = item.field_name_in_list_2;
spjs.charts.customData[chartId].push(item);
});
d.resolve();
}).fail(function (err) {
// console.log(err);
});
return d.promise();
}Attachments:
My Java scrip file:
function getChartCustomDatasource(chartId) {
var deferred = jQuery.Deferred(), deferreds = [];
if (spjs.charts.customData === undefined) {
spjs.charts.customData = {};
}
spjs.charts.customData[chartId] = [];
deferreds.push(getDataList1(chartId));
deferreds.push(getDataList2(chartId));
jQuery.when.apply(jQuery, deferreds).then(function () {
deferred.resolve(spjs.charts.customData[chartId]);
});
return deferred.promise();
}// Get data from list 1
function getDataList1(chartId) {
var d = jQuery.Deferred();
spjs.charts.getItemsREST({
“listId”: “{566BEAF5-742B-43CA-A2B7-74CA72B02067}”,
“listBaseUrl”: _spPageContextInfo.webServerRelativeUrl,
“select”: [
“ID”,
“Title”,
“NBMATCH”
],
“expand”: [],
“filter”: “”
}).done(function (data) {
jQuery.each(data, function (i, item) {
// A people picker is returned as an object and need to be changed to a string.
item.Equipe = item.Equipe.Title;
spjs.charts.customData[chartId].push(item);
});
d.resolve();
}).fail(function (err) {
// console.log(err);
});
return d.promise();
}// Get data from list 2
function getDataList2(chartId) {
var d = jQuery.Deferred();
spjs.charts.getItemsREST({
“listId”: “{970B6E59-A6A2-42D6-81B2-9AC114AC4011}”,
“listBaseUrl”: _spPageContextInfo.webServerRelativeUrl,
“select”: [
“ID”,
“Title”,
“NBWIN”
],
“expand”: [],
“filter”: “”
}).done(function (data) {
jQuery.each(data, function (i, item) {
// A people picker is returned as an object and need to be changed to a string.
item.Equipe = item.Equipe.Title;
// If the fields are not the same in list 1 and 2 you must map the value to the correct field name like this:
// item.field_name_in_list_1 = item.field_name_in_list_2;
spjs.charts.customData[chartId].push(item);
});
d.resolve();
}).fail(function (err) {
// console.log(err);
});
return d.promise();
} -
AuthorPosts