Title: Charts? · NativeScript · Discussion #10741 · GitHub
Open Graph Title: Charts? · NativeScript · Discussion #10741
X Title: Charts? · NativeScript · Discussion #10741
Description: Charts?
Open Graph Description: Hello! I want to build an app over the summer, and i am doing some research about what the right technologies for it would be, and i stumbled across nativescript, it seems very interesting I am cur...
X Description: Hello! I want to build an app over the summer, and i am doing some research about what the right technologies for it would be, and i stumbled across nativescript, it seems very interesting I am cur...
Opengraph URL: https://github.com/orgs/NativeScript/discussions/10741
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"QAPage","mainEntity":{"@type":"Question","name":"Charts?","text":"Hello!
\nI want to build an app over the summer, and i am doing some research about what the right technologies for it would be, and i stumbled across nativescript, it seems very interesting
\nI am curios what the go-to library is when adding charts in a nativescript application. I found \"nativescript-ui-chart\", but it seems as if its no longer maintained.
\nWhat do you guys use?
","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"My team at the moment uses @nativescript-community/ui-chart.
\nYou can register any from it for use in any flavor (refer to each flavor registration methods: https://docs.nativescript.org/guide/create-custom-native-elements#registering-new-elements), eg:
\nimport { LineChart } from '@nativescript-community/ui-chart/charts';\nimport { PieChart } from '@nativescript-community/ui-chart/charts';\n\nregisterElement('LineChart', () => LineChart);\nregisterElement('PieChart', () => PieChart);
\nthen use it however needed:
\n<PieChart (loaded)=\"loadedChart($event)\"></PieChart>
\nimport { PieChart } from '@nativescript-community/ui-chart';\nimport { PieData } from '@nativescript-community/ui-chart/data/PieData';\nimport { PieDataSet } from '@nativescript-community/ui-chart/data/PieDataSet';\nimport { PieEntry } from '@nativescript-community/ui-chart/data/PieEntry';\nimport {\n LegendHorizontalAlignment,\n LegendOrientation,\n LegendVerticalAlignment\n} from '@nativescript-community/ui-chart/components/Legend';\n\nloadedChart(args) {\n this.chart = args.object as PieChart;\n this.chart.usePercentValues = false;\n this.chart.extraOffsets = [10, 10, 10, 10];\n this.chart.drawHoleEnabled = true;\n this.chart.holeColor = 'transparent';\n this.chart.transparentCircleColor = 'white';\n this.chart.transparentCircleAlpha = 0;\n this.chart.holeRadius = 45;\n this.chart.transparentCircleRadiusPercent = 0;\n this.chart.rotationAngle = 0;\n // enable rotation of the chart by touch\n this.chart.rotationEnabled = true;\n this.chart.highlightPerTapEnabled = false;\n\n const l = this.chart.legend;\n l.verticalAlignment = LegendVerticalAlignment.CENTER;\n l.horizontalAlignment = LegendHorizontalAlignment.RIGHT;\n l.orientation = LegendOrientation.VERTICAL;\n l.drawInside = false;\n l.xEntrySpace = 0;\n l.yEntrySpace = 0;\n l.yOffset = 0;\n\n // entry label styling\n this.chart.entryLabelColor = 'black';\n this.chart.entryLabelTypeface = Font.default.withFontFamily('OpenSans');\n this.chart.entryLabelTextSize = 0.1;\n\n this.updateData();\n setTimeout(() => {\n this.chart.animateX(600);\n });\n }\n\nupdateData() {\n const dataSet = new PieDataSet([\n {\n y: 10,\n label: 'hello'\n },\n // any entries you want\n ], 'Election Results');\n\n dataSet.drawValuesEnabled = true;\n dataSet.sliceSpace = 5;\n dataSet.selectionShift = 10;\n\n const data = new PieData([dataSet]);\n data.valueTextSize = 11;\n data.valueTextColor = 'black';\n data.valueTypeface = Font.default.withFontFamily('OpenSans-Light');\n this.chart.data = data;\n this.chart.invalidate();\n}
","upvoteCount":1,"url":"https://github.com/orgs/NativeScript/discussions/10741#discussioncomment-13222872"}}}
| route-pattern | /_view_fragments/Voltron::DiscussionsFragmentsController/show/orgs/:org/:discussion_number/discussion_layout(.:format) |
| route-controller | voltron_discussions_fragments |
| route-action | discussion_layout |
| fetch-nonce | v2:facfdd2c-f192-25c8-4422-8519b27c3e63 |
| current-catalog-service-hash | 9f0abe34da433c9b6db74bffa2466494a717b579a96b30a5d252e5090baea7be |
| request-id | C298:2ECE53:71EBE7:9772D2:69648783 |
| html-safe-nonce | 3d6c07f939fdcd6997681af5f3347671122735bfbe5b1daaa626dd8e52cc36c8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMjk4OjJFQ0U1Mzo3MUVCRTc6OTc3MkQyOjY5NjQ4NzgzIiwidmlzaXRvcl9pZCI6IjgzMzUzNTEwNjc0NTY2NTQxMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 52c334750c23b764da72b7b3eaaa7f048dc495a85a06325c305d6342b1174264 |
| hovercard-subject-tag | discussion:8355187 |
| github-keyboard-shortcuts | repository,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/Voltron::DiscussionsFragmentsController/show/orgs/NativeScript/10741/discussion_layout |
| twitter:image | https://opengraph.githubassets.com/07b4f55f40ce15e7598066fd1d7a05be1d1c59bdd66a931e593df1fe7c3e87db/orgs/NativeScript/discussions/10741 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/07b4f55f40ce15e7598066fd1d7a05be1d1c59bdd66a931e593df1fe7c3e87db/orgs/NativeScript/discussions/10741 |
| og:image:alt | Hello! I want to build an app over the summer, and i am doing some research about what the right technologies for it would be, and i stumbled across nativescript, it seems very interesting I am cur... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | baa7d9900fdf7b27d604f36887af878d569cfbdcf97126832a5f4f0caf0c6ba5 |
| turbo-cache-control | no-preview |
| octolytics-dimension-user_id | 7392261 |
| octolytics-dimension-user_login | NativeScript |
| octolytics-dimension-repository_id | 31492490 |
| octolytics-dimension-repository_nwo | NativeScript/NativeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 31492490 |
| octolytics-dimension-repository_network_root_nwo | NativeScript/NativeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 842eff1d11f899d02b6b3b98fa3ea4860e64b34e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width