{"id":6936,"date":"2020-04-16T15:00:35","date_gmt":"2020-04-16T06:00:35","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=6936"},"modified":"2020-04-15T01:58:06","modified_gmt":"2020-04-14T16:58:06","slug":"laravel-chart-js%e3%81%a7%e5%a3%b2%e4%b8%8a%e7%b5%b1%e8%a8%88%e3%81%ae%e5%86%86%e3%82%b0%e3%83%a9%e3%83%95%e3%82%92%e3%81%a4%e3%81%8f%e3%82%8b","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=6936","title":{"rendered":"Laravel + Chart.js\u3067\u58f2\u4e0a\u7d71\u8a08\u306e\u5186\u30b0\u30e9\u30d5\u3092\u3064\u304f\u308b"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u5148\u65e5\u8a18\u4e8b\u304c300\u3092\u8d85\u3048\u305f\u306e\u3067\u300c<strong>\u4f55\u304b\u6f0f\u308c\u3066\u3044\u308b\u5185\u5bb9\u304c\u306a\u3044\u304b\u306a\uff1f<\/strong>\u300d\u3068\u6614\u306e\u8a18\u4e8b\u3092\u898b\u8fd4\u3057\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u3084\u306f\u308a300\u8a18\u4e8b\u3082\u3042\u308b\u3068\u3044\u308d\u3093\u306a\u8a18\u4e8b\u304c\u3042\u308b\u306e\u3067\u3059\u304c\u3001\u305d\u306e\u4e2d\u3067 \u201d\u3084\u308d\u3046\u3068\u601d\u3063\u3066\u305f\u306e\u306b\u5fd8\u308c\u3066\u305f\u201d \u3053\u3068\u3092\u601d\u3044\u51fa\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u305d\u308c\u306f\u30fb\u30fb\u30fb<\/p>\n<p><strong style=\"font-size: 35px;\">\u30c7\u30fc\u30bf\u3092\u96c6\u8a08\u3057\u3066\u5186\u30b0\u30e9\u30d5\u3092\u3064\u304f\u308b<\/strong><\/p>\n<p>\u3068\u3044\u3046\u3082\u306e\u3067\u3059\u3002<\/p>\n<p>\u30fb\u30fb\u30fb\u3068\u3044\u3046\u306e\u3082\u3001<strong><span style=\"font-size: 1rem;\">\u3054\u4f9d\u983c\u3092\u3044\u305f\u3060\u304f\u6848\u4ef6\u306e\u4e2d\u306b\u300c\u30ed\u30b0\u30a4\u30f3\u76f4\u5f8c\u306e\u30da\u30fc\u30b8\u3067\u73fe\u72b6\u3092\u30b0\u30e9\u30d5\u5316\u3057\u305f\u3044\u300d\u3068\u3044\u3046\u3054\u8981\u671b\u304c\u3042\u308b\u304b\u3089\u306a\u3093\u3067\u3059\u3002<\/span><\/strong><\/p>\n<p>\u4f8b\u3048\u3070\u3001\u4f1a\u793e\u5225\u306e\u8ca9\u58f2\u5b9f\u7e3e\u304c\u3069\u3046\u306a\u3063\u3066\u3044\u308b\u306e\u304b\uff1f\u3092\u3072\u3068\u76ee\u3067\u5206\u304b\u308b\u3088\u3046\u306b\u3057\u305f\u3044\u3068\u3044\u3046\u3054\u8981\u671b\u3067\u3059\u306d\u3002<\/p>\n<p>\u305d\u3053\u3067\uff01<\/p>\n<p>\u4eca\u56de\u306f\u3001\u4ee5\u524d\u516c\u958b\u3057\u305f\u300c<a href=\"https:\/\/blog.capilano-fw.com\/?p=4966\">\u30ed\u30b0\u30a4\u30f3\u65e5\u6642\u306e\u7d71\u8a08\u3092\u3068\u3063\u3066\u68d2\u30b0\u30e9\u30d5\u306b\u3057\u3066\u307f\u308b<\/a>\u300d\u306b\u7d9a\u3044\u3066<code>Chart.js<\/code>\u3067\u306e\u5186\u30b0\u30e9\u30d5\u3092\u3064\u304f\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305c\u3072\u697d\u3057\u307f\u306a\u304c\u3089\u3084\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u2757<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6071 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_8.png\" alt=\"\" width=\"216\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_8.png 216w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_8-203x300.png 203w\" sizes=\"auto, (max-width: 216px) 100vw, 216px\" \/><\/p>\n<p style=\"text-align: center;\">\u300cchart.js\u3063\u3066\u898b\u305f\u76ee\u304c\u30ad\u30ec\u30a4\u3067\u3059\u3088\u306d\u300d<\/p>\n<p><strong>\u958b\u767a\u74b0\u5883\uff1a<\/strong>\u00a0Laravel 7.x\u3001Vue 2.6.11\u3001Chart.js 2.9.3\u3001lodash 4.17.15<\/p>\n<h1>\u3053\u306e\u8a18\u4e8b\u3092\u898b\u305f\u3089\u3067\u304d\u308b\u3053\u3068<\/h1>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306b<strong>\u300c\u5e74\u3054\u3068\u306e\u4f1a\u793e\u5225\u30fb\u8ca9\u58f2\u5b9f\u7e3e\u300d\u5186\u30b0\u30e9\u30d5\u304c\u3064\u304f\u308c\u307e\u3059\u3002<br \/>\n<\/strong>\u307e\u305f\u3001\u30bb\u30ec\u30af\u30c8\u30dc\u30c3\u30af\u30b9\u306e\u5e74\u3092\u5207\u308a\u66ff\u3048\u308b\u3068\u81ea\u52d5\u7684\u306b\u5186\u30b0\u30e9\u30d5\u304c\u66f4\u65b0\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6964\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/sales_graph_5.png\" alt=\"\" width=\"482\" height=\"545\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/sales_graph_5.png 482w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/sales_graph_5-265x300.png 265w\" sizes=\"auto, (max-width: 482px) 100vw, 482px\" \/><\/p>\n<p>\u3067\u306f\u5b9f\u969b\u306b\u3084\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u2757<\/p>\n<h1>\u30e2\u30c7\u30eb\uff06\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u3064\u304f\u308b<\/h1>\n<p>\u307e\u305a\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u95a2\u9023\u304b\u3089\u306f\u3058\u3081\u307e\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan make:model Sale -m<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001\u30e2\u30c7\u30eb\u3068\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u304c\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u3001\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u306e\u4e2d\u8eab\u3092\u6b21\u306e\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><code><strong>\/database\/migrations\/****_**_**_******_create_sales_table.php<\/strong><\/code><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\n<strong>public function up()<\/strong>\r\n<strong>{<\/strong>\r\n<strong>    Schema::create('sales', function (Blueprint $table) {<\/strong>\r\n<strong>        $table-&gt;id();<\/strong>\r\n<strong>        $table-&gt;string('company_name')-&gt;comment('\u4f1a\u793e\u540d');<\/strong>\r\n<strong>        $table-&gt;integer('amount')-&gt;comment('\u8ca9\u58f2\u91d1\u984d');\r\n        $table-&gt;integer('year')-&gt;comment('\u8ca9\u58f2\u3057\u305f\u5e74');<\/strong>\r\n<strong>        $table-&gt;timestamps();<\/strong>\r\n<strong>    });<\/strong>\r\n<strong>}<\/strong>\r\n\r\n\/\/ \u7701\u7565<\/pre>\n<h1>\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\uff08Seeder\uff09\u3092\u3064\u304f\u308b<\/h1>\n<p>\u7d9a\u3044\u3066\u3001<code>sales<\/code>\u30c6\u30fc\u30d6\u30eb\u306b\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u3092\u7528\u610f\u3057\u307e\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan make:seed SalesTableSeeder<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001<code>Seeder\u30d5\u30a1\u30a4\u30eb<\/code>\u304c\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067<code>run()<\/code>\u306e\u4e2d\u8eab\u3092\u6b21\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p><code><strong>\/database\/seeds\/SalesTableSeeder.php<\/strong><\/code><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\n<strong>public function run()<\/strong>\r\n<strong>{<\/strong>\r\n<strong>    $companies = [<\/strong>\r\n<strong>        '\u682a\u5f0f\u4f1a\u793e \u6075\u6bd4\u5bff',<\/strong>\r\n<strong>        '\u682a\u5f0f\u4f1a\u793e \u5927\u9ed2\u5929',<\/strong>\r\n<strong>        '\u682a\u5f0f\u4f1a\u793e \u6bd8\u6c99\u9580\u5929',<\/strong>\r\n<strong>        '\u682a\u5f0f\u4f1a\u793e \u5f01\u8ca1\u5929',<\/strong>\r\n<strong>        '\u682a\u5f0f\u4f1a\u793e \u798f\u7984\u5bff',<\/strong>\r\n<strong>        '\u682a\u5f0f\u4f1a\u793e \u5bff\u8001\u4eba',<\/strong>\r\n<strong>        '\u682a\u5f0f\u4f1a\u793e \u5e03\u888b',<\/strong>\r\n<strong>    ];<\/strong>\r\n\r\n<strong>    for($i = 0 ; $i &lt; 100 ; $i++) {<\/strong>\r\n\r\n<strong>        $sale = new \\App\\Sale();<\/strong>\r\n<strong>        $sale-&gt;company = Arr::random($companies);<\/strong>\r\n<strong>        $sale-&gt;amount = rand(1000, 10000) * 10;\r\n        $sale-&gt;year = rand(2018, 2020);<\/strong>\r\n<strong>        $sale-&gt;save();<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n<strong>}<\/strong>\r\n\r\n\/\/ \u7701\u7565<\/pre>\n<p>\u5909\u66f4\u304c\u5b8c\u4e86\u3057\u305f\u3089\u3001\u3053\u306e<code>SalesTableSeeder<\/code>\u3092<code>Laravel<\/code>\u306b\u767b\u9332\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><strong><code>\/database\/seeds\/DatabaseSeeder.php<\/code><\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\n<strong>public function run()<\/strong>\r\n<strong>{<\/strong>\r\n<strong>     $this-&gt;call(SalesTableSeeder::class);<\/strong> \/\/ \ud83d\udc48 \u8ffd\u52a0\r\n<strong>}<\/strong>\r\n\r\n\/\/ \u7701\u7565<\/pre>\n<p>\u6700\u5f8c\u306b\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>php artisan migrate:fresh --seed<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u30c6\u30fc\u30d6\u30eb\u306f\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6938\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/sales_graph_1.png\" alt=\"\" width=\"596\" height=\"371\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/sales_graph_1.png 596w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/sales_graph_1-300x187.png 300w\" sizes=\"auto, (max-width: 596px) 100vw, 596px\" \/><\/p>\n<h1>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u3064\u304f\u308b<\/h1>\n<p>\u6b21\u306b\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\uff12\u3064\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u306f\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3059\u308b\u305f\u3081\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3067\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan make:controller SalesController<\/strong><\/pre>\n<p>\u4f5c\u6210\u3057\u305f\u3089\u3001\u4e2d\u306b<code>index()<\/code>\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<p><strong><code>\/app\/Http\/Controllers\/SaleController.php<\/code><\/strong><\/p>\n<pre>&lt;?php\r\n\r\nnamespace App\\Http\\Controllers;\r\n\r\nuse Illuminate\\Http\\Request;\r\n\r\nclass SaleController extends Controller\r\n{\r\n    <strong>public function index() {<\/strong> \/\/ \ud83d\udc48 \u8ffd\u52a0\r\n\r\n<strong>        return view('sale.index');<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n}<\/pre>\n<p>\u305d\u3057\u3066\u3001<code>Ajax\u901a\u4fe1<\/code>\u3059\u308b\u305f\u3081\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3067\u3059\u3002<br \/>\n\u540c\u3058\u304f\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan make:controller Ajax\/SalesController<\/strong><\/pre>\n<p>\u3053\u3061\u3089\u3082\u4e2d\u306b<code>index()<\/code>\u3068<code>years()<\/code>\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<p><strong><code>\/app\/Http\/Controllers\/Ajax\/SaleController.php<\/code><\/strong><\/p>\n<pre>&lt;?php\r\n\r\nnamespace App\\Http\\Controllers\\Ajax;\r\n\r\nuse App\\Http\\Controllers\\Controller;\r\nuse Illuminate\\Http\\Request;\r\n\r\nclass SaleController extends Controller\r\n{\r\n<strong>    public function index(Request $request) {<\/strong> \/\/ \ud83d\udc48 \u8ffd\u52a0\r\n\r\n<strong>        return \\App\\Sale::select('company', 'amount')<\/strong>\r\n<strong>            -&gt;where('year', $request-&gt;year)<\/strong>\r\n<strong>            -&gt;get();<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n\r\n<strong>    public function years() {<\/strong> \/\/ \ud83d\udc48 \u8ffd\u52a0\r\n\r\n<strong>        return \\App\\Sale::select('year')<\/strong>\r\n<strong>            -&gt;groupBy('year')<\/strong>\r\n<strong>            -&gt;pluck('year');<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n}<\/pre>\n<h1>\u30eb\u30fc\u30c8\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u30eb\u30fc\u30c8\u3092\u3064\u304f\u3063\u3066\u30a2\u30af\u30bb\u30b9\u53ef\u80fd\u306aURL\u3092\u3064\u304f\u308a\u307e\u3059\u3002<\/p>\n<pre><strong>Route::get('sales', 'SaleController@index'); <\/strong>\/\/ \ud83d\udc48 \u30d6\u30e9\u30a6\u30b6\u3067\u30a2\u30af\u30bb\u30b9<strong>\r\nRoute::get('ajax\/sales', 'Ajax\\SaleController@index'); <\/strong>\/\/ \ud83d\udc48 \u58f2\u4e0a\u30c7\u30fc\u30bf\u53d6\u5f97\r\n<strong>Route::get('ajax\/sales\/years', 'Ajax\\SaleController@years'); <\/strong>\/\/ \ud83d\udc48 \u5e74\u30c7\u30fc\u30bf\u53d6\u5f97\uff08\u30bb\u30ec\u30af\u30c8\u30dc\u30c3\u30af\u30b9\u7528\uff09<\/pre>\n<p>\u307e\u305a\uff11\u884c\u76ee\u306e\u30eb\u30fc\u30c8\u306f\u3001\u5b9f\u969b\u306b\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3059\u308b\u90e8\u5206\u3067\u3059\u3002\uff08\u305d\u306e\u305f\u3081\u3001<code>SaleController<\/code>\u3067\u306f\u30d3\u30e5\u30fc\u3092\u8fd4\u3059\u3088\u3046\u306b\u3057\u307e\u3057\u305f\uff09<\/p>\n<p>\uff12\u884c\u76ee\u306f<code>Ajax<\/code>\u3067\u8ca9\u58f2\u5b9f\u7e3e\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b<code>URL<\/code>\u3067\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u6700\u5f8c\u306e\u884c\u306f\u3001\u5b58\u5728\u3059\u308b\u8ca9\u58f2\u5e74\u306e\u30ea\u30b9\u30c8\u3092\u53d6\u5f97\u3059\u308b<code>URL<\/code>\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u3053\u308c\u306f\u6b21\u306e\u3088\u3046\u306a\u30bb\u30ec\u30af\u30c8\u30dc\u30c3\u30af\u30b9\u3092\u7528\u610f\u3059\u308b\u305f\u3081\u306b\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6942\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/sales_graph_2.png\" alt=\"\" width=\"485\" height=\"170\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/sales_graph_2.png 485w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/sales_graph_2-300x105.png 300w\" sizes=\"auto, (max-width: 485px) 100vw, 485px\" \/><\/p>\n<h1>\u30d3\u30e5\u30fc\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u4eca\u56de\u30e1\u30a4\u30f3\u306b\u306a\u308b\u30d3\u30e5\u30fc\u3067\u3059\u3002<\/p>\n<p><strong><code>\/resources\/views\/sale\/index.blade.php<\/code><\/strong><\/p>\n<pre>&lt;html&gt;\r\n&lt;head&gt;\r\n    &lt;link href=\"https:\/\/stackpath.bootstrapcdn.com\/bootstrap\/4.4.1\/css\/bootstrap.min.css\" rel=\"stylesheet\"&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n    &lt;div id=\"app\" class=\"container p-3\"&gt;\r\n        &lt;div class=\"row\"&gt;\r\n            &lt;div class=\"col-md-6\"&gt;\r\n\r\n                &lt;!-- \ud83d\udc47 \u5186\u30b0\u30e9\u30d5\u3092\u8868\u793a\u3059\u308b\u30ad\u30e3\u30f3\u30d0\u30b9 --&gt;\r\n                <strong>&lt;canvas id=\"chart\" width=\"400\" height=\"400\"&gt;&lt;\/canvas&gt;<\/strong>\r\n\r\n                &lt;!-- \ud83d\udc47 \u5e74\u3092\u9078\u629e\u3059\u308b\u30bb\u30ec\u30af\u30c8\u30dc\u30c3\u30af\u30b9 --&gt;\r\n                <strong>&lt;div class=\"form-group\"&gt;\r\n                    &lt;label&gt;\u8ca9\u58f2\u5e74&lt;\/label&gt;\r\n                    &lt;select class=\"form-control\" v-model=\"year\" @change=\"getSales\"&gt;\r\n                        &lt;option v-for=\"year in years\" :value=\"year\"&gt;@{{ year }} \u5e74&lt;\/option&gt;\r\n                    &lt;\/select&gt;\r\n                &lt;\/div&gt;<\/strong>\r\n\r\n            &lt;\/div&gt;\r\n        &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n    &lt;script src=\"https:\/\/cdn.jsdelivr.net\/npm\/vue@2.6.11\"&gt;&lt;\/script&gt;\r\n    &lt;script src=\"https:\/\/cdn.jsdelivr.net\/npm\/chart.js@2.9.3\/dist\/Chart.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script src=\"https:\/\/cdn.jsdelivr.net\/npm\/lodash@4.17.15\/lodash.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script&gt;\r\n\r\n        new Vue({\r\n            el: '#app',\r\n            data: {\r\n                sales: [],\r\n                year: '{{ date('Y') }}',\r\n                years: [],\r\n                chart: null\r\n            },\r\n            methods: {\r\n                getYears() {\r\n\r\n                    \/\/ \ud83d\udc47 \u8ca9\u58f2\u5e74\u30ea\u30b9\u30c8\u3092\u53d6\u5f97 \u30fb\u30fb\u30fb \u2460\r\n                    <strong>fetch('\/ajax\/sales\/years')\r\n                        .then(response =&gt; response.json())\r\n                        .then(data =&gt; this.years = data);<\/strong>\r\n\r\n                },\r\n                getSales() {\r\n\r\n                    \/\/ \ud83d\udc47 \u8ca9\u58f2\u5b9f\u7e3e\u30c7\u30fc\u30bf\u3092\u53d6\u5f97 \u30fb\u30fb\u30fb \u2461\r\n                    <strong>fetch('\/ajax\/sales?year='+ this.year)\r\n                        .then(response =&gt; response.json())\r\n                        .then(data =&gt; {<\/strong>\r\n\r\n                            if(this.chart) { \/\/ \u30c1\u30e3\u30fc\u30c8\u304c\u5b58\u5728\u3057\u3066\u3044\u308c\u3070\u521d\u671f\u5316\r\n\r\n                                this.chart.destroy();\r\n\r\n                            }\r\n\r\n                            \/\/ \ud83d\udc47 lodash\u3067\u30c7\u30fc\u30bf\u3092\u52a0\u5de5 \u30fb\u30fb\u30fb \u2462\r\n                            <strong>const groupedSales = _.groupBy(data, 'company'); <\/strong>\/\/ \u4f1a\u793e\u3054\u3068\u306b\u30b0\u30eb\u30fc\u30d7\u5316<strong>\r\n                            const amounts = _.map(groupedSales, companySales =&gt; {\r\n\r\n                                return _.sumBy(companySales, 'amount'); <\/strong>\/\/ \u91d1\u984d\u5408\u8a08<strong>\r\n\r\n                            });\r\n                            const companyNames = _.keys(groupedSales); <\/strong>\/\/ \u4f1a\u793e\u540d\r\n\r\n                            \/\/ \ud83d\udc47 \u5186\u30b0\u30e9\u30d5\u3092\u63cf\u753b \u30fb\u30fb\u30fb \u2463\r\n                            <strong>const ctx = document.getElementById('chart').getContext('2d');\r\n                            this.chart = new Chart(ctx, {\r\n                                type: 'pie',\r\n                                data: {\r\n                                    datasets: [{\r\n                                        data: amounts,\r\n                                        backgroundColor: [\r\n                                            'rgb(255, 99, 132)',\r\n                                            'rgb(255, 159, 64)',\r\n                                            'rgb(255, 205, 86)',\r\n                                            'rgb(75, 192, 192)',\r\n                                            'rgb(54, 162, 235)',\r\n                                            'rgb(153, 102, 255)',\r\n                                            'rgb(201, 203, 207)'\r\n                                        ]\r\n                                    }],\r\n                                    labels: companyNames\r\n                                },\r\n                                options: {\r\n                                    title: {\r\n                                        display: true,\r\n                                        fontSize: 45,\r\n                                        text: '\u58f2\u4e0a\u7d71\u8a08'\r\n                                    },\r\n                                    tooltips: {\r\n                                        callbacks: {\r\n                                            label(tooltipItem, data) {\r\n\r\n                                                const datasetIndex = tooltipItem.datasetIndex;\r\n                                                const index = tooltipItem.index;\r\n                                                const amount = data.datasets[datasetIndex].data[index];\r\n                                                const amountText = amount.toString().replace(\/\\B(?=(\\d{3})+(?!\\d))\/g, ',');\r\n                                                const company = data.labels[index];\r\n                                                return ' '+ company +' '+amountText +' \u5186';\r\n\r\n                                            }\r\n                                        }\r\n                                    }\r\n                                }\r\n                            });<\/strong>\r\n\r\n                        });\r\n\r\n                }\r\n            },\r\n            mounted() {\r\n\r\n                this.getYears();\r\n                this.getSales();\r\n\r\n            }\r\n        });\r\n\r\n    &lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>\u5c11\u3057\u30b3\u30fc\u30c9\u304c\u9577\u3044\u306e\u3067\u5404\u30d6\u30ed\u30c3\u30af\u3067\u7d39\u4ecb\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p><strong>\u2460 \u8ca9\u58f2\u5e74\u30ea\u30b9\u30c8\u3092\u53d6\u5f97<\/strong><\/p>\n<p>\u5148\u307b\u3069\u4f5c\u3063\u305f<code>Ajax\\SaleController<\/code>\u306e<code>years()<\/code>\u304b\u3089\u300c\u8ca9\u58f2\u5e74\u30ea\u30b9\u30c8\u300d\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u306f\u3001\u4f8b\u3048\u3070<strong>\u8ca9\u58f2\u5b9f\u7e3e\u304c\u300c2018\u5e74\u300d\u300c2019\u5e74\u300d\u300c2020\u5e74\u300d\u306b\u767a\u751f\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u305d\u306e\uff13\u3064\u306e\u6570\u5b57\u304c\u914d\u5217\u3067\u8fd4\u308b\u3053\u3068\u306a\u308a\u307e\u3059\u3002<\/strong><\/p>\n<pre>[2018,2019,2020] \/\/ \ud83d\udc48 \u8ca9\u58f2\u5e74\u30ea\u30b9\u30c8<\/pre>\n<p><strong>\u2461 \u8ca9\u58f2\u5b9f\u7e3e\u30c7\u30fc\u30bf\u3092\u53d6\u5f97<\/strong><\/p>\n<p><code>Ajax\\SaleController<\/code>\u306e<code>index()<\/code>\u304b\u3089\u300c\u8a72\u5f53\u3059\u308b\u5e74\u306e\u8ca9\u58f2\u5b9f\u7e3e\u30c7\u30fc\u30bf\u300d\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<p><strong>\u4f8b\u3048\u3070\u30012020\u5e74\u306b\u767a\u751f\u3057\u305f\u8ca9\u58f2\u30c7\u30fc\u30bf\u5168\u3066\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/strong><\/p>\n<p><strong>\u2462 lodash\u3067\u30c7\u30fc\u30bf\u3092\u52a0\u5de5<\/strong><\/p>\n<p>\u4eca\u56de\u306f\u305b\u3063\u304b\u304f\u30c7\u30fc\u30bf\u306e\u96c6\u8a08\u3092\u3059\u308b\u304a\u8a71\u3067\u3059\u306e\u3067\u3001\u30c7\u30fc\u30bf\u52a0\u5de5\u304c\u697d\u306b\u3067\u304d\u308b<strong><a href=\"https:\/\/lodash.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">lodash<\/a><\/strong>\u3092\u4f7f\u3063\u305f\u4f8b\u3092\u3054\u7528\u610f\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\uff08\u306a\u304a\u3001<code>loadash<\/code>\u306f<code>Laravel<\/code>\u3067\u3082\u63a1\u7528\u3055\u308c\u3066\u3044\u307e\u3059\uff09<\/p>\n<p>\uff11\u3064\u305a\u3064\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u307e\u305a\u3001<code>_.groupBy()<\/code>\u306e\u90e8\u5206\u3067\u3059\u304c\u3053\u3053\u3067\u306f\u3001<strong>\u4f1a\u793e\u540d\u3054\u3068\u306b\u8ca9\u58f2\u30c7\u30fc\u30bf\u3092\u30b0\u30eb\u30fc\u30d7\u5316\u3057\u3066\u3044\u307e\u3059\u3002<\/strong><\/p>\n<p>\u3064\u307e\u308a\u3001\u6b21\u306e\u3088\u3046\u306a\u8ca9\u58f2\u5b9f\u7e3e\u30c7\u30fc\u30bf\u304c\u3042\u3063\u305f\u3068\u3057\u3066\u3001<\/p>\n<pre>[\r\n  { amount: 1000, company: '\u682a\u5f0f\u4f1a\u793e \u5f01\u8ca1\u5929'},\r\n  { amount: 2500, company: '\u682a\u5f0f\u4f1a\u793e \u5f01\u8ca1\u5929'},\r\n  { amount: 3000, company: '\u682a\u5f0f\u4f1a\u793e \u6bd8\u6c99\u9580\u5929'},\r\n  { amount: 5500, company: '\u682a\u5f0f\u4f1a\u793e \u6bd8\u6c99\u9580\u5929'},\r\n  { amount: 1500, company: '\u682a\u5f0f\u4f1a\u793e \u6bd8\u6c99\u9580\u5929'}\r\n]<\/pre>\n<p>\u30b0\u30eb\u30fc\u30d7\u5316\u3059\u308b\u3068\u3001\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>{\r\n  '\u682a\u5f0f\u4f1a\u793e \u5f01\u8ca1\u5929': [\r\n    { amount: 1000, company: '\u682a\u5f0f\u4f1a\u793e \u5f01\u8ca1\u5929'}, \r\n    { amount: 2500, company: '\u682a\u5f0f\u4f1a\u793e \u5f01\u8ca1\u5929'},\r\n  ],\r\n  '\u682a\u5f0f\u4f1a\u793e \u6bd8\u6c99\u9580\u5929': [\r\n    { amount: 3000, company: '\u682a\u5f0f\u4f1a\u793e \u6bd8\u6c99\u9580\u5929'}, \r\n    { amount: 5500, company: '\u682a\u5f0f\u4f1a\u793e \u6bd8\u6c99\u9580\u5929'}, \r\n    { amount: 1500, company: '\u682a\u5f0f\u4f1a\u793e \u6bd8\u6c99\u9580\u5929'}\r\n  ],\r\n}<\/pre>\n<p>\u6b21\u306b<code>_.map()<\/code>\u306e\u90e8\u5206\u306f\u3053\u306e<strong>\u30b0\u30eb\u30fc\u30d7\u5316\u3057\u305f\u5404\u4f1a\u793e\u306e\u8ca9\u58f2\u91d1\u984d\u3092\u5408\u8a08\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n<\/strong>\u305d\u306e\u305f\u3081\u3001\u4f8b\u3048\u3070\u6b21\u306e\u3088\u3046\u306a\u30c7\u30fc\u30bf\u304c\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>[114910, 170930, 161800, 440800, 103110, 428900, 141670] \/\/ \ud83d\udc48 \u8ca9\u58f2\u91d1\u984d\u306e\u5408\u8a08<\/pre>\n<p>\u6700\u5f8c\u306b<code>_.keys()<\/code>\u3067\u306f\u3001\u5148\u307b\u3069\u30b0\u30eb\u30fc\u30d7\u5316\u3057\u305f\u8ca9\u58f2\u5b9f\u7e3e\u30c7\u30fc\u30bf\u306e\u30ad\u30fc\uff08\u3064\u307e\u308a\u3001\u4f1a\u793e\u540d\uff09\u3092\u53d6\u5f97\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><strong>\u2463 \u5186\u30b0\u30e9\u30d5\u3092\u63cf\u753b<\/strong><\/p>\n<p>\u3053\u3053\u304c<code>Chart.js<\/code>\u3092\u4f7f\u3063\u3066\u3044\u308b\u90e8\u5206\u306b\u306a\u308a\u307e\u3059\u3002\u30c7\u30fc\u30bf\u306e\u30bb\u30c3\u30c8\u65b9\u6cd5\u306f\u898b\u3066\u3044\u305f\u3060\u3044\u305f\u3068\u304a\u308a\u3067\u3059\u304c\u3001\u5c11\u3057\u5909\u5247\u306a\u306e\u306f\u3001<code>options.tooltips.callbacks<\/code>\u306e\u90e8\u5206\u3067\u3059\u3002<\/p>\n<p>\u3053\u3053\u3067\u306f\u3001\u30b0\u30e9\u30d5\u306b\u30de\u30a6\u30b9\u3092\u5408\u308f\u305b\u305f\u3068\u304d\u306b\u8868\u793a\u3055\u308c\u308b\u5185\u5bb9\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001\u521d\u671f\u72b6\u614b\u3067\u306f\u5358\u306a\u308b\u6570\u5b57\u3060\u3051\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u304c\u3001\u3053\u308c\u3092<strong>\u300c\u4f1a\u793e\u540d + \uff13\u6841\u30ab\u30f3\u30de\u533a\u5207\u308a\u306e\u6570\u5b57 + \u5186\u300d\u3067\u8868\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/strong>\uff08\u4f8b\uff1a\u682a\u5f0f\u4f1a\u793e \u6bd8\u6c99\u9580\u5929 1,234,567 \u5186\uff09<\/p>\n<p>\u306a\u304a\u3001\u30bb\u30ec\u30af\u30c8\u30dc\u30c3\u30af\u30b9\u304c\u5909\u66f4\u3055\u308c\u308b\u5ea6\u306b\u3053\u306e\u30b3\u30fc\u30c9\u304c\u5b9f\u884c\u3055\u308c\u307e\u3059\u306e\u3067\u3001\u30c1\u30e3\u30fc\u30c8\u304c\u3059\u3067\u306b\u5b58\u5728\u3057\u3066\u3044\u308b\u5834\u5408\u3092\u8003\u616e\u3057\u3066\u3001\u521d\u671f\u5316\u3092\u5fd8\u308c\u306a\u3044\u3067\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre>if(this.chart) {\r\n\r\n    this.chart.destroy();\r\n\r\n}<\/pre>\n<p>\u3053\u3046\u3057\u306a\u3044\u3068\u3001\u5e74\u3092\u5909\u66f4\u3057\u305f\u969b\u306b\u4e0a\u624b\u304f\u30b0\u30e9\u30d5\u304c\u63cf\u753b\u3055\u308c\u307e\u305b\u3093\u3002<\/p>\n<h1>\u30c6\u30b9\u30c8\u3057\u3066\u307f\u308b<\/h1>\n<p>\u3067\u306f\u5b9f\u969b\u306b\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u2757<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6962\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/sales_graph_3.png\" alt=\"\" width=\"485\" height=\"541\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/sales_graph_3.png 485w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/sales_graph_3-269x300.png 269w\" sizes=\"auto, (max-width: 485px) 100vw, 485px\" \/><\/p>\n<p>\u3046\u307e\u304f\u5186\u30b0\u30e9\u30d5\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u306d\ud83d\ude0a<\/p>\n<p>\u6b21\u306b\u3001\u30de\u30a6\u30b9\u3092\u5408\u308f\u305b\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6963\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/sales_graph_4.png\" alt=\"\" width=\"483\" height=\"545\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/sales_graph_4.png 483w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/sales_graph_4-266x300.png 266w\" sizes=\"auto, (max-width: 483px) 100vw, 483px\" \/><\/p>\n<p>\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3057\u305f\u5185\u5bb9\u304c\u8868\u793a\u3055\u308c\u307e\u3057\u305f\ud83d\ude0a<\/p>\n<p>\u6700\u5f8c\u306b\u30bb\u30ec\u30af\u30c8\u30dc\u30c3\u30af\u30b9\u306e\u5e74\u3092\u5909\u66f4\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6964\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/sales_graph_5.png\" alt=\"\" width=\"482\" height=\"545\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/sales_graph_5.png 482w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/sales_graph_5-265x300.png 265w\" sizes=\"auto, (max-width: 482px) 100vw, 482px\" \/><\/p>\n<p>\u5186\u30b0\u30e9\u30d5\u304c\u81ea\u52d5\u7684\u306b\u5909\u66f4\u3055\u308c\u307e\u3057\u305f\u3002<br \/>\n\u6210\u529f\u3067\u3059\ud83d\ude0a\u2728<\/p>\n<h1>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b<\/h1>\n<p>\u4eca\u56de\u5b9f\u969b\u306e\u958b\u767a\u3057\u305f\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u4e00\u5f0f\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u307e\u3059\u3002<\/p>\n<a  data-e-Disable-Page-Transition=\"true\" class=\"download-link\" title=\"\" href=\"https:\/\/blog.capilano-fw.com?download=6968&amp;tmstv=1777532614\" rel=\"nofollow\" id=\"download-link-6968\" data-redirect=\"false\" >\n\tLaravel + Chart.js\u3067\u58f2\u4e0a\u7d71\u8a08\u306e\u5186\u30b0\u30e9\u30d5\u3092\u3064\u304f\u308b<\/a>\n\n<p>\u203b<code>JavaScript<\/code>\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3082<code>CDN<\/code>\u3067\u8aad\u307f\u8fbc\u3093\u3067\u3044\u308b\u306e\u3067\u3001\u3059\u3050\u8a66\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3088\u2757<\/p>\n<h1>\u3061\u306a\u307f\u306b<\/h1>\n<p>\u5186\u30b0\u30e9\u30d5\u306b\u30e9\u30d9\u30eb\uff08\u4eca\u56de\u306e\u4f8b\u3067\u8a00\u3046\u3068\u4f1a\u793e\u540d\uff09\u3092\u8868\u793a\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u4ee5\u4e0b\u306e\u30da\u30fc\u30b8\u3092\u53c2\u8003\u306b\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><a href=\"https:\/\/blog.capilano-fw.com\/?p=586\" target=\"_blank\" rel=\"noopener noreferrer\">\u30b3\u30d4\u30da\u3067OK\uff01Chart.js\u5186\u30b0\u30e9\u30d5\u5916\u5074\u306b\u30c6\u30ad\u30b9\u30c8\u8868\u793a\u3059\u308b\u65b9\u6cd5\uff08Chart PieceLabel\uff09<\/a><\/p>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u4eca\u56de\u306f<code>Laravel + Chart.js<\/code>\u3092\u4f7f\u3063\u3066\u58f2\u4e0a\u5b9f\u7e3e\u306e\u5186\u30b0\u30e9\u30d5\u3092\u3064\u304f\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u3053\u306e\u65b9\u6cd5\u3092\u4f7f\u3048\u3070\u3001<strong>\u58f2\u4e0a\u5b9f\u7e3e\u3060\u3051\u3067\u306a\u304f\u55b6\u696d\u6210\u7e3e\u3084\u30af\u30ec\u30fc\u30e0\u306e\u5206\u5e03\u306a\u3069\u3092\u5186\u30b0\u30e9\u30d5\u306b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/strong><\/p>\n<p>\u306a\u304a\u3001\u4eca\u56de\u306e\u958b\u767a\u3067\u611f\u3058\u305f\u306e\u306f\u300c<strong>\u306a\u308b\u307b\u3069\u3001\u3053\u3046\u3044\u3046\u3068\u304d\u306bGraphQL\u306f\u5f37\u3044\u2757<\/strong>\u300d\u3068\u3044\u3046\u3053\u3068\u3067\u3057\u305f\u3002\u3053\u306e\u9593\u300c<a href=\"https:\/\/blog.capilano-fw.com\/?p=6687\">Laravel + Vue + GraphQL\u3067\u30c7\u30fc\u30bf\u53d6\u5f97<\/a>\u300d\u3068\u3044\u3046\u8a18\u4e8b\u3067\u3082\u66f8\u304d\u307e\u3057\u305f\u304c\u3001\u4eca\u56de\u306e\u5185\u5bb9\u3092<code>GraphQL<\/code>\u3067\u4f5c\u308b\u3068\u3001\u305f\u3063\u305f\u4e00\u56de\u306e<code>Ajax<\/code>\u3067\u5168\u3066\u306e\u30c7\u30fc\u30bf\u304c\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3084\u306f\u308a<strong>\u958b\u767a\u696d\u52d9\u306f\u300c\u3069\u306e\u30c6\u30af\u30ce\u30ed\u30b8\u30fc\u3092\u3069\u3046\u7d44\u307f\u5408\u308f\u305b\u308b\u304b\u300d\u304c\u91cd\u8981\u306b\u306a\u3063\u3066\u304d\u307e\u3059\u306d\u3002<\/strong><\/p>\n<p>\u305c\u3072\u7686\u3055\u3093\u3082\u3044\u308d\u3093\u306a\u30d1\u30bf\u30fc\u30f3\u3092\u8003\u3048\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\u2757<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4445 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2.png\" alt=\"\" width=\"370\" height=\"310\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2.png 370w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2-300x251.png 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/><\/p>\n<p style=\"text-align: center;\">\u300c\u307e\u305f\u3044\u3064\u304b\u5186\u30b0\u30e9\u30d5\u4ee5\u5916\u3082\u3084\u3063\u3066\u307f\u307e\u3059\u306d\ud83d\udc4d\u300d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u5148\u65e5\u8a18\u4e8b\u304c300\u3092\u8d85\u3048\u305f\u306e\u3067\u300c\u4f55\u304b\u6f0f\u308c\u3066\u3044\u308b\u5185\u5bb9\u304c\u306a\u3044\u304b\u306a\uff1f\u300d\u3068\u6614\u306e\u8a18\u4e8b\u3092\u898b\u8fd4\u3057\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002 \u3084\u306f\u308a300\u8a18\u4e8b\u3082\u3042\u308b\u3068\u3044\u308d\u3093\u306a\u8a18\u4e8b\u304c\u3042\u308b\u306e\u3067 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=6936\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Laravel + Chart.js\u3067\u58f2\u4e0a\u7d71\u8a08\u306e\u5186\u30b0\u30e9\u30d5\u3092\u3064\u304f\u308b&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":6999,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,3,97],"tags":[30,214],"class_list":["post-6936","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript","category-laravel","category-97","tag-chart-js","tag-lodash"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/6936","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6936"}],"version-history":[{"count":54,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/6936\/revisions"}],"predecessor-version":[{"id":6998,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/6936\/revisions\/6998"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/6999"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6936"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6936"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6936"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}