{"id":24041060,"url":"https://github.com/oswald2/chart-fltkhs","last_synced_at":"2025-07-14T13:08:39.563Z","repository":{"id":62435450,"uuid":"191641677","full_name":"oswald2/Chart-fltkhs","owner":"oswald2","description":"FLTKHS backend for the Chart Haskell library. ","archived":false,"fork":false,"pushed_at":"2020-06-13T16:14:09.000Z","size":75,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-25T13:54:10.996Z","etag":null,"topics":["chart","fltk","fltkhs","haskell"],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oswald2.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}},"created_at":"2019-06-12T20:42:29.000Z","updated_at":"2021-12-17T14:34:58.000Z","dependencies_parsed_at":"2022-11-01T21:02:33.547Z","dependency_job_id":null,"html_url":"https://github.com/oswald2/Chart-fltkhs","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/oswald2/Chart-fltkhs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oswald2%2FChart-fltkhs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oswald2%2FChart-fltkhs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oswald2%2FChart-fltkhs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oswald2%2FChart-fltkhs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oswald2","download_url":"https://codeload.github.com/oswald2/Chart-fltkhs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oswald2%2FChart-fltkhs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265297041,"owners_count":23742585,"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","fltk","fltkhs","haskell"],"created_at":"2025-01-08T21:39:44.003Z","updated_at":"2025-07-14T13:08:39.521Z","avatar_url":"https://github.com/oswald2.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chart-fltkhs\n\nFLTKHS backend for the Chart Haskell library.\n\nBuilds the library and (if specified) the examples, which resemble the examples from https://github.com/timbod7/haskell-chart/wiki.\n\n**Note:** *Transparency is not supported by FLTK, so e.g. Examples 8, 9 and 10 from the Chart library will not look correctly. This is a limitation of FLTK itself.*\n\nTo render a Chart to a widget, it is best to create a custom widget and override it's draw method.\n\n## Building ##\n\n### Stack ###\n\nJust use stack build. If you specify the flag 'examples', also the examples will be built:\n\n\u003e stack build\n\nTo build with examples: \n\n\u003e stack build --flag Chart-fltkhs:examples\n\n### Cabal ###\n\nIt is recommended to use cabal new-build:\n\n\u003e cabal new-build\n\nTo build with examples:\n\n\u003e cabal new-build -f examples\n\n\n### A usage example: ###\n\n```haskell\nwidget' \u003c- widgetCustom\n    (FL.Rectangle (Position (X 0) (Y 0)) (Size (Width width) (Height height)))\n    Nothing\n    drawChart\n    defaultCustomWidgetFuncs\n```\n\n\nHere, `drawChart` is the provided draw method for the widget. A possible implementation\ncould be this:\n\n```haskell\n-- The char itself, to be used here with 'Graphics.Rendering.Chart.Easy'\nsignal :: [Double] -\u003e [(Double,Double)]\nsignal xs = [ (x,(sin (x*3.14159/45) + 1) / 2 * sin (x*3.14159/5)) | x \u003c- xs ]\n\n-- the overloaded drawing function\ndrawChart :: Ref Widget -\u003e IO ()\ndrawChart widget = do\n    -- determine a clipping area for the whole widget first\n    rectangle' \u003c- getRectangle widget\n\n    -- with this clipping area, we draw the graph. This graph is taken from Example1\n    -- from the Chart library\n    withFlClip rectangle' $\n        renderToWidgetEC widget $ do\n            layout_title .= \"Amplitude Modulation\"\n            setColors [opaque blue, opaque red]\n            plot (line \"am\" [signal [0,(0.5)..400]])\n            plot (points \"am points\" (signal [0,7..400]))\n```\n\nFor more detailed examples, look into the [examples](https://github.com/oswald2/Chart-fltkhs/tree/master/examples) directory.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foswald2%2Fchart-fltkhs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foswald2%2Fchart-fltkhs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foswald2%2Fchart-fltkhs/lists"}