Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
charts
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
drupal.org
charts
Commits
0f22d640
Commit
0f22d640
authored
11 years ago
by
Nathan Haug
Browse files
Options
Downloads
Patches
Plain Diff
Provide sample views.
parent
6a51c324
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
views/charts.views_default.inc
+163
-0
163 additions, 0 deletions
views/charts.views_default.inc
with
163 additions
and
0 deletions
views/charts.views_default.inc
0 → 100644
+
163
−
0
View file @
0f22d640
<?php
/**
* @file
* Default views for Charts module.
*/
/**
* Implements hook_views_default_views().
*/
function
charts_views_default_views
()
{
$view
=
new
view
();
$view
->
name
=
'charts_demo'
;
$view
->
description
=
''
;
$view
->
tag
=
'default'
;
$view
->
base_table
=
'node'
;
$view
->
human_name
=
'charts_demo'
;
$view
->
core
=
7
;
$view
->
api_version
=
'3.0'
;
$view
->
disabled
=
FALSE
;
/* Edit this to true to make a default view disabled initially */
/* Display: Master */
$handler
=
$view
->
new_display
(
'default'
,
'Master'
,
'default'
);
$handler
->
display
->
display_options
[
'title'
]
=
'Chart Examples'
;
$handler
->
display
->
display_options
[
'use_more_always'
]
=
FALSE
;
$handler
->
display
->
display_options
[
'group_by'
]
=
TRUE
;
$handler
->
display
->
display_options
[
'access'
][
'type'
]
=
'perm'
;
$handler
->
display
->
display_options
[
'access'
][
'perm'
]
=
'access example charts'
;
$handler
->
display
->
display_options
[
'cache'
][
'type'
]
=
'none'
;
$handler
->
display
->
display_options
[
'query'
][
'type'
]
=
'views_query'
;
$handler
->
display
->
display_options
[
'exposed_form'
][
'type'
]
=
'basic'
;
$handler
->
display
->
display_options
[
'pager'
][
'type'
]
=
'full'
;
$handler
->
display
->
display_options
[
'pager'
][
'options'
][
'items_per_page'
]
=
'10'
;
$handler
->
display
->
display_options
[
'style_plugin'
]
=
'table'
;
$handler
->
display
->
display_options
[
'style_options'
][
'columns'
]
=
array
(
'type_1'
=>
'type_1'
,
'type'
=>
'type'
,
);
$handler
->
display
->
display_options
[
'style_options'
][
'default'
]
=
'-1'
;
$handler
->
display
->
display_options
[
'style_options'
][
'info'
]
=
array
(
'type_1'
=>
array
(
'sortable'
=>
0
,
'default_sort_order'
=>
'asc'
,
'align'
=>
''
,
'separator'
=>
''
,
'empty_column'
=>
0
,
),
'type'
=>
array
(
'sortable'
=>
0
,
'default_sort_order'
=>
'asc'
,
'align'
=>
''
,
'separator'
=>
''
,
'empty_column'
=>
0
,
),
);
/* Field: Content: Type */
$handler
->
display
->
display_options
[
'fields'
][
'type_1'
][
'id'
]
=
'type_1'
;
$handler
->
display
->
display_options
[
'fields'
][
'type_1'
][
'table'
]
=
'node'
;
$handler
->
display
->
display_options
[
'fields'
][
'type_1'
][
'field'
]
=
'type'
;
/* Field: COUNT(Content: Type) */
$handler
->
display
->
display_options
[
'fields'
][
'type'
][
'id'
]
=
'type'
;
$handler
->
display
->
display_options
[
'fields'
][
'type'
][
'table'
]
=
'node'
;
$handler
->
display
->
display_options
[
'fields'
][
'type'
][
'field'
]
=
'type'
;
$handler
->
display
->
display_options
[
'fields'
][
'type'
][
'group_type'
]
=
'count'
;
$handler
->
display
->
display_options
[
'fields'
][
'type'
][
'label'
]
=
'Nodes'
;
/* Filter criterion: Content: Published */
$handler
->
display
->
display_options
[
'filters'
][
'status'
][
'id'
]
=
'status'
;
$handler
->
display
->
display_options
[
'filters'
][
'status'
][
'table'
]
=
'node'
;
$handler
->
display
->
display_options
[
'filters'
][
'status'
][
'field'
]
=
'status'
;
$handler
->
display
->
display_options
[
'filters'
][
'status'
][
'value'
]
=
1
;
$handler
->
display
->
display_options
[
'filters'
][
'status'
][
'group'
]
=
1
;
$handler
->
display
->
display_options
[
'filters'
][
'status'
][
'expose'
][
'operator'
]
=
FALSE
;
/* Display: Page */
$handler
=
$view
->
new_display
(
'page'
,
'Page'
,
'page'
);
$handler
->
display
->
display_options
[
'defaults'
][
'header'
]
=
FALSE
;
/* Header: Global: Text area */
$handler
->
display
->
display_options
[
'header'
][
'area'
][
'id'
]
=
'area'
;
$handler
->
display
->
display_options
[
'header'
][
'area'
][
'table'
]
=
'views'
;
$handler
->
display
->
display_options
[
'header'
][
'area'
][
'field'
]
=
'area'
;
$handler
->
display
->
display_options
[
'header'
][
'area'
][
'content'
]
=
'These charts are created using Views. This example may be edited through the Views UI.'
;
$handler
->
display
->
display_options
[
'header'
][
'area'
][
'format'
]
=
'2'
;
$handler
->
display
->
display_options
[
'path'
]
=
'charts/examples/views'
;
$handler
->
display
->
display_options
[
'menu'
][
'type'
]
=
'tab'
;
$handler
->
display
->
display_options
[
'menu'
][
'title'
]
=
'Views example'
;
$handler
->
display
->
display_options
[
'menu'
][
'weight'
]
=
'1'
;
$handler
->
display
->
display_options
[
'menu'
][
'context'
]
=
0
;
$handler
->
display
->
display_options
[
'menu'
][
'context_only_inline'
]
=
0
;
/* Display: Column Chart */
$handler
=
$view
->
new_display
(
'attachment'
,
'Column Chart'
,
'column'
);
$handler
->
display
->
display_options
[
'defaults'
][
'title'
]
=
FALSE
;
$handler
->
display
->
display_options
[
'title'
]
=
'Pie Chart'
;
$handler
->
display
->
display_options
[
'pager'
][
'type'
]
=
'some'
;
$handler
->
display
->
display_options
[
'defaults'
][
'style_plugin'
]
=
FALSE
;
$handler
->
display
->
display_options
[
'style_plugin'
]
=
'chart'
;
$handler
->
display
->
display_options
[
'style_options'
][
'library'
]
=
NULL
;
$handler
->
display
->
display_options
[
'style_options'
][
'type'
]
=
'column'
;
$handler
->
display
->
display_options
[
'style_options'
][
'title'
]
=
'Title text'
;
$handler
->
display
->
display_options
[
'style_options'
][
'title_position'
]
=
''
;
$handler
->
display
->
display_options
[
'style_options'
][
'xaxis_title'
]
=
'Node type'
;
$handler
->
display
->
display_options
[
'style_options'
][
'xaxis_labels_rotation'
]
=
'30'
;
$handler
->
display
->
display_options
[
'style_options'
][
'yaxis_title'
]
=
'Number of nodes'
;
$handler
->
display
->
display_options
[
'style_options'
][
'yaxis_min'
]
=
'0'
;
$handler
->
display
->
display_options
[
'style_options'
][
'yaxis_max'
]
=
'260'
;
$handler
->
display
->
display_options
[
'style_options'
][
'yaxis_prefix'
]
=
'$'
;
$handler
->
display
->
display_options
[
'style_options'
][
'yaxis_suffix'
]
=
'lb'
;
$handler
->
display
->
display_options
[
'style_options'
][
'yaxis_decimal_count'
]
=
'2'
;
$handler
->
display
->
display_options
[
'style_options'
][
'yaxis_labels_rotation'
]
=
'30'
;
$handler
->
display
->
display_options
[
'style_options'
][
'label_field'
]
=
'type_1'
;
$handler
->
display
->
display_options
[
'style_options'
][
'data_fields'
]
=
array
(
'type'
=>
'type'
);
$handler
->
display
->
display_options
[
'defaults'
][
'style_options'
]
=
FALSE
;
$handler
->
display
->
display_options
[
'defaults'
][
'row_plugin'
]
=
FALSE
;
$handler
->
display
->
display_options
[
'defaults'
][
'row_options'
]
=
FALSE
;
$handler
->
display
->
display_options
[
'displays'
]
=
array
(
'page'
=>
'page'
,
'default'
=>
0
,
'page_1'
=>
0
,
);
/* Display: Pie Chart */
$handler
=
$view
->
new_display
(
'attachment'
,
'Pie Chart'
,
'pie'
);
$handler
->
display
->
display_options
[
'defaults'
][
'title'
]
=
FALSE
;
$handler
->
display
->
display_options
[
'title'
]
=
'Pie Chart'
;
$handler
->
display
->
display_options
[
'pager'
][
'type'
]
=
'some'
;
$handler
->
display
->
display_options
[
'defaults'
][
'style_plugin'
]
=
FALSE
;
$handler
->
display
->
display_options
[
'style_plugin'
]
=
'chart'
;
$handler
->
display
->
display_options
[
'style_options'
][
'type'
]
=
'pie'
;
$handler
->
display
->
display_options
[
'style_options'
][
'label_field'
]
=
'type_1'
;
$handler
->
display
->
display_options
[
'style_options'
][
'data_fields'
]
=
array
(
'type'
=>
'type'
);
$handler
->
display
->
display_options
[
'defaults'
][
'style_options'
]
=
FALSE
;
$handler
->
display
->
display_options
[
'defaults'
][
'row_plugin'
]
=
FALSE
;
$handler
->
display
->
display_options
[
'defaults'
][
'row_options'
]
=
FALSE
;
$handler
->
display
->
display_options
[
'displays'
]
=
array
(
'page'
=>
'page'
,
'default'
=>
0
,
);
$translatables
[
'charts_demo'
]
=
array
(
t
(
'Master'
),
t
(
'Chart Examples'
),
t
(
'more'
),
t
(
'Apply'
),
t
(
'Reset'
),
t
(
'Sort by'
),
t
(
'Asc'
),
t
(
'Desc'
),
t
(
'Items per page'
),
t
(
'- All -'
),
t
(
'Offset'
),
t
(
'« first'
),
t
(
'‹ previous'
),
t
(
'next ›'
),
t
(
'last »'
),
t
(
'Type'
),
t
(
'Nodes'
),
t
(
'Page'
),
t
(
'These charts are created using Views. This example may be edited through the Views UI.'
),
t
(
'Column Chart'
),
t
(
'Pie Chart'
),
);
$views
[]
=
$view
;
return
$views
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment