{"id":13531969,"url":"https://github.com/laravel-admin-extensions/chartjs","last_synced_at":"2025-04-06T22:10:05.088Z","repository":{"id":57011877,"uuid":"148755035","full_name":"laravel-admin-extensions/chartjs","owner":"laravel-admin-extensions","description":"Use Chartjs in laravel-admin","archived":false,"fork":false,"pushed_at":"2019-01-23T02:16:41.000Z","size":70,"stargazers_count":102,"open_issues_count":4,"forks_count":37,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-30T21:08:00.655Z","etag":null,"topics":["chartjs","laravel-admin"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/laravel-admin-extensions.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-14T07:53:13.000Z","updated_at":"2024-04-27T16:41:05.000Z","dependencies_parsed_at":"2022-08-21T15:10:34.493Z","dependency_job_id":null,"html_url":"https://github.com/laravel-admin-extensions/chartjs","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laravel-admin-extensions%2Fchartjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laravel-admin-extensions%2Fchartjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laravel-admin-extensions%2Fchartjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laravel-admin-extensions%2Fchartjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/laravel-admin-extensions","download_url":"https://codeload.github.com/laravel-admin-extensions/chartjs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247557767,"owners_count":20958047,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chartjs","laravel-admin"],"created_at":"2024-08-01T07:01:07.301Z","updated_at":"2025-04-06T22:10:05.051Z","avatar_url":"https://github.com/laravel-admin-extensions.png","language":"PHP","funding_links":["https://www.paypal.me/zousong"],"categories":["扩展包"],"sub_categories":["视图类扩展包"],"readme":"Use Chartjs in laravel-admin\n======\n\n[DEMO](http://demo.laravel-admin.org/chartjs)\n\nLogin using `admin/admin`\n\n## Screenshot\n\n![qq20180917-132122](https://user-images.githubusercontent.com/1479100/45607189-2b018b80-ba7d-11e8-845e-d7ab810bc07f.png)\n\n## Installation\n\n```bash\ncomposer require laravel-admin-ext/chartjs\n\nphp artisan vendor:publish --tag=laravel-admin-chartjs\n```\n\n## Configuration\n\nOpen `config/admin.php`, add configurations that belong to this extension at `extensions` section.\n\n```php\n\n    'extensions' =\u003e [\n\n        'chartjs' =\u003e [\n        \n            // Set to `false` if you want to disable this extension\n            'enable' =\u003e true,\n        ]\n    ]\n\n```\n\n## Usage\n\nCreate a view in views directory like `resources/views/admin/chartjs.blade.php`, and add following codes:\n```html\n\u003ccanvas id=\"myChart\" width=\"400\" height=\"400\"\u003e\u003c/canvas\u003e\n\u003cscript\u003e\n$(function () {\n    var ctx = document.getElementById(\"myChart\").getContext('2d');\n    var myChart = new Chart(ctx, {\n        type: 'bar',\n        data: {\n            labels: [\"Red\", \"Blue\", \"Yellow\", \"Green\", \"Purple\", \"Orange\"],\n            datasets: [{\n                label: '# of Votes',\n                data: [12, 19, 3, 5, 2, 3],\n                backgroundColor: [\n                    'rgba(255, 99, 132, 0.2)',\n                    'rgba(54, 162, 235, 0.2)',\n                    'rgba(255, 206, 86, 0.2)',\n                    'rgba(75, 192, 192, 0.2)',\n                    'rgba(153, 102, 255, 0.2)',\n                    'rgba(255, 159, 64, 0.2)'\n                ],\n                borderColor: [\n                    'rgba(255,99,132,1)',\n                    'rgba(54, 162, 235, 1)',\n                    'rgba(255, 206, 86, 1)',\n                    'rgba(75, 192, 192, 1)',\n                    'rgba(153, 102, 255, 1)',\n                    'rgba(255, 159, 64, 1)'\n                ],\n                borderWidth: 1\n            }]\n        },\n        options: {\n            scales: {\n                yAxes: [{\n                    ticks: {\n                        beginAtZero:true\n                    }\n                }]\n            }\n        }\n    });\n});\n\u003c/script\u003e\n\n```\n\nThen show it on the page\n\n```php\nclass ChartjsController extends Controller\n{\n    public function index(Content $content)\n    {\n        return $content\n            -\u003eheader('Chartjs')\n            -\u003ebody(new Box('Bar chart', view('admin.chartjs')));\n    }\n}\n```\n\nFor more usage, please refer to the official [documentation](http://www.chartjs.org/) of chartjs.\n\n## Donate\n\n\u003e Help keeping the project development going, by donating a little. Thanks in advance.\n\n[![PayPal Me](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/zousong)\n\n![-1](https://cloud.githubusercontent.com/assets/1479100/23287423/45c68202-fa78-11e6-8125-3e365101a313.jpg)\n\nLicense\n------------\nLicensed under [The MIT License (MIT)](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaravel-admin-extensions%2Fchartjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flaravel-admin-extensions%2Fchartjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaravel-admin-extensions%2Fchartjs/lists"}