{"id":20893408,"url":"https://github.com/arction/lcjs-example-0703-customhtmlcursor","last_synced_at":"2025-03-12T19:14:28.937Z","repository":{"id":98723658,"uuid":"375652049","full_name":"Arction/lcjs-example-0703-customhtmlcursor","owner":"Arction","description":"Example showcasing custom cursor implementation with HTML \u0026 CSS.","archived":false,"fork":false,"pushed_at":"2025-02-05T11:38:35.000Z","size":13145,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-05T12:32:05.617Z","etag":null,"topics":["chart","css","data-visualization","html","javascript","lightningchart-js"],"latest_commit_sha":null,"homepage":"https://www.arction.com/lightningchart-js-interactive-examples/examples/lcjs-example-0703-customHTMLCursor.html","language":"JavaScript","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/Arction.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-10T10:02:55.000Z","updated_at":"2025-02-05T11:36:23.000Z","dependencies_parsed_at":"2025-02-05T12:28:52.836Z","dependency_job_id":"80cfa977-73d3-4754-8952-a62b1799bae1","html_url":"https://github.com/Arction/lcjs-example-0703-customhtmlcursor","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arction%2Flcjs-example-0703-customhtmlcursor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arction%2Flcjs-example-0703-customhtmlcursor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arction%2Flcjs-example-0703-customhtmlcursor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arction%2Flcjs-example-0703-customhtmlcursor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Arction","download_url":"https://codeload.github.com/Arction/lcjs-example-0703-customhtmlcursor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243277498,"owners_count":20265352,"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","css","data-visualization","html","javascript","lightningchart-js"],"created_at":"2024-11-18T10:15:43.428Z","updated_at":"2025-03-12T19:14:28.918Z","avatar_url":"https://github.com/Arction.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JavaScript Custom HTML Cursor Chart\n\n![JavaScript Custom HTML Cursor Chart](CustomHTMLCursor-darkGold.png)\n\nThis demo application belongs to the set of examples for LightningChart JS, data visualization library for JavaScript.\r\n\r\nLightningChart JS is entirely GPU accelerated and performance optimized charting library for presenting massive amounts of data. It offers an easy way of creating sophisticated and interactive charts and adding them to your website or web application.\r\n\r\nThe demo can be used as an example or a seed project. Local execution requires the following steps:\r\n\r\n-   Make sure that relevant version of [Node.js](https://nodejs.org/en/download/) is installed\r\n-   Open the project folder in a terminal:\r\n\r\n          npm install              # fetches dependencies\r\n          npm start                # builds an application and starts the development server\r\n\r\n-   The application is available at _http://localhost:8080_ in your browser, webpack-dev-server provides hot reload functionality.\r\n\n\n## Description\n\nThis example serves as an example for creating a custom cursor for XY charts.\r\n\r\nCustom cursors can be required for different purposes - like major structural changes or very application specific styling requirements.\r\n\r\nIf lesser changes to default cursors are required then please see read about different methods of configuring cursor behavior - Features \u003e Cursor section in Developer documentation is a good reference.\r\n\r\nAll charts expose a simple method: `setCustomCursor` which can be conveniently used to firstly disable the built-in cursor and secondly trigger an automatic callback whenever the cursor should be displayed or hidden, with all information about the pointed data prepared beforehand.\r\n\r\nThanks to this, regardless how you want to display your custom cursor, it is extremely easy to plug it to LCJS.\r\n\r\n```ts\r\nChartXY.setCustomCursor((chart, hit, hits) =\u003e {\r\n    // hit : { x, y, series, axisX, axisY, ... }\r\n    // hits contain information of all cursor hits in case of multi series cursors\r\n})\r\n```\r\n\r\nIn this example, the custom cursor visual is created with dynamically injected `HTML` and `CSS`.\r\n\r\n**The same approach could be used for interacting with any UI framework**, idea being that `LCJS` is used for solving the data point and translating the location to the document, where any `HTML` element can be absolute positioned with `left` \u0026 `top` style.\r\n\r\nThe location and visibility of result table is animated with a `CSS` transition.\r\n\r\nMore custom cursor examples can be found under [\"cursor\" tag](https://arction.com/lightningchart-js-interactive-examples/search.html?t=cursor) in the _Interactive Examples_ gallery.\r\n\n\n## API Links\n\n* [Lightning Chart top reference]\n* [Auto cursor modes]\n* [Axis tick strategies]\n* [UI element builders]\n* [UI layout builders]\n* [UI backgrounds]\n* [UI position origin]\n* [Color factory hexadecimal]\n* [Solid fill style]\n* [Solid line style]\n* [Chart XY]\n* [Axis XY]\n\n\n## Support\n\nIf you notice an error in the example code, please open an issue on [GitHub][0] repository of the entire example.\r\n\r\nOfficial [API documentation][1] can be found on [LightningChart][2] website.\r\n\r\nIf the docs and other materials do not solve your problem as well as implementation help is needed, ask on [StackOverflow][3] (tagged lightningchart).\r\n\r\nIf you think you found a bug in the LightningChart JavaScript library, please contact sales@lightningchart.com.\r\n\r\nDirect developer email support can be purchased through a [Support Plan][4] or by contacting sales@lightningchart.com.\r\n\r\n[0]: https://github.com/Arction/\r\n[1]: https://lightningchart.com/lightningchart-js-api-documentation/\r\n[2]: https://lightningchart.com\r\n[3]: https://stackoverflow.com/questions/tagged/lightningchart\r\n[4]: https://lightningchart.com/support-services/\r\n\n© LightningChart Ltd 2009-2022. All rights reserved.\r\n\n\n[Lightning Chart top reference]: https://lightningchart.com/js-charts/api-documentation/v7.0.1/interfaces/LightningChart.html\n[Auto cursor modes]: https://lightningchart.com/js-charts/api-documentation/v7.0.1/enums/AutoCursorModes.html\n[Axis tick strategies]: https://lightningchart.com/js-charts/api-documentation/v7.0.1/variables/AxisTickStrategies.html\n[UI element builders]: https://lightningchart.com/js-charts/api-documentation/v7.0.1/variables/UIElementBuilders.html\n[UI layout builders]: https://lightningchart.com/js-charts/api-documentation/v7.0.1/variables/UILayoutBuilders.html\n[UI backgrounds]: https://lightningchart.com/js-charts/api-documentation/v7.0.1/variables/UIBackgrounds.html\n[UI position origin]: https://lightningchart.com/js-charts/api-documentation/v7.0.1/variables/UIOrigins.html\n[Color factory hexadecimal]: https://lightningchart.com/js-charts/api-documentation/v7.0.1/functions/ColorHEX.html\n[Solid fill style]: https://lightningchart.com/js-charts/api-documentation/v7.0.1/classes/SolidFill.html\n[Solid line style]: https://lightningchart.com/js-charts/api-documentation/v7.0.1/classes/SolidLine.html\n[Chart XY]: https://lightningchart.com/js-charts/api-documentation/v7.0.1/classes/ChartXY.html\n[Axis XY]: https://lightningchart.com/js-charts/api-documentation/v7.0.1/classes/Axis.html\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farction%2Flcjs-example-0703-customhtmlcursor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farction%2Flcjs-example-0703-customhtmlcursor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farction%2Flcjs-example-0703-customhtmlcursor/lists"}