{"id":30922,"date":"2014-07-30T23:14:44","date_gmt":"2014-07-30T23:14:44","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/wp-custom-field-chart\/"},"modified":"2014-08-18T01:21:22","modified_gmt":"2014-08-18T01:21:22","slug":"wp-custom-field-chart","status":"publish","type":"plugin","link":"https:\/\/lmo.wordpress.org\/plugins\/wp-custom-field-chart\/","author":13972535,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"0.0.5","stable_tag":"0.0.5","tested":"3.9.40","requires":"3.9.1","requires_php":"","requires_plugins":"","header_name":"Wp Custom Field Chart","header_author":"Joachim Basmaison","header_description":"","assets_banners_color":"","last_updated":"2014-08-18 01:21:22","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"http:\/\/wordpress.org\/extend\/plugins\/wp-custom-field-chart","header_author_uri":"","rating":0,"author_block_rating":0,"active_installs":10,"downloads":1641,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.0.1","0.0.2","0.0.3","0.0.4","0.0.5"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"958373","resolution":"1","location":"assets"},"screenshot-2.png":{"filename":"screenshot-2.png","revision":"958382","resolution":"2","location":"assets"},"screenshot-3.png":{"filename":"screenshot-3.png","revision":"958383","resolution":"3","location":"assets"}},"screenshots":{"1":"One field for each chart (Two tags)","2":"Combined field in one chart (One Tag)","3":"Bar chart with different <em>interval<\/em>"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[2510,2009,229],"plugin_category":[59],"plugin_contributors":[95084],"plugin_business_model":[],"class_list":["post-30922","plugin","type-plugin","status-publish","hentry","plugin_tags-chart","plugin_tags-custom-field","plugin_tags-javascript","plugin_category-utilities-and-tools","plugin_contributors-showi","plugin_committers-showi"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/wp-custom-field-chart.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/wp-custom-field-chart\/assets\/screenshot-1.png?rev=958373","caption":"One field for each chart (Two tags)"},{"src":"https:\/\/ps.w.org\/wp-custom-field-chart\/assets\/screenshot-2.png?rev=958382","caption":"Combined field in one chart (One Tag)"},{"src":"https:\/\/ps.w.org\/wp-custom-field-chart\/assets\/screenshot-3.png?rev=958383","caption":"Bar chart with different <em>interval<\/em>"}],"raw_content":"<!--section=description-->\n<p>This plugin collect data attached to post\/article via <strong>custom field<\/strong> and make\nchart of it.\nThis plugin use <strong>Chart.js<\/strong> for chart drawing <a href=\"http:\/\/www.chartjs.org\/\">ChartJs<\/a><\/p>\n\n<p>Data are collected by looking for specific <em>custom field<\/em> attached to your\npost\/page. You can change aggregation method, intervall...<\/p>\n\n<p>See <a href=\"http:\/\/wordpress.org\/plugins\/wp-custom-field-chart\/other_notes\/\">usage<\/a><\/p>\n\n<h3>Usage<\/h3>\n\n<p>Edit your post\/page in text mode and put some Javascript and a Wordpress tag<\/p>\n\n<h4>Minimum<\/h4>\n\n<pre><code>&lt;script&gt;\nvar mydata = { datasets: [{}]};\n&lt;\/script&gt;\n[custom_field_chart fields=\"humidity\" js_data=\"mydata\"]\n<\/code><\/pre>\n\n<p>For each field you need to put empty {} into datasets.<\/p>\n\n<p>For two fields:<\/p>\n\n<pre><code>&lt;script&gt;\nvar mydata = {datasets: [{},{}]}\n&lt;\/script&gt;\n[custom_field_chart fields=\"humidity,temperature\" js_data=\"mydata\"]\n<\/code><\/pre>\n\n<p>But it's pretty useless to put more than one field without different colors :)<\/p>\n\n<h4>More<\/h4>\n\n<pre><code>&lt;script&gt;\nvar mydata = {\n    datasets: [\n        {\n            label: \"Humidity\",\n            fillColor: \"rgba(255,73,0,1)\",\n            strokeColor: \"rgba(255,73,0,1)\",\n            pointColor: \"rgba(255,73,0,1)\",\n            pointStrokeColor: \"#fff\",\n            pointHighlightFill: \"#fff\",\n            pointHighlightStroke: \"rgba(220,220,220,1)\",\n        },\n        {\n            label: \"Temperature\",\n            fillColor: \"rgba(255,73,0,1)\",\n            strokeColor: \"rgba(255,73,0,1)\",\n            pointColor: \"rgba(255,73,0,1)\",\n            pointStrokeColor: \"#fff\",\n            pointHighlightFill: \"#fff\",\n            pointHighlightStroke: \"rgba(220,220,220,1)\",\n        },\n    ]\n};\n\nvar myopts = {\n    pointDotRadius: 1,\n    bezierCurveTension: 0.2,\n    barStrokeWidth : 2,\n    barValueSpacing : 2,\n    barDatasetSpacing : 0,\n};\n\n\/\/ Optional...\njQuery(window).load(function() {\n    Chart.defaults.global.responsive = true;\n    Chart.defaults.global.animationEasing = \"easeOutBounce\";\n    Chart.defaults.global.onAnimationComplete = function(){\n        alert('Hello');\n    }\n});\n\/\/ End optional\n&lt;\/script&gt;\n\n[custom_field_chart width=\"1000\" height=\"300\"\n  kind=\"line\" method=\"track\" interval=\"day\" interval_count=\"31\" \n  fields=\"humidity,temperature\" js_data=\"mydata\" js_options=\"myopts\"]\n<\/code><\/pre>\n\n<h4>Notes<\/h4>\n\n<ol>\n<li>js_data and js_options must reflect name given to your javascript variable.<\/li>\n<li>Look at http:\/\/chartjs.org\/ for documentation<\/li>\n<li>You don't need to supply labels and data (like in chartjs.org example) :)<\/li>\n<\/ol>\n\n<h3>Tag attributes<\/h3>\n\n<p>= Required =\n1. <em>fields<\/em>: Custom field separate by comma\n1. <em>js_data<\/em>: Name of javascript variable holding chart datasets<\/p>\n\n<h4>Optional<\/h4>\n\n<ol>\n<li><em>width<\/em>: Chart width (default: 400)<\/li>\n<li><em>height<\/em>: Chart Height (default: 200)<\/li>\n<li><em>method<\/em>: Aggregate method track, delta or cumulative (defaul: track)<\/li>\n<li><em>interval<\/em>: year, month, day (default: day)<\/li>\n<li><em>interval_count<\/em>: How many year, mont or day (default: 31)<\/li>\n<li><em>js_options<\/em>: Name of javascript variable holding chart options<\/li>\n<li><em>kind<\/em>: Chart type line or bar (default: line)<\/li>\n<li><em>to_date<\/em>: Current date by default, post date if 'post' specified else value supplied <\/li>\n<li><em>dump<\/em>: Dumping attributes for debug (default: False)<\/li>\n<li><em>round<\/em>: Rounding data with specified precision<\/li>\n<\/ol>\n\n<h3>Note<\/h3>\n\n<p>Beta software... Interface may change.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload the entire <code>wp-custom-field-chart<\/code> folder to the <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<li>Include [custom_field_chart] tag in your post\/page (See Other Notes)<\/li>\n<\/ol>\n\n<!--section=faq-->\n<p>No FAQ :-)<\/p>\n\n<!--section=changelog-->\n<h4>0.0.5<\/h4>\n\n<ul>\n<li>Bump Chart.js version to 1.0.1-beta.4<\/li>\n<li>Better use of Field object, cleaning of old code<\/li>\n<\/ul>\n\n<h4>0.0.4<\/h4>\n\n<ul>\n<li>Add <em>round<\/em> and <em>dump<\/em> attribute<\/li>\n<li>Using <em>Field<\/em> class everywhere<\/li>\n<\/ul>\n\n<h4>0.0.3<\/h4>\n\n<ul>\n<li>More attribute validation and default<\/li>\n<li>Now as to_date default, introducing post to specify post date as to_date<\/li>\n<li>Better readme, well more informations...<\/li>\n<\/ul>\n\n<h4>0.0.2<\/h4>\n\n<ul>\n<li>Uploading some screenshots<\/li>\n<li>Improved readme.txt<\/li>\n<\/ul>\n\n<h4>0.0.1<\/h4>\n\n<ul>\n<li>Beta Release<\/li>\n<\/ul>","raw_excerpt":"Make chart from custom field attached to your post\/page using Chart.js javascript library.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/lmo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/30922","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lmo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/lmo.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/lmo.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=30922"}],"author":[{"embeddable":true,"href":"https:\/\/lmo.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/showi"}],"wp:attachment":[{"href":"https:\/\/lmo.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=30922"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/lmo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=30922"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/lmo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=30922"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/lmo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=30922"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/lmo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=30922"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/lmo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=30922"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}