{"id":16679689,"url":"https://github.com/buren/chartkick-ex","last_synced_at":"2025-04-04T10:06:05.555Z","repository":{"id":41547123,"uuid":"43600658","full_name":"buren/chartkick-ex","owner":"buren","description":"Create beautiful Javascript charts with minimal code","archived":false,"fork":false,"pushed_at":"2024-07-27T14:57:33.000Z","size":90,"stargazers_count":162,"open_issues_count":4,"forks_count":24,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-28T09:03:41.202Z","etag":null,"topics":["chart","charting-library","chartkick","elixir","hexpm"],"latest_commit_sha":null,"homepage":"https://chartkick.com","language":"Elixir","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/buren.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-10-03T13:54:27.000Z","updated_at":"2025-02-02T00:07:08.000Z","dependencies_parsed_at":"2024-06-21T16:41:50.702Z","dependency_job_id":"9c23d94a-1911-46de-9ab4-bfac604cfd5b","html_url":"https://github.com/buren/chartkick-ex","commit_stats":{"total_commits":59,"total_committers":12,"mean_commits":4.916666666666667,"dds":0.4915254237288136,"last_synced_commit":"67fb738fa081d9bec4da6dfdcb5060295832550d"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buren%2Fchartkick-ex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buren%2Fchartkick-ex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buren%2Fchartkick-ex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buren%2Fchartkick-ex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/buren","download_url":"https://codeload.github.com/buren/chartkick-ex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247153770,"owners_count":20892731,"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":["chart","charting-library","chartkick","elixir","hexpm"],"created_at":"2024-10-12T13:36:53.323Z","updated_at":"2025-04-04T10:06:05.535Z","avatar_url":"https://github.com/buren.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chartkick [![Build Status](https://travis-ci.com/buren/chartkick-ex.svg?branch=master)](https://travis-ci.com/buren/chartkick-ex)\n\nCreate beautiful Javascript charts with one line of Elixir. No more fighting with charting libraries!\n\n[See it in action](http://buren.github.io/chartkick-ex/), you can find the example phoenix app that generates that page [here](https://github.com/buren/chartkick-phoenix-example).\n\nWorks with Phoenix, plain Elixir and most browsers.\n\nAny feedback, suggestions or comments please open an issue or PR.\n\n## Charts\n\nAll charts expect a JSON string.\n\n```elixir\nraw_data = [[175, 60], [190, 80], [180, 75]]\ndata = Poison.encode!(raw_data)\n# or if you are using Jason\ndata = Jason.encode!(raw_data)\n```\n\nLine chart\n\n```elixir\nChartkick.line_chart data\n```\n\nPie chart\n\n```elixir\nChartkick.pie_chart data\n```\n\nColumn chart\n\n```elixir\nChartkick.column_chart data\n```\n\nBar chart\n\n```elixir\nChartkick.bar_chart data\n```\n\nArea chart\n\n```elixir\nChartkick.area_chart data\n```\n\nScatter chart\n\n```elixir\nChartkick.scatter_chart data\n```\n\nGeo chart\n\n```elixir\nChartkick.geo_chart Poison.encode!(\"[[\\\"United States\\\",44],[\\\"Germany\\\",23]]\")\n# or if you are using Jason\nChartkick.geo_chart Jason.encode!(\"[[\\\"United States\\\",44],[\\\"Germany\\\",23]]\")\n```\n\nTimeline\n\n```elixir\nChartkick.timeline \"[\n  [\\\"Washington\\\", \\\"1789-04-29\\\", \\\"1797-03-03\\\"],\n  [\\\"Adams\\\", \\\"1797-03-03\\\", \\\"1801-03-03\\\"],\n  [\\\"Jefferson\\\", \\\"1801-03-03\\\", \\\"1809-03-03\\\"]\n]\"\n```\n\n### Say Goodbye To Timeouts\n\nMake your pages load super fast and stop worrying about timeouts. Give each chart its own endpoint.\n\n```elixir\nChartkick.line_chart \"/path/to/chart.json\"\n```\n\nAnd respond with data as JSON.\n\n### Options\n\n:information_source: _This implementation aims to support all options that [chartkick.js](https://github.com/ankane/chartkick.js) supports. If there are any missing, please open an issue or a PR._\n\nId, width and height\n\n```elixir\nChartkick.line_chart data, id: \"users-chart\", height: \"500px\", width: \"50%\"\n```\n\nMin and max values\n\n```elixir\nChartkick.line_chart data, min: 1000, max: 5000\n```\n\n`min` defaults to 0 for charts with non-negative values. Use `nil` to let the charting library decide.\n\nColors\n\n```elixir\nChartkick.line_chart data, colors: [\"pink\", \"#999\"]\n```\n\nStacked columns or bars\n\n```elixir\nChartkick.column_chart data, stacked: true\n```\n\nDiscrete axis\n\n```elixir\nChartkick.line_chart data, discrete: true\n```\n\nAxis titles\n\n```elixir\nChartkick.line_chart data, xtitle: \"Time\", ytitle: \"Population\"\n```\n\nStraight lines between points instead of a curve\n\n```elixir\nChartkick.line_chart data, curve: false\n```\n\nHide points\n\n```elixir\nChartkick.line_chart data, points: false\n```\n\nShow or hide legend\n\n```elixir\nChartkick.line_chart data, legend: false\n```\n\nSpecify legend position\n\n```elixir\nChartkick.line_chart data, legend: \"bottom\"\n```\n\nDonut chart\n\n```elixir\nChartkick.pie_chart data, donut: true\n```\n\nPrefix, useful for currency - _Chart.js, Highcharts_\n\n```elixir\nChartkick.line_chart data, prefix: \"$\"\n```\n\nSuffix, useful for percentages - _Chart.js, Highcharts_\n\n```elixir\nChartkick.line_chart data, suffix: \"%\"\n```\n\nSet a thousands separator - _Chart.js, Highcharts_\n\n```elixir\nChartkick.line_chart data, thousands: \",\"\n```\n\nSet a decimal separator - _Chart.js, Highcharts_\n\n```elixir\nChartkick.line_chart data, decimal: \",\"\n```\n\nShow insignificant zeros, useful for currency - _Chart.js, Highcharts_\n\n```elixir\nChartkick.line_chart data, round: 2, zeros: true\n```\n\nShow a message when data is empty\n\n```elixir\nChartkick.line_chart data, messages: %{ empty: \"My message..\"}\n```\n\nRefresh data from a remote source every `n` seconds\n\n```elixir\nChartkick.line_chart data, refresh: 60\n```\n\nYou can pass options directly to the charting library with:\n\n```elixir\nChartkick.line_chart data, library: %{ backgroundColor: \"#eee\" }\n```\n\nSee the documentation for [Google Charts](https://developers.google.com/chart/interactive/docs/gallery) and [Highcharts](http://api.highcharts.com/highcharts) for more info.\n\nTo customize datasets in Chart.js, use:\n\n```elixir\nChartkick.line_chart data, dataset: %{ borderWidth: 10 }\n```\n\n### Data\n\nPass data as a JSON string.\n\n```elixir\nChartkick.pie_chart \"{\\\"Football\\\" =\u003e 10, \\\"Basketball\\\" =\u003e 5}\"\nChartkick.pie_chart \"[[\\\"Football\\\", 10], [\\\"Basketball\\\", 5]]\"\n```\n\nFor multiple series, use the format\n\n```elixir\nChartkick.line_chart \"[\n  {name: \\\"Series A\\\", data: []},\n  {name: \\\"Series B\\\", data: []}\n]\"\n```\n\nTimes can be a time, a timestamp, or a string (strings are parsed)\n\n```elixir\nChartkick.line_chart \"{\n  1368174456 =\u003e 4,\n  \\\"2013-05-07 00:00:00 UTC\\\" =\u003e 7\n}\"\n```\n\n## Installation\n\nYou need to set JSON encoder in your config file. This encoder\nis used to encode options passed to Chartkick.\n```\n# config.exs\nconfig :chartkick, json_serializer: Jason\n```\n\nBy default when you render a chart it will return both the HTML-element and JS that initializes the chart.\nThis will only work if you load Chartkick in the `\u003chead\u003e` tag.\nYou can chose to render the JS \u0026 HTML separately using the `only: :html` or `only: :script` option.\nNote that if you use those options you need to pass `id` otherwise it wont work.\n\n```elixir\nline_chart data, id: \"my-line-chart\", only: :html\nline_chart data, id: \"my-line-chart\", only: :script\n```\n\nFor Google Charts, use:\n\n```html\n\u003cscript src=\"//www.google.com/jsapi\"\u003e\u003c/script\u003e\n\u003cscript src=\"path/to/chartkick.js\"\u003e\u003c/script\u003e\n```\n\nIf you prefer Highcharts, use:\n\n```html\n\u003cscript src=\"/path/to/highcharts.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"path/to/chartkick.js\"\u003e\u003c/script\u003e\n```\n\n### Localization\n\nTo specify a language for Google Charts, add:\n\n```html\n\u003cscript\u003e\n  var Chartkick = {\"language\": \"de\"};\n\u003c/script\u003e\n```\n\n**before** the javascript files.\n\n## No Elixir? No Problem\n\nCheck out\n\n* [JavaScript](https://github.com/ankane/chartkick.js)\n  - [React](https://github.com/yfractal/chartkick)\n  - [Vue.js](https://github.com/yfractal/chartkick)\n* [Ruby](https://github.com/ankane/chartkick)\n* [Python](https://github.com/mher/chartkick.py)\n* [Clojure](https://github.com/yfractal/chartkick)\n\n## History\n\nView the [changelog](https://github.com/buren/chartkick-ex/blob/master/CHANGELOG.md)\n\nChartkick follows [Semantic Versioning](http://semver.org/)\n\n## Contributing\n\nEveryone is encouraged to help improve this project. Here are a few ways you can help:\n\n- [Report bugs](https://github.com/buren/chartkick-ex/issues)\n- Fix bugs and [submit pull requests](https://github.com/buren/chartkick-ex/pulls)\n- Write, clarify, or fix documentation\n- Suggest or add new features\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fburen%2Fchartkick-ex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fburen%2Fchartkick-ex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fburen%2Fchartkick-ex/lists"}