Using Contenttype in charts

Hello.

I want to be able to group by ContentType for my statistics in the charts.

I’ve seen this: Content type column not displaying

But the answer is only getting the ContentType Id, so this is only part of my problem.

EDIT:
I’ve tried to in CAML-query:

5000




But when I try to
handlers.init = function (data, logger, processor, el, model) {
model.fields.push(‘ContentType’);
return true;
}

The Group by “ContentType” I get nothing in my chart

I group by ContentType and count by ID

Please help.

Hi Frikk,

You can retrieve the Content Type ID and then use it for grouping:

Add the reference into the CAML-query:

<View> <ViewFields> <FieldRef Name="ContentTypeId"/> </ViewFields> ... </View>

And add it to the model in the Advanced tab:

[code]handlers.init = function (data, logger, processor, el, model) {
model.fields.push(‘ContentTypeId’);

logger.debug('Data is initialized: ', data);
return true;
}
[/code]

Here you go: