{"id":31776922,"url":"https://github.com/pishen/chart4s","last_synced_at":"2025-10-10T05:59:49.732Z","repository":{"id":34876912,"uuid":"38888120","full_name":"pishen/chart4s","owner":"pishen","description":"Draw a web chart by Scala","archived":false,"fork":false,"pushed_at":"2019-09-17T02:33:45.000Z","size":754,"stargazers_count":37,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-03-16T12:45:27.690Z","etag":null,"topics":["chart","plot","scala"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"adamsamson/HornMorpho2.5","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pishen.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":"2015-07-10T15:38:10.000Z","updated_at":"2022-10-21T06:50:07.000Z","dependencies_parsed_at":"2022-09-08T21:41:43.154Z","dependency_job_id":null,"html_url":"https://github.com/pishen/chart4s","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/pishen/chart4s","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pishen%2Fchart4s","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pishen%2Fchart4s/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pishen%2Fchart4s/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pishen%2Fchart4s/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pishen","download_url":"https://codeload.github.com/pishen/chart4s/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pishen%2Fchart4s/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002865,"owners_count":26083468,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","plot","scala"],"created_at":"2025-10-10T05:59:44.191Z","updated_at":"2025-10-10T05:59:49.726Z","avatar_url":"https://github.com/pishen.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# chart4s\n\nDraw a web chart by Scala.\n\n![Demo](chart4s.gif)\n\nThe charts are generated by [C3.js](http://c3js.org/). Support for other JavaScript libraries may come in the future.\n\n## Installation\n\nAdd the following to your `build.sbt`:\n\n```\nlibraryDependencies += \"net.pishen\" %% \"chart4s\" % \"0.2.0\"\n\nresolvers += Resolver.bintrayRepo(\"pishen\", \"maven\")\n```\n\nThen, add the import statements to your code:\n\n```scala\nimport chart4s.c3._\n```\n\n## Supported charts\n\n### Line Chart\n\n```scala\nval lines = Seq(\n  \"a\" -\u003e Seq(3.1,6.4,2.3,7.5,5.0,8.9),\n  \"b\" -\u003e Seq(5.4,3.3,7.0,2.7,3.9,5.2)\n)\n\nval xValues = Seq(0.1, 0.2, 0.3, 0.45, 0.5, 0.6)\n\nLineChart(lines, xValues).draw\n```\n\n### Bar Chart\n\n```scala\nval data = Seq(\n  \"a\" -\u003e Seq(3.1,6.4,2.3,7.5,5.0,8.9,7.7),\n  \"b\" -\u003e Seq(5.4,3.3,7.0,2.7,3.9,5.2,9.1)\n)\n\nval xValues = Seq(\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\")\n\nBarChart(data, xValues).draw\n```\n\n### Pie Chart\n\n```scala\nPieChart(Seq(\"a\" -\u003e 5, \"b\" -\u003e 3, \"c\" -\u003e 11)).draw\n```\n\n### Stacked Line Chart\n\n```scala\nval lines = Seq(\n  \"a\" -\u003e Seq(3.1,6.4,2.3,7.5,5.0,8.9),\n  \"b\" -\u003e Seq(5.4,3.3,7.0,2.7,3.9,5.2)\n)\n\nval xValues = Seq(0.1, 0.2, 0.3, 0.45, 0.5, 0.6)\n\nStackedLineChart(lines, xValues).draw\n```\n\n### Timeseries Chart\n\n```scala\nimport java.time.LocalDate //also works for LocalDateTime\n\nval lines = Seq(\n  \"a\" -\u003e Seq(3.1,6.4,2.3,7.5,5.0,8.9),\n  \"b\" -\u003e Seq(5.4,3.3,7.0,2.7,3.9,5.2)\n)\n\nval now = LocalDate.now\nval timeValues = Seq(0, 1, 2, 4, 5, 6).map(d =\u003e now.plusDays(d))\n\nTimeseriesChart(lines, timeValues).draw\n```\n\n### XY Line Chart\n\n```scala\nXYLineChart(Seq(\n  \"a\" -\u003e Seq(1 -\u003e 1, 2 -\u003e 2, 3 -\u003e 3, 4 -\u003e 5, 5 -\u003e 8, 6 -\u003e 13),\n  \"b\" -\u003e Seq(5 -\u003e 1, 6 -\u003e 2, 7 -\u003e 3, 8 -\u003e 5, 9 -\u003e 8, 10 -\u003e 13)\n)).draw\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpishen%2Fchart4s","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpishen%2Fchart4s","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpishen%2Fchart4s/lists"}