{"id":15033187,"url":"https://github.com/thooams/chart_bibz","last_synced_at":"2026-03-17T23:04:08.099Z","repository":{"id":62555525,"uuid":"327070831","full_name":"thooams/chart_bibz","owner":"thooams","description":"Build your chart with ChartJs through Ruby","archived":false,"fork":false,"pushed_at":"2021-02-12T09:28:39.000Z","size":206,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-26T01:35:11.420Z","etag":null,"topics":["chartjs","rails","ruby","ruby-on-rails"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/thooams.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"thooams","patreon":"user?u=8672183","liberapay":"thooams"}},"created_at":"2021-01-05T17:28:22.000Z","updated_at":"2021-02-12T09:28:26.000Z","dependencies_parsed_at":"2022-11-03T05:30:45.693Z","dependency_job_id":null,"html_url":"https://github.com/thooams/chart_bibz","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thooams%2Fchart_bibz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thooams%2Fchart_bibz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thooams%2Fchart_bibz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thooams%2Fchart_bibz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thooams","download_url":"https://codeload.github.com/thooams/chart_bibz/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243351841,"owners_count":20276908,"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","rails","ruby","ruby-on-rails"],"created_at":"2024-09-24T20:20:20.501Z","updated_at":"2025-12-29T00:03:05.200Z","avatar_url":"https://github.com/thooams.png","language":"Ruby","funding_links":["https://github.com/sponsors/thooams","https://patreon.com/user?u=8672183","https://liberapay.com/thooams"],"categories":[],"sub_categories":[],"readme":"![Chart Bibz logo](https://raw.githubusercontent.com/thooams/chart_bibz/main/chart-bibz-logo.gif)\n\n# Chart Bibz\nUse Chartjs with ruby. Generate your chart in one ruby line.\n\n[![Gem Version](https://badge.fury.io/rb/chart_bibz.svg)](https://badge.fury.io/rb/chart_bibz)\n[![Maintainability](https://api.codeclimate.com/v1/badges/7e8e319e9f7197593733/maintainability)](https://codeclimate.com/github/thooams/chart_bibz/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/7e8e319e9f7197593733/test_coverage)](https://codeclimate.com/github/thooams/chart_bibz/test_coverage)\n[![security](https://hakiri.io/github/thooams/chart_bibz/main.svg)](https://hakiri.io/github/thooams/chart_bibz/main)\n[![Ci](https://github.com/thooams/chart_bibz/workflows/CI/badge.svg)](https://github.com/thooams/chart_bibz/actions)\n[![Linter](https://github.com/thooams/chart_bibz/workflows/Linter/badge.svg)](https://github.com/thooams/chart_bibz/actions)\n[![Inline docs](http://inch-ci.org/github/thooams/chart_bibz.svg?branch=main)](http://inch-ci.org/github/thooams/chart_bibz)\n\n\n## Usage\nHow to use the plugin.\n\n```ruby\n# @param data [Hash] Data\n# @param options [Hash] The chart type and the chartjs options\n# @param html_options [Hash] The canvas html options\n# @return [String] The Canvas Html\nchart data, options, html_options\n```\n\n## Example\n```ruby\ndata = {\n  datasets: [{\n    barPercentage: 0.5,\n    barThickness: 6,\n    maxBarThickness: 8,\n    minBarLength: 2,\n    data: [10, 20, 30, 40, 50, 60, 70]\n  }]\n}\noptions = { type: :bar, scales: { yAxes: [{ ticks: { beginAtZero: true } }] } }\nhtml_options = { id: \"my-chart\", width: 100, height: 520 }\n\nchart data\n# or\nchart data, options, html_options\n```\n\n## Installation\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'chart_bibz'\n```\n\nAnd then execute:\n```bash\n$ bundle\n$ yarn add chart.js\n```\n\nOr install it yourself as:\n```bash\n$ gem install chart_bibz\n```\n\nAdd this line in your js file, by example app/javascript/packs/application.js\n```js\n...\ndocument.querySelectorAll(\".chart-bibz\").forEach(function(canvasEl){\n  let type = canvasEl.getAttribute(\"data-cb-type\")\n  let options = JSON.parse(canvasEl.getAttribute(\"data-cb-options\"))\n  let data = JSON.parse(canvasEl.getAttribute(\"data-cb-data\"))\n  let ctx  = canvasEl.getContext('2d')\n\n  new Chart(ctx, { type: type, data: data, options: options })\n})\n...\n```\n\nThat's it !\n\n## License\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthooams%2Fchart_bibz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthooams%2Fchart_bibz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthooams%2Fchart_bibz/lists"}