{"id":36,"date":"2023-10-12T15:21:06","date_gmt":"2023-10-12T15:21:06","guid":{"rendered":"https:\/\/piginfo.lhlfarm.com\/?page_id=36"},"modified":"2023-10-12T15:49:46","modified_gmt":"2023-10-12T15:49:46","slug":"nihao-data-chart","status":"publish","type":"page","link":"https:\/\/piginfo.lhlfarm.com\/index.php\/nihao-data-chart\/","title":{"rendered":"nihao data chart"},"content":{"rendered":"\n<div id=\"m-chart-container-13-1\" class=\"m-chart-container chartjs\">\n\t<canvas id=\"m-chart-13-1\" class=\"m-chart\" height=\"500\"><\/canvas>\n<\/div>\n<script type=\"text\/javascript\">\n\tvar m_chart_container_13_1_canvas = document.getElementById( 'm-chart-13-1' ).getContext('2d');\n\n\tvar m_chart_chartjs_13_1 = {\n\t\tchart_args: {\"type\":\"bar\",\"options\":{\"plugins\":{\"title\":{\"display\":true,\"text\":\"SEP 23 Data\",\"font\":{\"size\":21,\"weight\":\"normal\"},\"padding\":{\"bottom\":10}},\"legend\":{\"display\":true,\"position\":\"bottom\",\"labels\":{\"font\":{\"weight\":\"bold\"},\"usePointStyle\":true}},\"tooltip\":{\"enabled\":true},\"subtitle\":{\"display\":true,\"text\":\"19\/9 ~ 30\/9\",\"font\":{\"size\":18,\"weight\":\"normal\"},\"padding\":{\"bottom\":15}},\"datalabels\":{\"color\":\"black\",\"font\":{\"weight\":\"bold\"},\"offset\":3,\"display\":\"auto\"}},\"elements\":{\"point\":{\"hoverRadius\":7,\"hitRadius\":13}},\"responsive\":true,\"maintainAspectRatio\":false,\"locale\":\"en-US\",\"scales\":{\"x\":{\"grid\":{\"borderWidth\":0},\"title\":{\"display\":false,\"text\":\"\"}},\"y\":{\"grid\":{\"borderWidth\":0,\"display\":false},\"title\":{\"display\":true,\"text\":\"Units\"}}},\"indexAxis\":\"y\"},\"data\":{\"labels\":[\"Data\"],\"datasets\":[{\"label\":\"DEAD\",\"data\":[10],\"backgroundColor\":\"#ed6d85\",\"datalabels\":{\"align\":\"end\",\"anchor\":\"end\",\"color\":\"#ed6d85\"}},{\"label\":\"SOLD\",\"data\":[4555],\"backgroundColor\":\"#f7d06b\",\"datalabels\":{\"align\":\"end\",\"anchor\":\"end\",\"color\":\"#f7d06b\"}}]},\"value_prefix\":\"\",\"value_suffix\":\"\",\"locale\":\"en-US\"},\n\t\tpost_id: 13,\n\t\tinstance: 1,\n\t\trender_1: true\n\t};\n\n\t\n\t(function( $ ) {\n\t\tm_chart_chartjs_13_1.render_chart = function() {\n\t\t\t$( '.m-chart' ).trigger({\n\t\t\t\ttype:     'render_start',\n\t\t\t\tpost_id:  this.post_id,\n\t\t\t\tinstance: this.instance\n\t\t\t});\n\t\t\t\n\t\t\tvar target = this.chart_args.options.animation;\n            \n\t\t\tvar source = {\n\t\t\t\tonComplete: function() {\n\t\t\t\t\t\/\/ This deals with an issue in Chart.js 3.1.0 where onComplete can run too many times\n\t\t\t\t\t\/\/ We only want to trigger on the first render anyway so we'll just check\n\t\t\t\t\tif ( false === m_chart_chartjs_13_1.render_1 ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tm_chart_chartjs_13_1.render_1 = false;\n\n\t\t\t\t\t$( '.m-chart' ).trigger({\n\t\t\t\t\t\ttype:     'render_done',\n\t\t\t\t\t\tpost_id:  m_chart_chartjs_13_1.post_id,\n\t\t\t\t\t\tinstance: m_chart_chartjs_13_1.instance\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n           \n\t\t\tif ( ! target ) {\n\t\t\t\tsource = {animation: source};\n\t\t\t\ttarget = this.chart_args.options;\n\t\t\t}\n\t\t\t\n\t\t\tObject.assign( target, source );\n\n\t\t\tChart.register( ChartDataLabels );\n\n\t\t\tthis.chart = new Chart(\n\t\t\t\tm_chart_container_13_1_canvas,\n\t\t\t\tthis.chart_args\n\t\t\t);\n\t\t};\n\n\t\t$( function() {\n\t\t\t$.when( m_chart_chartjs_helpers.init() ).done(function() {\n\t\t\t\tm_chart_chartjs_13_1.render_chart();\n\t\t\t});\n\t\t} );\n\t})( jQuery );\n<\/script>\n\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"_links":{"self":[{"href":"https:\/\/piginfo.lhlfarm.com\/index.php\/wp-json\/wp\/v2\/pages\/36"}],"collection":[{"href":"https:\/\/piginfo.lhlfarm.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/piginfo.lhlfarm.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/piginfo.lhlfarm.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/piginfo.lhlfarm.com\/index.php\/wp-json\/wp\/v2\/comments?post=36"}],"version-history":[{"count":2,"href":"https:\/\/piginfo.lhlfarm.com\/index.php\/wp-json\/wp\/v2\/pages\/36\/revisions"}],"predecessor-version":[{"id":40,"href":"https:\/\/piginfo.lhlfarm.com\/index.php\/wp-json\/wp\/v2\/pages\/36\/revisions\/40"}],"wp:attachment":[{"href":"https:\/\/piginfo.lhlfarm.com\/index.php\/wp-json\/wp\/v2\/media?parent=36"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}