├── .gitignore ├── .npmignore ├── LICENSE ├── README.md ├── components ├── axes │ ├── index.android.d.ts │ ├── index.android.ts │ └── index.d.ts ├── chart │ ├── index.android.d.ts │ ├── index.android.ts │ └── index.d.ts ├── dataset │ ├── index.android.d.ts │ ├── index.android.ts │ └── index.d.ts └── legend │ ├── index.android.d.ts │ ├── index.android.ts │ └── index.d.ts ├── demo ├── app │ ├── App_Resources │ │ ├── Android │ │ │ ├── AndroidManifest.xml │ │ │ ├── app.gradle │ │ │ ├── drawable-hdpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ ├── drawable-ldpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ ├── drawable-mdpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ ├── drawable-nodpi │ │ │ │ └── splash_screen.xml │ │ │ ├── drawable-xhdpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ ├── drawable-xxhdpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ ├── drawable-xxxhdpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ ├── values-v21 │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ └── values │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ └── iOS │ │ │ ├── Assets.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ ├── Contents.json │ │ │ │ ├── icon-29.png │ │ │ │ ├── icon-29@2x.png │ │ │ │ ├── icon-29@3x.png │ │ │ │ ├── icon-40.png │ │ │ │ ├── icon-40@2x.png │ │ │ │ ├── icon-40@3x.png │ │ │ │ ├── icon-50.png │ │ │ │ ├── icon-50@2x.png │ │ │ │ ├── icon-57.png │ │ │ │ ├── icon-57@2x.png │ │ │ │ ├── icon-60@2x.png │ │ │ │ ├── icon-60@3x.png │ │ │ │ ├── icon-72.png │ │ │ │ ├── icon-72@2x.png │ │ │ │ ├── icon-76.png │ │ │ │ ├── icon-76@2x.png │ │ │ │ └── icon-83.5@2x.png │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.launchimage │ │ │ │ ├── Contents.json │ │ │ │ ├── Default-568h@2x.png │ │ │ │ ├── Default-667h@2x.png │ │ │ │ ├── Default-736h@3x.png │ │ │ │ ├── Default-Landscape.png │ │ │ │ ├── Default-Landscape@2x.png │ │ │ │ ├── Default-Landscape@3x.png │ │ │ │ ├── Default-Portrait.png │ │ │ │ ├── Default-Portrait@2x.png │ │ │ │ ├── Default.png │ │ │ │ └── Default@2x.png │ │ │ ├── LaunchScreen.AspectFill.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── LaunchScreen-AspectFill.png │ │ │ │ └── LaunchScreen-AspectFill@2x.png │ │ │ └── LaunchScreen.Center.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── LaunchScreen-Center.png │ │ │ │ └── LaunchScreen-Center@2x.png │ │ │ ├── Info.plist │ │ │ ├── LaunchScreen.storyboard │ │ │ └── build.xcconfig │ ├── app.css │ ├── app.ts │ ├── main-page.ts │ ├── main-page.xml │ ├── main-view-model.ts │ └── package.json ├── package.json └── tsconfig.json ├── demo_examples_img ├── christmas tree.PNG ├── legend_disable.PNG └── legend_enabled.PNG ├── helper ├── index.d.ts └── index.ts ├── index.d.ts ├── line-chart ├── index.d.ts ├── line-chart.android.d.ts ├── line-chart.android.ts ├── line-chart.common.d.ts ├── line-chart.common.ts └── package.json ├── nativescript-charts.android.d.ts ├── nativescript-charts.android.ts ├── nativescript-charts.common.d.ts ├── nativescript-charts.common.ts ├── nativescript-charts.ios.d.ts ├── nativescript-charts.ios.ts ├── package.json ├── platforms └── android │ └── include.gradle ├── references.d.ts ├── scripts └── postclone.js └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | *.js 2 | *.js.map 3 | *.log 4 | !scripts/*.js 5 | .vscode/ 6 | demo/app/*.js 7 | demo/*.d.ts 8 | demo/lib 9 | demo/platforms 10 | demo/node_modules 11 | node_modules -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | demo/ 2 | *.png 3 | *.log 4 | *.map 5 | *.ts 6 | !*.d.ts 7 | .vscode/ 8 | .git/ 9 | tsconfig.json 10 | demo_examples_img/ -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | nativescript-yourplugin 4 | Copyright (c) 2016, Your Name 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Chart plugin for Nativescript 2 | Standalone plugin, **not part of Telerik UI** 3 | 4 | Android uses https://github.com/PhilJay/MPAndroidChart 5 | 6 | iOS not implemented 7 | 8 | Plugin for now contains Line chart type 9 | 10 | ## Line type: 11 | 12 | Add namespace `xmlns:LineChart="nativescript-charts/line-chart"` 13 | 14 | *chartSettings* are type of `ILineChart` 15 | 16 | *chartData* is type of `ILineSeries` 17 | 18 | Each point is object of `{x,y}` 19 | 20 | Both can be imported from `nativescript-charts/line-chart` 21 | 22 | ### Example for LineChart 23 | 24 | ```typescript 25 | var points = [ 26 | {x:1,y:4}, 27 | {x:3,y:5.9}, 28 | {x:7,y:4}, 29 | {x:8,y:10}, 30 | {x:10,y:1} 31 | ]; 32 | 33 | var lineData:ILineSeries = { 34 | lineData: points, 35 | color:"green", 36 | name:"test", 37 | }; 38 | 39 | var linechartOpts:ILineChart= { 40 | Legend:{ 41 | enabled:false, 42 | form:LegendForm.CIRCLE, 43 | }, 44 | XAxis:{ 45 | textSize:12, 46 | textColor:"green", 47 | position:XPosition.TOP, 48 | axisMinimum:-30, 49 | axisMaximum:30, 50 | drawGridLines:false, 51 | showOnlyMinMax:false, 52 | enabled:true 53 | }, 54 | RightYAxis:{ 55 | textSize:10, 56 | textColor:"green", 57 | position:YPosition.OUTSIDE_CHART, 58 | axisMaximum:120, 59 | axisMinimum:-10, 60 | showOnlyMinMax:false, 61 | drawGridLines:false, 62 | enabled:true 63 | }, 64 | LeftYAxis:{ 65 | textSize:10, 66 | textColor:"green", 67 | position:YPosition.OUTSIDE_CHART, 68 | axisMaximum:120, 69 | axisMinimum:-10, 70 | showOnlyMinMax:false, 71 | drawGridLines:false, 72 | enabled:true 73 | }, 74 | BaseSettings:{ 75 | enabledDescription:false, 76 | drawGridBackground:false, 77 | } 78 | }; 79 | ``` 80 | 81 | ```xml 82 | 84 | 85 | 86 | ``` -------------------------------------------------------------------------------- /components/axes/index.android.d.ts: -------------------------------------------------------------------------------- 1 | export declare enum YPosition { 2 | OUTSIDE_CHART, 3 | INSIDE_CHART, 4 | } 5 | export declare enum XPosition { 6 | TOP, 7 | BOTTOM, 8 | BOTH_SIDED, 9 | TOP_INSIDE, 10 | BOTTOM_INSIDE, 11 | } 12 | export interface Axis { 13 | enabled?: boolean; 14 | drawLabels?: boolean; 15 | drawAxisLine?: boolean; 16 | drawGridLines?: boolean; 17 | axisMaximum?: number; 18 | axisMinimum?: number; 19 | inverted?: boolean; 20 | showOnlyMinMax?: boolean; 21 | labelCount?: { 22 | count: number; 23 | force: boolean; 24 | }; 25 | granularity?: number; 26 | granularityEnabled?: boolean; 27 | textColor?: string | number; 28 | textSize?: number; 29 | gridColor?: string | number; 30 | gridLineWidth?: number; 31 | axisLineWidth?: number; 32 | enableGridDashedLine?: { 33 | lineLength: number; 34 | spaceLength: number; 35 | phase: number; 36 | }; 37 | } 38 | export interface YAxis extends Axis { 39 | position?: YPosition; 40 | drawZeroLine?: boolean; 41 | zeroLineWidth?: number; 42 | zeroLineColor?: string | number; 43 | spaceTop?: number; 44 | spaceBottom?: number; 45 | } 46 | export interface RightYAxis extends YAxis { 47 | } 48 | export interface LeftYAxis extends YAxis { 49 | } 50 | export interface XAxis extends Axis { 51 | position?: XPosition; 52 | labelRotationAngle?: number; 53 | } 54 | -------------------------------------------------------------------------------- /components/axes/index.android.ts: -------------------------------------------------------------------------------- 1 | declare var com; 2 | //let cLegend = com.github.mikephil.charting.components.Legends; 3 | 4 | export enum YPosition{ 5 | OUTSIDE_CHART = com.github.mikephil.charting.components.YAxis.YAxisLabelPosition.OUTSIDE_CHART, 6 | INSIDE_CHART = com.github.mikephil.charting.components.YAxis.YAxisLabelPosition.INSIDE_CHART 7 | } 8 | export enum XPosition{ 9 | TOP = com.github.mikephil.charting.components.XAxis.XAxisPosition.TOP, 10 | BOTTOM = com.github.mikephil.charting.components.XAxis.XAxisPosition.BOTTOM, 11 | BOTH_SIDED = com.github.mikephil.charting.components.XAxis.XAxisPosition.BOTH_SIDED, 12 | TOP_INSIDE = com.github.mikephil.charting.components.XAxis.XAxisPosition.TOP_INSIDE, 13 | BOTTOM_INSIDE = com.github.mikephil.charting.components.XAxis.XAxisPosition.BOTTOM_INSIDE 14 | } 15 | /*export enum YSide{ 16 | LEFT, 17 | RIGHT, 18 | BOTH 19 | }*/ 20 | export interface Axis{ 21 | enabled?:boolean, 22 | drawLabels?:boolean, 23 | drawAxisLine?:boolean, 24 | drawGridLines?:boolean, 25 | axisMaximum?:number, 26 | axisMinimum?:number, 27 | inverted?:boolean, 28 | showOnlyMinMax?:boolean, 29 | labelCount?:{ 30 | count:number,force:boolean 31 | }, 32 | granularity?:number, 33 | granularityEnabled?:boolean, 34 | textColor?:string|number, 35 | textSize?:number, 36 | gridColor?:string|number, 37 | gridLineWidth?:number, 38 | axisLineWidth?:number, 39 | enableGridDashedLine?:{ 40 | lineLength:number, spaceLength:number, phase:number 41 | } 42 | } 43 | 44 | export interface YAxis extends Axis{ 45 | position?:YPosition, 46 | drawZeroLine?:boolean, 47 | zeroLineWidth?:number, 48 | zeroLineColor?:string|number, 49 | spaceTop?:number, 50 | spaceBottom?:number 51 | } 52 | export interface RightYAxis extends YAxis{} 53 | export interface LeftYAxis extends YAxis{} 54 | 55 | export interface XAxis extends Axis{ 56 | position?:XPosition, 57 | labelRotationAngle?:number 58 | } -------------------------------------------------------------------------------- /components/axes/index.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * iOS and Android apis should match. 3 | * It doesn't matter if you export `.ios` or `.android`, either one but only one. 4 | */ 5 | export * from "./index.android"; 6 | 7 | // Export any shared classes, constants, etc. 8 | //export * from "./line-chart.common"; 9 | -------------------------------------------------------------------------------- /components/chart/index.android.d.ts: -------------------------------------------------------------------------------- 1 | export interface BaseChartSettings { 2 | backgroundColor?: string | number; 3 | enabledDescription?: boolean; 4 | description?: string; 5 | descriptionColor?: string | number; 6 | descriptionPosition?: { 7 | x: number; 8 | y: number; 9 | }; 10 | descriptionTextSize?: number; 11 | noDataText?: string; 12 | drawGridBackground?: boolean; 13 | gridBackgroundColor?: string | number; 14 | drawBorders?: boolean; 15 | borderColor?: string | number; 16 | borderWidth?: number; 17 | maxVisibleValueCount?: number; 18 | } 19 | -------------------------------------------------------------------------------- /components/chart/index.android.ts: -------------------------------------------------------------------------------- 1 | declare var com; 2 | //let cLegend = com.github.mikephil.charting.components.Legends; 3 | export interface BaseChartSettings{ 4 | backgroundColor?:string|number, 5 | enabledDescription?:boolean, 6 | description?:string, 7 | descriptionColor?:string|number, 8 | descriptionPosition?:{x:number,y:number}, 9 | descriptionTextSize?:number, 10 | noDataText?:string, 11 | drawGridBackground?:boolean, 12 | gridBackgroundColor?:string|number, 13 | drawBorders?:boolean, 14 | borderColor?:string|number, 15 | borderWidth?:number, 16 | maxVisibleValueCount?:number 17 | } -------------------------------------------------------------------------------- /components/chart/index.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * iOS and Android apis should match. 3 | * It doesn't matter if you export `.ios` or `.android`, either one but only one. 4 | */ 5 | export * from "./index.android"; 6 | 7 | // Export any shared classes, constants, etc. 8 | //export * from "./line-chart.common"; 9 | -------------------------------------------------------------------------------- /components/dataset/index.android.d.ts: -------------------------------------------------------------------------------- 1 | export interface Dataset { 2 | valueTextColor?: string | number; 3 | valueTextColors?: Array; 4 | valueTextSize?: number; 5 | drawValues?: boolean; 6 | highlightEnabled?: boolean; 7 | drawVerticalHighlightIndicator?: boolean; 8 | drawHorizontalHighlightIndicator?: boolean; 9 | } 10 | -------------------------------------------------------------------------------- /components/dataset/index.android.ts: -------------------------------------------------------------------------------- 1 | declare var com; 2 | //let cLegend = com.github.mikephil.charting.components.Legends; 3 | export interface Dataset{ 4 | valueTextColor?:string|number, 5 | valueTextColors?:Array, 6 | valueTextSize?:number, 7 | drawValues?:boolean, 8 | highlightEnabled?:boolean, 9 | drawVerticalHighlightIndicator?:boolean, 10 | drawHorizontalHighlightIndicator?:boolean 11 | } -------------------------------------------------------------------------------- /components/dataset/index.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * iOS and Android apis should match. 3 | * It doesn't matter if you export `.ios` or `.android`, either one but only one. 4 | */ 5 | export * from "./index.android"; 6 | 7 | // Export any shared classes, constants, etc. 8 | //export * from "./line-chart.common"; 9 | -------------------------------------------------------------------------------- /components/legend/index.android.d.ts: -------------------------------------------------------------------------------- 1 | export declare enum LegendHorizontalAlignment { 2 | LEFT, 3 | CENTER, 4 | RIGHT, 5 | } 6 | export declare enum LegendVerticalAlignment { 7 | TOP, 8 | CENTER, 9 | BOTTOM, 10 | } 11 | export declare enum LegendForm { 12 | SQUARE, 13 | CIRCLE, 14 | LINE, 15 | } 16 | export interface ILegend { 17 | enabled?: boolean; 18 | textColor?: string | number; 19 | wordWrap?: boolean; 20 | maxSize?: number; 21 | form?: LegendForm; 22 | } 23 | -------------------------------------------------------------------------------- /components/legend/index.android.ts: -------------------------------------------------------------------------------- 1 | declare var com; 2 | //let cLegend = com.github.mikephil.charting.components.Legends; 3 | 4 | export enum LegendHorizontalAlignment{ 5 | LEFT = com.github.mikephil.charting.components.Legend.LegendHorizontalAlignment.LEFT, 6 | CENTER = com.github.mikephil.charting.components.Legend.LegendHorizontalAlignment.CENTER, 7 | RIGHT = com.github.mikephil.charting.components.Legend.LegendHorizontalAlignment.RIGHT 8 | } 9 | export enum LegendVerticalAlignment { 10 | TOP = com.github.mikephil.charting.components.Legend.LegendVerticalAlignment.TOP, 11 | CENTER = com.github.mikephil.charting.components.Legend.LegendVerticalAlignment.CENTER, 12 | BOTTOM = com.github.mikephil.charting.components.Legend.LegendVerticalAlignment.BOTTOM 13 | } 14 | 15 | export enum LegendForm{ 16 | SQUARE = com.github.mikephil.charting.components.Legend.LegendForm.SQUARE, 17 | CIRCLE = com.github.mikephil.charting.components.Legend.LegendForm.CIRCLE, 18 | LINE = com.github.mikephil.charting.components.Legend.LegendForm.LINE 19 | 20 | } 21 | 22 | export interface ILegend{ 23 | enabled?:boolean, 24 | textColor?: string|number, 25 | wordWrap?:boolean, 26 | maxSize?:number, 27 | form?: LegendForm 28 | } -------------------------------------------------------------------------------- /components/legend/index.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * iOS and Android apis should match. 3 | * It doesn't matter if you export `.ios` or `.android`, either one but only one. 4 | */ 5 | export * from "./index.android"; 6 | 7 | // Export any shared classes, constants, etc. 8 | //export * from "./line-chart.common"; 9 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 16 | 17 | 18 | 19 | 20 | 21 | 27 | 28 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/app.gradle: -------------------------------------------------------------------------------- 1 | // Add your native dependencies here: 2 | 3 | // Uncomment to add recyclerview-v7 dependency 4 | //dependencies { 5 | // compile 'com.android.support:recyclerview-v7:+' 6 | //} 7 | 8 | android { 9 | defaultConfig { 10 | generatedDensities = [] 11 | applicationId = "org.nativescript.chartdemo" 12 | } 13 | aaptOptions { 14 | additionalParameters "--no-version-vectors" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-hdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/Android/drawable-hdpi/background.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/Android/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-hdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/Android/drawable-hdpi/logo.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-ldpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/Android/drawable-ldpi/background.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/Android/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-ldpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/Android/drawable-ldpi/logo.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-mdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/Android/drawable-mdpi/background.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/Android/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-mdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/Android/drawable-mdpi/logo.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-nodpi/splash_screen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-xhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/Android/drawable-xhdpi/background.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-xhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/Android/drawable-xhdpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-xhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/Android/drawable-xhdpi/logo.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-xxhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/Android/drawable-xxhdpi/background.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-xxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/Android/drawable-xxhdpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-xxhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/Android/drawable-xxhdpi/logo.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-xxxhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/Android/drawable-xxxhdpi/background.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-xxxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/Android/drawable-xxxhdpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-xxxhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/Android/drawable-xxxhdpi/logo.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/values-v21/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3d5afe 4 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 11 | 14 | 15 | 16 | 19 | 20 | 23 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #F5F5F5 4 | #757575 5 | #33B5E5 6 | #272734 7 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 21 | 22 | 23 | 31 | 32 | 34 | 35 | 36 | 42 | 43 | 45 | 46 | -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "29x29", 5 | "idiom" : "iphone", 6 | "filename" : "icon-29.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "29x29", 11 | "idiom" : "iphone", 12 | "filename" : "icon-29@2x.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "icon-29@3x.png", 19 | "scale" : "3x" 20 | }, 21 | { 22 | "size" : "40x40", 23 | "idiom" : "iphone", 24 | "filename" : "icon-40@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "40x40", 29 | "idiom" : "iphone", 30 | "filename" : "icon-40@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "57x57", 35 | "idiom" : "iphone", 36 | "filename" : "icon-57.png", 37 | "scale" : "1x" 38 | }, 39 | { 40 | "size" : "57x57", 41 | "idiom" : "iphone", 42 | "filename" : "icon-57@2x.png", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "icon-60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "icon-60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "29x29", 59 | "idiom" : "ipad", 60 | "filename" : "icon-29.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "29x29", 65 | "idiom" : "ipad", 66 | "filename" : "icon-29@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "40x40", 71 | "idiom" : "ipad", 72 | "filename" : "icon-40.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "40x40", 77 | "idiom" : "ipad", 78 | "filename" : "icon-40@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "50x50", 83 | "idiom" : "ipad", 84 | "filename" : "icon-50.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "50x50", 89 | "idiom" : "ipad", 90 | "filename" : "icon-50@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "72x72", 95 | "idiom" : "ipad", 96 | "filename" : "icon-72.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "72x72", 101 | "idiom" : "ipad", 102 | "filename" : "icon-72@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "76x76", 107 | "idiom" : "ipad", 108 | "filename" : "icon-76.png", 109 | "scale" : "1x" 110 | }, 111 | { 112 | "size" : "76x76", 113 | "idiom" : "ipad", 114 | "filename" : "icon-76@2x.png", 115 | "scale" : "2x" 116 | }, 117 | { 118 | "size" : "83.5x83.5", 119 | "idiom" : "ipad", 120 | "filename" : "icon-83.5@2x.png", 121 | "scale" : "2x" 122 | } 123 | ], 124 | "info" : { 125 | "version" : 1, 126 | "author" : "xcode" 127 | } 128 | } -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "extent" : "full-screen", 5 | "idiom" : "iphone", 6 | "subtype" : "736h", 7 | "filename" : "Default-736h@3x.png", 8 | "minimum-system-version" : "8.0", 9 | "orientation" : "portrait", 10 | "scale" : "3x" 11 | }, 12 | { 13 | "extent" : "full-screen", 14 | "idiom" : "iphone", 15 | "subtype" : "736h", 16 | "filename" : "Default-Landscape@3x.png", 17 | "minimum-system-version" : "8.0", 18 | "orientation" : "landscape", 19 | "scale" : "3x" 20 | }, 21 | { 22 | "extent" : "full-screen", 23 | "idiom" : "iphone", 24 | "subtype" : "667h", 25 | "filename" : "Default-667h@2x.png", 26 | "minimum-system-version" : "8.0", 27 | "orientation" : "portrait", 28 | "scale" : "2x" 29 | }, 30 | { 31 | "orientation" : "portrait", 32 | "idiom" : "iphone", 33 | "filename" : "Default@2x.png", 34 | "extent" : "full-screen", 35 | "minimum-system-version" : "7.0", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "extent" : "full-screen", 40 | "idiom" : "iphone", 41 | "subtype" : "retina4", 42 | "filename" : "Default-568h@2x.png", 43 | "minimum-system-version" : "7.0", 44 | "orientation" : "portrait", 45 | "scale" : "2x" 46 | }, 47 | { 48 | "orientation" : "portrait", 49 | "idiom" : "ipad", 50 | "filename" : "Default-Portrait.png", 51 | "extent" : "full-screen", 52 | "minimum-system-version" : "7.0", 53 | "scale" : "1x" 54 | }, 55 | { 56 | "orientation" : "landscape", 57 | "idiom" : "ipad", 58 | "filename" : "Default-Landscape.png", 59 | "extent" : "full-screen", 60 | "minimum-system-version" : "7.0", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "orientation" : "portrait", 65 | "idiom" : "ipad", 66 | "filename" : "Default-Portrait@2x.png", 67 | "extent" : "full-screen", 68 | "minimum-system-version" : "7.0", 69 | "scale" : "2x" 70 | }, 71 | { 72 | "orientation" : "landscape", 73 | "idiom" : "ipad", 74 | "filename" : "Default-Landscape@2x.png", 75 | "extent" : "full-screen", 76 | "minimum-system-version" : "7.0", 77 | "scale" : "2x" 78 | }, 79 | { 80 | "orientation" : "portrait", 81 | "idiom" : "iphone", 82 | "filename" : "Default.png", 83 | "extent" : "full-screen", 84 | "scale" : "1x" 85 | }, 86 | { 87 | "orientation" : "portrait", 88 | "idiom" : "iphone", 89 | "filename" : "Default@2x.png", 90 | "extent" : "full-screen", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "orientation" : "portrait", 95 | "idiom" : "iphone", 96 | "filename" : "Default-568h@2x.png", 97 | "extent" : "full-screen", 98 | "subtype" : "retina4", 99 | "scale" : "2x" 100 | }, 101 | { 102 | "orientation" : "portrait", 103 | "idiom" : "ipad", 104 | "extent" : "to-status-bar", 105 | "scale" : "1x" 106 | }, 107 | { 108 | "orientation" : "portrait", 109 | "idiom" : "ipad", 110 | "filename" : "Default-Portrait.png", 111 | "extent" : "full-screen", 112 | "scale" : "1x" 113 | }, 114 | { 115 | "orientation" : "landscape", 116 | "idiom" : "ipad", 117 | "extent" : "to-status-bar", 118 | "scale" : "1x" 119 | }, 120 | { 121 | "orientation" : "landscape", 122 | "idiom" : "ipad", 123 | "filename" : "Default-Landscape.png", 124 | "extent" : "full-screen", 125 | "scale" : "1x" 126 | }, 127 | { 128 | "orientation" : "portrait", 129 | "idiom" : "ipad", 130 | "extent" : "to-status-bar", 131 | "scale" : "2x" 132 | }, 133 | { 134 | "orientation" : "portrait", 135 | "idiom" : "ipad", 136 | "filename" : "Default-Portrait@2x.png", 137 | "extent" : "full-screen", 138 | "scale" : "2x" 139 | }, 140 | { 141 | "orientation" : "landscape", 142 | "idiom" : "ipad", 143 | "extent" : "to-status-bar", 144 | "scale" : "2x" 145 | }, 146 | { 147 | "orientation" : "landscape", 148 | "idiom" : "ipad", 149 | "filename" : "Default-Landscape@2x.png", 150 | "extent" : "full-screen", 151 | "scale" : "2x" 152 | } 153 | ], 154 | "info" : { 155 | "version" : 1, 156 | "author" : "xcode" 157 | } 158 | } -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchScreen-AspectFill.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchScreen-AspectFill@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchScreen-Center.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchScreen-Center@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiresFullScreen 28 | 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/build.xcconfig: -------------------------------------------------------------------------------- 1 | // You can add custom settings here 2 | // for example you can uncomment the following line to force distribution code signing 3 | // CODE_SIGN_IDENTITY = iPhone Distribution 4 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 5 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 6 | -------------------------------------------------------------------------------- /demo/app/app.css: -------------------------------------------------------------------------------- 1 | .message { 2 | color: #000; 3 | font-size: 20; 4 | horizontal-align: center; 5 | padding:20; 6 | } 7 | -------------------------------------------------------------------------------- /demo/app/app.ts: -------------------------------------------------------------------------------- 1 | import * as application from "application"; 2 | application.start({ moduleName: "main-page" }); 3 | -------------------------------------------------------------------------------- /demo/app/main-page.ts: -------------------------------------------------------------------------------- 1 | import * as observable from "data/observable"; 2 | import * as pages from "ui/page"; 3 | import colorModule = require("color"); 4 | 5 | var Color = colorModule.Color; 6 | import {LineChart,LegendHorizontalAlignment,XPosition,YPosition,ILineChart,ILineSeries,LegendForm} from "nativescript-charts/line-chart"; 7 | //LineChart.LegendHorizontalAlignment; 8 | //import * as legend from "nativescript-charts/components/legend"; 9 | 10 | // Event handler for Page "loaded" event attached in main-page.xml 11 | declare var com:any; 12 | declare var java:any; 13 | declare var Array:any; 14 | 15 | var line:LineChart; 16 | var graph1:LineChart; 17 | var i=0; 18 | var obj=observable.fromObjectRecursive({ 19 | chartSettings:{}, 20 | chartData:{} 21 | }); 22 | var boolValue=true; 23 | export function pageLoaded(args: observable.EventData) { 24 | // Get the event sender 25 | 26 | 27 | 28 | let page = args.object; 29 | 30 | var StackLayout:any=page.getViewById("lay"); 31 | //console.log(1) 32 | var linechartOpts:ILineChart= { 33 | Legend:{ 34 | enabled:false, 35 | form:LegendForm.CIRCLE, 36 | }, 37 | XAxis:{ 38 | textSize:12, 39 | textColor:"green", 40 | position:XPosition.TOP, 41 | axisMinimum:-30, 42 | axisMaximum:30, 43 | drawGridLines:false, 44 | showOnlyMinMax:false, 45 | enabled:true 46 | }, 47 | RightYAxis:{ 48 | textSize:10, 49 | textColor:"green", 50 | position:YPosition.OUTSIDE_CHART, 51 | axisMaximum:120, 52 | axisMinimum:-10, 53 | showOnlyMinMax:false, 54 | drawGridLines:false, 55 | enabled:true 56 | }, 57 | LeftYAxis:{ 58 | textSize:10, 59 | textColor:"green", 60 | position:YPosition.OUTSIDE_CHART, 61 | axisMaximum:120, 62 | axisMinimum:-10, 63 | showOnlyMinMax:false, 64 | drawGridLines:false, 65 | enabled:true 66 | }, 67 | BaseSettings:{ 68 | //backgroundColor:"black", 69 | enabledDescription:false, 70 | drawGridBackground:false, 71 | } 72 | }; 73 | 74 | graph1=page.getViewById("graph1"); 75 | line = (new LineChart(linechartOpts)); 76 | //console.log(2) 77 | line.height=700; 78 | //console.log(3) 79 | StackLayout.addChild(line); 80 | //console.log(4) 81 | var chartData=[]; 82 | 83 | /*var points = [ 84 | {x:-25,y:0}, 85 | {x:-25,y:25} 86 | ]; 87 | var lineData = { 88 | lineData: points, 89 | color:"green", 90 | name:"test" 91 | };*/ 92 | chartData.push(addData( 93 | {x:-30,y:0},{x:-30,y:0},true 94 | )); 95 | chartData.push(addData( 96 | {x:30,y:0},{x:30,y:0},true 97 | )); 98 | chartData.push(addData( 99 | {x:-5,y:0}, 100 | {x:-5,y:20} 101 | )); 102 | chartData.push(addData( 103 | {x:-5,y:20}, 104 | {x:-25,y:20} 105 | )); 106 | chartData.push(addData( 107 | {x:-25,y:20}, 108 | {x:-5,y:40} 109 | )); 110 | chartData.push(addData( 111 | {x:-5,y:40}, 112 | {x:-20,y:40} 113 | )); 114 | chartData.push(addData( 115 | {x:-20,y:40}, 116 | {x:-5,y:60} 117 | )); 118 | chartData.push(addData( 119 | {x:-5,y:60}, 120 | {x:-15,y:60} 121 | )); 122 | chartData.push(addData( 123 | {x:-15,y:60}, 124 | {x:-5,y:80} 125 | )); 126 | chartData.push(addData( 127 | {x:-5,y:80}, 128 | {x:-10,y:80} 129 | )); 130 | chartData.push(addData( 131 | {x:-10,y:80}, 132 | {x:0,y:100} 133 | )); 134 | chartData.push(addData( 135 | {x:0,y:100}, 136 | {x:10,y:80} 137 | )); 138 | chartData.push(addData( 139 | {x:10,y:80}, 140 | {x:5,y:80} 141 | )); 142 | chartData.push(addData( 143 | {x:5,y:80}, 144 | {x:15,y:60} 145 | )); 146 | chartData.push(addData( 147 | {x:15,y:60}, 148 | {x:5,y:60} 149 | )); 150 | chartData.push(addData( 151 | {x:5,y:60}, 152 | {x:20,y:40} 153 | )); 154 | chartData.push(addData( 155 | {x:20,y:40}, 156 | {x:5,y:40} 157 | )); 158 | chartData.push(addData( 159 | {x:5,y:40}, 160 | {x:25,y:20} 161 | )); 162 | chartData.push(addData( 163 | {x:25,y:20}, 164 | {x:5,y:20} 165 | )); 166 | chartData.push(addData( 167 | {x:5,y:20}, 168 | {x:5,y:0} 169 | )); 170 | chartData.push(addData( 171 | {x:5,y:0}, 172 | {x:-5,y:0} 173 | )); 174 | //console.log(5) 175 | 176 | var chartData2=[]; 177 | var counter = chartData.length; 178 | var c=0; 179 | line.setChartSettings(linechartOpts); 180 | line.setChartData(chartData); 181 | line.setChartSettings(linechartOpts); 182 | /*var timer=setInterval(()=>{ 183 | chartData2.push(chartData[c]); 184 | 185 | line.setChartData(chartData2); 186 | 187 | c++; 188 | if(c==counter)clearInterval(timer); 189 | },1000);*/ 190 | 191 | 192 | 193 | // graph1.addLine(lineData); 194 | 195 | 196 | //console.log(5) 197 | //graph1.addLine(lineData); 198 | 199 | 200 | 201 | var points2 = [ 202 | {x:1,y:4}, 203 | {x:3,y:5.9}, 204 | {x:7,y:4}, 205 | {x:8,y:10}, 206 | {x:10,y:1} 207 | ]; 208 | var lineData2:ILineSeries = { 209 | lineData: points2, 210 | color:"green", 211 | name:"test", 212 | }; 213 | //console.log(6) 214 | //line.addLine(lineData2); 215 | //obj.set("chartSettings",linechartOpts); 216 | //obj.set("chartData",[lineData,lineData2]); 217 | //line.chartSettings((obj).lineChartOpts); 218 | //console.dump(line.chartSettings); 219 | //line.set('chartSettings',(obj).chartSettings); 220 | //console.dump(line); 221 | //console.dump(line.chartSettings); 222 | page.bindingContext=obj; 223 | 224 | //graph1.addLine(lineData2); 225 | 226 | } 227 | 228 | export function addLine(args: observable.EventData){ 229 | var points2 = [ 230 | {x:1,y:(Math.random() * 100) - 49}, 231 | {x:3,y:(Math.random() * 100) - 49}, 232 | {x:7,y:(Math.random() * 100) - 19}, 233 | {x:8,y:(Math.random() * 100) - 79}, 234 | {x:10,y:(Math.random() * 100) - 59} 235 | ]; 236 | var color= Math.floor((Math.random()*16777215) - 16777216); 237 | var textColors=[ 238 | Math.floor((Math.random()*16777215) - 16777216), 239 | Math.floor((Math.random()*16777215) - 16777216) 240 | ]; 241 | //console.log("color: " + color); 242 | 243 | var lineData2:ILineSeries = { 244 | lineData: points2, 245 | color:color, 246 | name:"test"+i, 247 | valueTextSize:10, 248 | valueTextColors:textColors, 249 | circleColor:color, 250 | drawCircleHole:false, 251 | circleRadius:4 252 | }; 253 | i++; 254 | line.addLine(lineData2); 255 | graph1.addLine(lineData2); 256 | 257 | } 258 | 259 | export function clearData(args: observable.EventData){ 260 | line.clearData(); 261 | graph1.clearData(); 262 | } 263 | export function clearGraph(args: observable.EventData){ 264 | line.clear(); 265 | graph1.clear(); 266 | } 267 | 268 | export function editSettings(args: observable.EventData){ 269 | let page = args.object; 270 | boolValue=!boolValue; 271 | //obj. 272 | /*var linechartOpts:ILineChart=observable.fromObjectRecursive({ 273 | Legend:{ 274 | enabled:boolValue 275 | }, 276 | XAxis:{ 277 | textSize:(Math.random()*10) + 1, 278 | textColor:Math.floor((Math.random()*16777215) - 16777216) 279 | position:XPosition.BOTTOM 280 | }, 281 | RightYAxis:{ 282 | textSize:(Math.random()*10) + 1, 283 | textColor:Math.floor((Math.random()*16777215) - 16777216) 284 | }, 285 | LeftYAxis:{ 286 | textSize:(Math.random()*10) + 1, 287 | textColor:Math.floor((Math.random()*16777215) - 16777216) 288 | }, 289 | BaseSettings:{ 290 | //backgroundColor:"black", 291 | enabledDescription:boolValue, 292 | description:"POMOOOOOOOOOOOOOOOOOC", 293 | noDataText:"Nemame data" 294 | } 295 | });*/ 296 | //obj.set("chartSettings",linechartOpts); 297 | } 298 | 299 | function addData(point,point2,hide=false){ 300 | return { 301 | lineData: [point,point2], 302 | color:(hide?"white":"green"), 303 | name:"test", 304 | lineWidth:3, 305 | drawFilled:false, 306 | circleColor:(hide?"white":"green"), 307 | circleRadius:(hide?3:0), 308 | drawCircleHole:false 309 | //fillColor:"green" 310 | }; 311 | } -------------------------------------------------------------------------------- /demo/app/main-page.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /demo/app/main-view-model.ts: -------------------------------------------------------------------------------- 1 | import {Observable} from "data/observable"; 2 | 3 | 4 | export class HelloWorldModel extends Observable { 5 | public message: string; 6 | 7 | constructor() { 8 | super(); 9 | 10 | 11 | } 12 | } -------------------------------------------------------------------------------- /demo/app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tns-template-hello-world-ts", 3 | "main": "app.js", 4 | "version": "1.6.0", 5 | "author": { 6 | "name": "Telerik", 7 | "email": "support@telerik.com" 8 | }, 9 | "description": "Nativescript hello-world-ts project template", 10 | "license": "Apache-2.0", 11 | "keywords": [ 12 | "telerik", 13 | "mobile", 14 | "nativescript", 15 | "{N}", 16 | "tns", 17 | "appbuilder", 18 | "template" 19 | ], 20 | "repository": { 21 | "type": "git", 22 | "url": "git+ssh://git@github.com/NativeScript/template-hello-world-ts.git" 23 | }, 24 | "bugs": { 25 | "url": "https://github.com/NativeScript/template-hello-world-ts/issues" 26 | }, 27 | "homepage": "https://github.com/NativeScript/template-hello-world-ts", 28 | "android": { 29 | "v8Flags": "--expose_gc" 30 | }, 31 | "devDependencies": { 32 | "nativescript-dev-typescript": "^0.3.0" 33 | }, 34 | "_id": "tns-template-hello-world-ts@1.6.0", 35 | "_shasum": "a567c2b9a56024818c06596dab9629d155c5b8a8", 36 | "_resolved": "https://registry.npmjs.org/tns-template-hello-world-ts/-/tns-template-hello-world-ts-1.6.0.tgz", 37 | "_from": "tns-template-hello-world-ts@latest", 38 | "scripts": {}, 39 | "_npmVersion": "2.14.7", 40 | "_nodeVersion": "4.2.2", 41 | "_npmUser": { 42 | "name": "enchev", 43 | "email": "vladimir.enchev@gmail.com" 44 | }, 45 | "dist": { 46 | "shasum": "a567c2b9a56024818c06596dab9629d155c5b8a8", 47 | "tarball": "http://registry.npmjs.org/tns-template-hello-world-ts/-/tns-template-hello-world-ts-1.6.0.tgz" 48 | }, 49 | "maintainers": [ 50 | { 51 | "name": "enchev", 52 | "email": "vladimir.enchev@gmail.com" 53 | }, 54 | { 55 | "name": "erjangavalji", 56 | "email": "erjan.gavalji@gmail.com" 57 | }, 58 | { 59 | "name": "fatme", 60 | "email": "hfatme@gmail.com" 61 | }, 62 | { 63 | "name": "hdeshev", 64 | "email": "hristo@deshev.com" 65 | }, 66 | { 67 | "name": "kerezov", 68 | "email": "d.kerezov@gmail.com" 69 | }, 70 | { 71 | "name": "ligaz", 72 | "email": "stefan.dobrev@gmail.com" 73 | }, 74 | { 75 | "name": "nsndeck", 76 | "email": "nedyalko.nikolov@telerik.com" 77 | }, 78 | { 79 | "name": "rosen-vladimirov", 80 | "email": "rosen.vladimirov.91@gmail.com" 81 | }, 82 | { 83 | "name": "sdobrev", 84 | "email": "stefan.dobrev@gmail.com" 85 | }, 86 | { 87 | "name": "tailsu", 88 | "email": "tailsu@gmail.com" 89 | }, 90 | { 91 | "name": "teobugslayer", 92 | "email": "teobugslayer@gmail.com" 93 | }, 94 | { 95 | "name": "valio.stoychev", 96 | "email": "valio.stoychev@gmail.com" 97 | } 98 | ], 99 | "_npmOperationalInternal": { 100 | "host": "packages-5-east.internal.npmjs.com", 101 | "tmp": "tmp/tns-template-hello-world-ts-1.6.0.tgz_1455717516189_0.6427943941671401" 102 | }, 103 | "directories": {}, 104 | "readme": "ERROR: No README data found!" 105 | } 106 | -------------------------------------------------------------------------------- /demo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "nativescript": { 3 | "id": "org.nativescript.chartdemo", 4 | "tns-ios": { 5 | "version": "2.2.1" 6 | }, 7 | "tns-android": { 8 | "version": "2.5.0" 9 | } 10 | }, 11 | "dependencies": { 12 | "nativescript-charts": "file:///D:\\Android\\AndroidPlugins\\MPAndroidChart\\myplugin", 13 | "nativescript-dev-typescript": "^0.3.2", 14 | "tns-core-modules": "^2.5.0", 15 | "tns-platform-declarations": "^2.3.0" 16 | }, 17 | "devDependencies": { 18 | "babel-traverse": "6.7.6", 19 | "babel-types": "6.7.7", 20 | "babylon": "6.7.0", 21 | "filewalker": "0.1.2", 22 | "lazy": "1.0.11", 23 | "nativescript-dev-typescript": "^0.3.2", 24 | "typescript": "^2.0.10" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /demo/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es5", 5 | "sourceMap": true, 6 | "experimentalDecorators": true, 7 | "noEmitHelpers": true 8 | }, 9 | "exclude": [ 10 | "node_modules", 11 | "platforms" 12 | ] 13 | } -------------------------------------------------------------------------------- /demo_examples_img/christmas tree.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo_examples_img/christmas tree.PNG -------------------------------------------------------------------------------- /demo_examples_img/legend_disable.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo_examples_img/legend_disable.PNG -------------------------------------------------------------------------------- /demo_examples_img/legend_enabled.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markosko/nativescript-charts/9aef56483ce1eb52d60b0d24eb85c576cbb00316/demo_examples_img/legend_enabled.PNG -------------------------------------------------------------------------------- /helper/index.d.ts: -------------------------------------------------------------------------------- 1 | export declare function resolveColor(color: string | number): number; 2 | -------------------------------------------------------------------------------- /helper/index.ts: -------------------------------------------------------------------------------- 1 | import {Color} from "color"; 2 | export function resolveColor(color:string|number){ 3 | if(typeof color == "string" && Color.isValid(color)){ 4 | return new Color(color).argb; 5 | } 6 | else if(typeof color == "number"){ 7 | return new Color(color).argb 8 | } 9 | return new Color("black").argb 10 | } -------------------------------------------------------------------------------- /index.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * iOS and Android apis should match. 3 | * It doesn't matter if you export `.ios` or `.android`, either one but only one. 4 | */ 5 | export * from "./nativescript-charts.android"; 6 | 7 | // Export any shared classes, constants, etc. 8 | export * from "./nativescript-charts.common"; 9 | export * from "./line-chart"; 10 | export * from "./components/legend/index.android"; 11 | -------------------------------------------------------------------------------- /line-chart/index.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * iOS and Android apis should match. 3 | * It doesn't matter if you export `.ios` or `.android`, either one but only one. 4 | */ 5 | export * from "./line-chart.android"; 6 | export * from "../components/legend"; 7 | // Export any shared classes, constants, etc. 8 | //export * from "./line-chart.common"; 9 | -------------------------------------------------------------------------------- /line-chart/line-chart.android.d.ts: -------------------------------------------------------------------------------- 1 | import { ILineSeries, IPoint, LegendForm, LegendHorizontalAlignment, LegendVerticalAlignment, ILineChart, XPosition, YPosition, Axis, XAxis, RightYAxis, LeftYAxis, LineChartCommon } from "./line-chart.common"; 2 | export { ILineSeries, IPoint, LegendForm, LegendHorizontalAlignment, LegendVerticalAlignment, ILineChart, XPosition, YPosition, Axis, XAxis, RightYAxis, LeftYAxis }; 3 | export declare class LineChart extends LineChartCommon { 4 | private _android; 5 | readonly android: any; 6 | readonly _nativeView: any; 7 | _createUI(): void; 8 | invalidate(): void; 9 | clear(): void; 10 | clearData(): void; 11 | setChartSettings(lineChartArgs: ILineChart): void; 12 | addLine(lineData: ILineSeries): void; 13 | setChartData(chartData: Array): void; 14 | getXAxis(): any; 15 | getRightYAxis(): any; 16 | getLeftYAxis(): any; 17 | private setChart(); 18 | private setYAxis(yAxisArgs, YAxis); 19 | } 20 | -------------------------------------------------------------------------------- /line-chart/line-chart.android.ts: -------------------------------------------------------------------------------- 1 | import {ILineSeries,IPoint,LegendForm,LegendHorizontalAlignment,LegendVerticalAlignment,ILineChart,XPosition,YPosition,Axis,XAxis,RightYAxis,LeftYAxis,LineChartCommon} 2 | from "./line-chart.common"; 3 | export {ILineSeries,IPoint,LegendForm,LegendHorizontalAlignment,LegendVerticalAlignment,ILineChart,XPosition,YPosition,Axis,XAxis,RightYAxis,LeftYAxis} 4 | import {Color} from "color"; 5 | import { PropertyChangeData } from "ui/core/dependency-observable"; 6 | import { PropertyMetadata } from "ui/core/proxy"; 7 | import {resolveColor} from "../helper"; 8 | declare var com:any; 9 | declare var java:any; 10 | 11 | var LineDataSet = com.github.mikephil.charting.data.LineDataSet; 12 | var LineData = com.github.mikephil.charting.data.LineData; 13 | var Entry = com.github.mikephil.charting.data.Entry; 14 | var ArrayList = java.util.ArrayList; 15 | var Legend = com.github.mikephil.charting.components.Legend; 16 | var YAxisPosition = com.github.mikephil.charting.components.YAxis.YAxisLabelPosition; 17 | var XAxisPosition = com.github.mikephil.charting.components.XAxis.XAxisPosition; 18 | 19 | 20 | function onChartSettingsPropertyChanged(data: PropertyChangeData) { 21 | var LineChart = data.object; 22 | if (!LineChart.android) { 23 | return; 24 | } 25 | LineChart.setChartSettings(data.newValue); 26 | console.log("Chart settings changed."); 27 | //console.dump(data); 28 | /*.setPenColor(new Color(data.newValue).android)*/; 29 | } 30 | 31 | function onChartDataPropertyChanged(data: PropertyChangeData) { 32 | var LineChart = data.object; 33 | if (!LineChart.android) { 34 | return; 35 | } 36 | LineChart.setChartData(>data.newValue); 37 | console.log("Chart settings changed."); 38 | //console.dump(data); 39 | /*.setPenColor(new Color(data.newValue).android)*/; 40 | } 41 | 42 | 43 | (LineChartCommon.chartSettingsProperty.metadata).onSetNativeValue = onChartSettingsPropertyChanged; 44 | (LineChartCommon.chartDataProperty.metadata).onSetNativeValue = onChartDataPropertyChanged; 45 | 46 | 47 | //var Form=com.github.mikephil.charting.components.Legend.LegendForm; 48 | export class LineChart extends LineChartCommon { 49 | private _android: any; 50 | 51 | //typically, you'd have a .common.ts for common stuff 52 | //and a .android.ts that extends common for android-specific stuff (same for ios) 53 | //I'm showing in same class for simplicity 54 | 55 | //provide getters to native component that this NativeScript component represents 56 | get android() { return this._android; } 57 | get _nativeView() { return this._android; } 58 | 59 | 60 | //set chartSettings(value: ILineChart) { 61 | //super(); 62 | //this._setValue(LineChartCommon.chartSettingsProperty, value); 63 | //} 64 | 65 | //how we create the UI of our View 66 | public _createUI() { 67 | this._android = new com.github.mikephil.charting.charts.LineChart(this._context,null); 68 | this.setChart(); 69 | 70 | } 71 | public invalidate(){ 72 | this._nativeView.invalidate(); 73 | } 74 | 75 | public clear(){ 76 | this._nativeView.clear(); 77 | this._nativeView.notifyDataSetChanged(); 78 | this.setChart(); 79 | } 80 | 81 | public clearData(){ 82 | if(this._nativeView.getData()){ 83 | this._nativeView.getData().clearValues(); 84 | this._nativeView.notifyDataSetChanged(); 85 | this.invalidate(); 86 | } 87 | } 88 | 89 | public setChartSettings(lineChartArgs:ILineChart){ 90 | this.lineChartArgs=lineChartArgs; 91 | this.setChart(); 92 | this._nativeView.notifyDataSetChanged(); 93 | this.invalidate(); 94 | } 95 | 96 | public addLine(lineData:ILineSeries){ 97 | var entries = new ArrayList(); 98 | lineData.lineData.forEach((point:IPoint)=>{ 99 | entries.add( 100 | new Entry(point.x,point.y) 101 | ); 102 | }) 103 | var dataset = new LineDataSet(entries,lineData.name); 104 | this.setDataset(dataset,lineData); 105 | 106 | if(this._android.getData() == null || this._android.getData().getDataSetCount()==0){ 107 | var lineDatasets = new ArrayList(); 108 | lineDatasets.add(dataset); 109 | var lineDatas= new LineData(lineDatasets); 110 | this._android.setData(lineDatas); 111 | } 112 | else{ 113 | this._android.getData().addDataSet(dataset); 114 | } 115 | this._android.getData().notifyDataChanged(); 116 | this._android.notifyDataSetChanged(); 117 | this.invalidate(); 118 | } 119 | 120 | public setChartData(chartData:Array){ 121 | if(typeof chartData == "undefined" || chartData == {} || chartData.length==0) 122 | return ; 123 | this.setChart(); 124 | var lineDatasets = new ArrayList(); 125 | chartData.forEach((lineSerie:ILineSeries)=>{ 126 | var entries = new ArrayList(); 127 | lineSerie.lineData.forEach((point:IPoint)=>{ 128 | entries.add( 129 | new Entry(point.x,point.y) 130 | ); 131 | }) 132 | var dataset = new LineDataSet(entries,lineSerie.name); 133 | this.setDataset(dataset,lineSerie); 134 | lineDatasets.add(dataset); 135 | }); 136 | var lineDatas= new LineData(lineDatasets); 137 | this._android.setData(lineDatas); 138 | this._android.getData().notifyDataChanged(); 139 | this._android.notifyDataSetChanged(); 140 | this.invalidate(); 141 | } 142 | 143 | 144 | 145 | public getXAxis(){ 146 | return this._android.getXAxis(); 147 | } 148 | public getRightYAxis(){ 149 | return this._android.getAxisRight(); 150 | } 151 | public getLeftYAxis(){ 152 | return this._android.getAxisLeft(); 153 | } 154 | 155 | /*private setDataset(lineData,dataset){ 156 | dataset.setColor(resolveColor(lineData.color)); 157 | if('valueTextColor' in lineData){ 158 | dataset.setValueTextColor(resolveColor(lineData.valueTextColor)); 159 | } 160 | if('valueTextColors' in lineData){ 161 | var colors = new ArrayList(); 162 | lineData.valueTextColors.forEach((item)=>{ 163 | colors.add(new java.lang.Integer(resolveColor(item))); 164 | }); 165 | dataset.setValueTextColors(colors); 166 | colors=null; 167 | } 168 | if('valueTextSize' in lineData){ 169 | dataset.setValueTextSize(lineData.valueTextSize); 170 | } 171 | if('drawValues' in lineData){ 172 | dataset.setDrawValues(lineData.drawValues); 173 | } 174 | if('highlightEnabled' in lineData){ 175 | dataset.setHighlightEnabled(lineData.highlightEnabled); 176 | } 177 | if('drawVerticalHighlightIndicator' in lineData){ 178 | dataset.setDrawVerticalHighlightIndicator(lineData.drawVerticalHighlightIndicator); 179 | } 180 | if('drawHorizontalHighlightIndicator' in lineData){ 181 | dataset.setDrawHorizontalHighlightIndicator(lineData.drawHorizontalHighlightIndicator); 182 | } 183 | if('highLightColor' in lineData){ 184 | dataset.setHighLightColor(resolveColor(lineData.highLightColor)); 185 | } 186 | if('drawHighlightIndicators' in lineData){ 187 | dataset.setDrawHighlightIndicators(lineData.drawHighlightIndicators); 188 | } 189 | if('highlightLineWidth' in lineData){ 190 | dataset.setHighlightLineWidth(lineData.highlightLineWidth); 191 | } 192 | if('fillColor' in lineData){ 193 | dataset.setFillColor(resolveColor(lineData.fillColor)); 194 | } 195 | if('fillAlpha' in lineData){ 196 | if(lineData.fillAlpha <= 255 && lineData.fillAlpha >= 0){ 197 | dataset.setFillAlpha(lineData.fillAlpha); 198 | } 199 | } 200 | if('drawFilled' in lineData){ 201 | dataset.setDrawFilled(lineData.drawFilled); 202 | } 203 | if('lineWidth' in lineData){ 204 | dataset.setLineWidth(lineData.lineWidth); 205 | } 206 | if('circleRadius' in lineData){ 207 | dataset.setCircleRadius(lineData.circleRadius); 208 | } 209 | if('circleColor' in lineData){ 210 | dataset.setCircleColor(resolveColor(lineData.circleColor)); 211 | } 212 | if('circleColorHole' in lineData){ 213 | dataset.setCircleColorHole(resolveColor(lineData.circleColorHole)); 214 | } 215 | if('drawCircleHole' in lineData){ 216 | dataset.setDrawCircleHole(lineData.drawCircleHole); 217 | } 218 | if('enableDashedLine' in lineData){ 219 | dataset.enableDashedLine(lineData.enableDashedLine.lineLength, lineData.enableDashedLine.spaceLength, lineData.enableDashedLine.phase); 220 | } 221 | 222 | }*/ 223 | 224 | private setChart(){ 225 | if(typeof this.lineChartArgs == "undefined"){ 226 | return; 227 | } 228 | if('BaseSettings' in this.lineChartArgs){ 229 | let chart = this._android; 230 | let baseSettings = this.lineChartArgs.BaseSettings; 231 | if('backgroundColor' in baseSettings){ 232 | chart.setBackgroundColor(resolveColor(baseSettings.backgroundColor)); 233 | } 234 | if('enabledDescription' in baseSettings){ 235 | if(typeof baseSettings.enabledDescription == "boolean") 236 | chart.getDescription().setEnabled(baseSettings.enabledDescription); 237 | } 238 | if('description' in baseSettings){ 239 | if(typeof baseSettings.description=="string") 240 | chart.getDescription().setText(baseSettings.description); 241 | } 242 | if('descriptionColor' in baseSettings){ 243 | chart.getDescription().setTextColor(baseSettings.descriptionColor); 244 | } 245 | if('descriptionPosition' in baseSettings){ 246 | if(typeof baseSettings.descriptionPosition.x != "undefined" && baseSettings.descriptionPosition.x > 0 && 247 | typeof baseSettings.descriptionPosition.y != "undefined" && baseSettings.descriptionPosition.y > 0 248 | ) 249 | chart.getDescription().setPosition(baseSettings.descriptionPosition.x,baseSettings.descriptionPosition.y) 250 | } 251 | if('descriptionTextSize' in baseSettings){ 252 | if(baseSettings.descriptionTextSize > 0) 253 | chart.getDescription().setTextSize(baseSettings.descriptionTextSize); 254 | } 255 | if('noDataText' in baseSettings){ 256 | if(typeof baseSettings.noDataText=="string")chart.setNoDataText(baseSettings.noDataText); 257 | } 258 | if('drawGridBackground' in baseSettings){ 259 | if(typeof baseSettings.drawGridBackground=="boolean")chart.setDrawGridBackground(baseSettings.drawGridBackground); 260 | } 261 | if('gridBackgroundColor' in baseSettings){ 262 | chart.setGridBackgroundColor(resolveColor(baseSettings.gridBackgroundColor)); 263 | } 264 | if('drawBorders' in baseSettings){ 265 | if(typeof baseSettings.drawBorders=="boolean")chart.setDrawBorders(baseSettings.drawBorders); 266 | } 267 | if('borderColor' in baseSettings){ 268 | chart.setBorderColor(resolveColor(baseSettings.borderColor)); 269 | } 270 | if('borderWidth' in baseSettings){ 271 | if(baseSettings.borderWidth > 0) 272 | chart.setBorderWidth(baseSettings.borderWidth); 273 | } 274 | if('maxVisibleValueCount' in baseSettings){ 275 | if(baseSettings.maxVisibleValueCount > 0) 276 | chart.setMaxVisibleValueCount(baseSettings.maxVisibleValueCount); 277 | } 278 | } 279 | if('Legend' in this.lineChartArgs){ 280 | let legend = this._android.getLegend(); 281 | let legendArgs = this.lineChartArgs.Legend; 282 | if('enabled' in legendArgs){ 283 | if(typeof legendArgs.enabled=="boolean")legend.setEnabled(legendArgs.enabled); 284 | } 285 | if('textColor' in legendArgs){ 286 | legend.setTextColor(resolveColor(legendArgs.textColor)); 287 | } 288 | if('wordWrap' in legendArgs){ 289 | if(typeof legendArgs.wordWrap=="boolean")legend.setWordWrap(legendArgs.wordWrap); 290 | } 291 | if('maxSize' in legendArgs){ 292 | if(legendArgs.maxSize>0)legend.setMaxSize(legendArgs.maxSize); 293 | } 294 | if('form' in legendArgs){ 295 | legend.setForm(Legend.LegendForm.valueOf(legendArgs.form)); 296 | } 297 | } 298 | if('XAxis' in this.lineChartArgs){ 299 | let xAxisArgs = this.lineChartArgs.XAxis; 300 | let XAxis = this._android.getXAxis(); 301 | if('enabled' in xAxisArgs){ 302 | if(typeof xAxisArgs.enabled=="boolean")XAxis.setEnabled(xAxisArgs.enabled); 303 | } 304 | if('drawLabels' in xAxisArgs){ 305 | if(typeof xAxisArgs.drawLabels=="boolean")XAxis.setDrawLabels(xAxisArgs.drawLabels); 306 | } 307 | if('drawAxisLine' in xAxisArgs){ 308 | if(typeof xAxisArgs.drawAxisLine=="boolean")XAxis.setDrawAxisLine(xAxisArgs.drawAxisLine); 309 | } 310 | if('drawGridLines' in xAxisArgs){ 311 | if(typeof xAxisArgs.drawGridLines=="boolean")XAxis.setDrawGridLines(xAxisArgs.drawGridLines); 312 | } 313 | if('axisMaximum' in xAxisArgs){ 314 | if(typeof xAxisArgs.axisMaximum=="boolean")XAxis.setAxisMaximum(xAxisArgs.axisMaximum); 315 | } 316 | if('axisMinimum' in xAxisArgs){ 317 | if(typeof xAxisArgs.axisMinimum=="boolean")XAxis.setAxisMinimum(xAxisArgs.axisMinimum); 318 | } 319 | if('inverted' in xAxisArgs){ 320 | if(typeof xAxisArgs.inverted=="boolean")XAxis.setInverted(xAxisArgs.inverted); 321 | } 322 | /*if('spaceTop' in xAxisArgs){ 323 | if(xAxisArgs.spaceTop <= 100 && xAxisArgs.spaceTop >= 0) XAxis.setSpaceTop(xAxisArgs.spaceTop); 324 | } 325 | if('spaceBottom' in xAxisArgs){ 326 | if(xAxisArgs.spaceBottom <= 100 && xAxisArgs.spaceBottom >= 0) XAxis.setSpaceBottom(xAxisArgs.spaceBottom); 327 | }*/ 328 | if('showOnlyMinMax' in xAxisArgs){ 329 | if(typeof xAxisArgs.inverted=="boolean")XAxis.setShowOnlyMinMax(xAxisArgs.showOnlyMinMax); 330 | } 331 | if('labelCount' in xAxisArgs){ 332 | if(xAxisArgs.labelCount.count>0 && typeof xAxisArgs.labelCount.count != "undefined" && typeof xAxisArgs.labelCount.force == "boolean") 333 | XAxis.setLabelCount(xAxisArgs.labelCount.count,xAxisArgs.labelCount.force); 334 | } 335 | if('granularity' in xAxisArgs){ 336 | if(xAxisArgs.granularity>0)XAxis.setGranularity(xAxisArgs.granularity); 337 | } 338 | if('granularityEnabled' in xAxisArgs){ 339 | if(typeof xAxisArgs.granularityEnabled=="boolean")XAxis.setGranularityEnabled(xAxisArgs.granularityEnabled); 340 | } 341 | if('textColor' in xAxisArgs){ 342 | XAxis.setTextColor(resolveColor(xAxisArgs.textColor)); 343 | } 344 | if('textSize' in xAxisArgs){ 345 | if(xAxisArgs.textSize > 0)XAxis.setTextSize(xAxisArgs.textSize); 346 | } 347 | if('gridColor' in xAxisArgs){ 348 | XAxis.setGridColor(resolveColor(xAxisArgs.gridColor)); 349 | } 350 | if('gridLineWidth' in xAxisArgs){ 351 | if(xAxisArgs.textSize > 0)XAxis.setGridLineWidth(xAxisArgs.gridLineWidth); 352 | } 353 | if('enableGridDashedLine' in xAxisArgs){ 354 | if(xAxisArgs.enableGridDashedLine.lineLength>0 && xAxisArgs.enableGridDashedLine.spaceLength>0 && xAxisArgs.enableGridDashedLine.phase>0) 355 | XAxis.enableGridDashedLine(xAxisArgs.enableGridDashedLine.lineLength, xAxisArgs.enableGridDashedLine.spaceLength, xAxisArgs.enableGridDashedLine.phase); 356 | } 357 | if('position' in xAxisArgs){ 358 | XAxis.setPosition(XAxisPosition.valueOf(xAxisArgs.position)); 359 | } 360 | if('labelRotationAngle' in xAxisArgs){ 361 | XAxis.setLabelRotationAngle(xAxisArgs.labelRotationAngle); 362 | } 363 | } 364 | if('RightYAxis' in this.lineChartArgs){ 365 | let yAxisArgs = this.lineChartArgs.RightYAxis; 366 | let YAxis = this._android.getAxisRight(); 367 | this.setYAxis(yAxisArgs,YAxis); 368 | } 369 | if('LeftYAxis' in this.lineChartArgs){ 370 | let yAxisArgs = this.lineChartArgs.LeftYAxis; 371 | let YAxis = this._android.getAxisLeft(); 372 | this.setYAxis(yAxisArgs,YAxis); 373 | } 374 | } 375 | private setYAxis(yAxisArgs,YAxis){ 376 | if('enabled' in yAxisArgs){ 377 | if(typeof yAxisArgs.enabled=="boolean")YAxis.setEnabled(yAxisArgs.enabled); 378 | } 379 | if('drawLabels' in yAxisArgs){ 380 | if(typeof yAxisArgs.drawLabels=="boolean")YAxis.setDrawLabels(yAxisArgs.drawLabels); 381 | } 382 | if('drawAxisLine' in yAxisArgs){ 383 | if(typeof yAxisArgs.drawLabels=="boolean")YAxis.setDrawAxisLine(yAxisArgs.drawAxisLine); 384 | } 385 | if('drawGridLines' in yAxisArgs){ 386 | if(typeof yAxisArgs.drawLabels=="boolean")YAxis.setDrawGridLines(yAxisArgs.drawGridLines); 387 | } 388 | if('axisMaximum' in yAxisArgs){ 389 | YAxis.setAxisMaximum(yAxisArgs.axisMaximum); 390 | } 391 | if('axisMinimum' in yAxisArgs){ 392 | YAxis.setAxisMinimum(yAxisArgs.axisMinimum); 393 | } 394 | if('inverted' in yAxisArgs){ 395 | if(typeof yAxisArgs.drawLabels=="boolean")YAxis.setInverted(yAxisArgs.inverted); 396 | } 397 | if('spaceTop' in yAxisArgs){ 398 | if(yAxisArgs.spaceTop <= 100 && yAxisArgs.spaceTop >= 0) YAxis.setSpaceTop(yAxisArgs.spaceTop); 399 | } 400 | if('spaceBottom' in yAxisArgs){ 401 | if(yAxisArgs.spaceBottom <= 100 && yAxisArgs.spaceBottom >= 0) YAxis.setSpaceBottom(yAxisArgs.spaceBottom); 402 | } 403 | if('showOnlyMinMax' in yAxisArgs){ 404 | if(typeof yAxisArgs.drawLabels=="boolean")YAxis.setShowOnlyMinMax(yAxisArgs.showOnlyMinMax); 405 | } 406 | if('labelCount' in yAxisArgs){ 407 | if(yAxisArgs.labelCount.count && yAxisArgs.labelCount.count > 0 && typeof yAxisArgs.labelCount.force=="boolean") 408 | YAxis.setLabelCount(yAxisArgs.labelCount.count,yAxisArgs.labelCount.force); 409 | } 410 | if('granularity' in yAxisArgs){ 411 | if(yAxisArgs.granularity > 0) YAxis.setGranularity(yAxisArgs.granularity); 412 | } 413 | if('granularityEnabled' in yAxisArgs){ 414 | if(typeof yAxisArgs.drawLabels=="boolean")YAxis.setGranularityEnabled(yAxisArgs.granularityEnabled); 415 | } 416 | if('textColor' in yAxisArgs){ 417 | YAxis.setTextColor(resolveColor(yAxisArgs.textColor)); 418 | } 419 | if('textSize' in yAxisArgs){ 420 | if(yAxisArgs.textSize > 0)YAxis.setTextSize(yAxisArgs.textSize); 421 | } 422 | if('gridColor' in yAxisArgs){ 423 | YAxis.setGridColor(resolveColor(yAxisArgs.gridColor)); 424 | } 425 | if('gridLineWidth' in yAxisArgs){ 426 | if(yAxisArgs.gridLineWidth > 0)YAxis.setGridLineWidth(yAxisArgs.gridLineWidth); 427 | } 428 | if('enableGridDashedLine' in yAxisArgs){ 429 | if(yAxisArgs.enableGridDashedLine.lineLength > 0 && yAxisArgs.enableGridDashedLine.spaceLength > 0 && yAxisArgs.enableGridDashedLine.phase > 0) 430 | YAxis.enableGridDashedLine(yAxisArgs.enableGridDashedLine.lineLength, yAxisArgs.enableGridDashedLine.spaceLength, yAxisArgs.enableGridDashedLine.phase); 431 | } 432 | if('position' in yAxisArgs){ 433 | YAxis.setPosition(YAxisPosition.valueOf(yAxisArgs.position)); 434 | } 435 | if('drawZeroLine' in yAxisArgs){ 436 | if(typeof yAxisArgs.drawZeroLine=="boolean")YAxis.setDrawZeroLine(yAxisArgs.drawZeroLine); 437 | } 438 | if('zeroLineWidth' in yAxisArgs){ 439 | if(yAxisArgs.zeroLineWidth > 0)YAxis.setZeroLineWidth(yAxisArgs.zeroLineWidth); 440 | } 441 | if('zeroLineColor' in yAxisArgs){ 442 | YAxis.setZeroLineColor(resolveColor(yAxisArgs.zeroLineColor)); 443 | } 444 | } 445 | //} 446 | 447 | } -------------------------------------------------------------------------------- /line-chart/line-chart.common.d.ts: -------------------------------------------------------------------------------- 1 | import { ILegend, LegendHorizontalAlignment, LegendVerticalAlignment, LegendForm } from "../components/legend"; 2 | import { XPosition, YPosition, Axis, XAxis, LeftYAxis, RightYAxis } from "../components/axes"; 3 | import { BaseChartSettings } from "../components/chart"; 4 | import { Dataset } from "../components/dataset"; 5 | import { View } from "ui/core/view"; 6 | import { Property } from "ui/core/dependency-observable"; 7 | export { ILegend, LegendHorizontalAlignment, LegendVerticalAlignment, LegendForm }; 8 | export { XPosition, YPosition, Axis, XAxis, LeftYAxis, RightYAxis }; 9 | export interface ILineChart { 10 | Legend?: ILegend; 11 | XAxis?: XAxis; 12 | LeftYAxis?: LeftYAxis; 13 | RightYAxis?: RightYAxis; 14 | BaseSettings?: BaseChartSettings; 15 | } 16 | export interface IPoint { 17 | x: number; 18 | y: number; 19 | } 20 | export interface ILineSeries extends Dataset { 21 | color?: string | number; 22 | lineData: Array; 23 | name: string; 24 | highLightColor?: string | number; 25 | drawHighlightIndicators?: boolean; 26 | highlightLineWidth?: number; 27 | fillColor?: string | number; 28 | fillAlpha?: number; 29 | drawFilled?: boolean; 30 | lineWidth?: number; 31 | circleRadius?: number; 32 | circleColor?: string | number; 33 | circleColorHole?: string | number; 34 | drawCircleHole?: boolean; 35 | enableDashedLine?: { 36 | lineLength: number; 37 | spaceLength: number; 38 | phase: number; 39 | }; 40 | } 41 | export declare class LineChartCommon extends View { 42 | protected lineChartArgs: ILineChart; 43 | static chartSettingsProperty: Property; 44 | static chartDataProperty: Property; 45 | chartSettings: ILineChart; 46 | chartData: Array; 47 | constructor(lineChartArgs: ILineChart); 48 | protected resolveColor(color: any): number; 49 | protected setDataset(dataset: any, lineData: any): void; 50 | } 51 | -------------------------------------------------------------------------------- /line-chart/line-chart.common.ts: -------------------------------------------------------------------------------- 1 | import { ILegend, LegendHorizontalAlignment, LegendVerticalAlignment, LegendForm } from "../components/legend"; 2 | import { XPosition, YPosition, Axis, XAxis, LeftYAxis, RightYAxis } from "../components/axes"; 3 | import { BaseChartSettings } from "../components/chart"; 4 | import { Dataset } from "../components/dataset"; 5 | import { resolveColor } from "../helper"; 6 | import { View } from "ui/core/view"; 7 | import { Observable } from "data/observable"; 8 | import { PropertyMetadata } from "ui/core/proxy"; 9 | import { Property, PropertyMetadataSettings } from "ui/core/dependency-observable"; 10 | 11 | var chartSettingsProperty = new Property( 12 | "settings", 13 | "LineChart", 14 | new PropertyMetadata(undefined, PropertyMetadataSettings.None) 15 | ); 16 | 17 | var chartDataProperty = new Property( 18 | "data", 19 | "LineChart", 20 | new PropertyMetadata(undefined, PropertyMetadataSettings.None) 21 | ); 22 | 23 | export {ILegend,LegendHorizontalAlignment,LegendVerticalAlignment,LegendForm} 24 | export {XPosition,YPosition,Axis,XAxis,LeftYAxis,RightYAxis} 25 | 26 | export interface ILineChart{ 27 | Legend?:ILegend, 28 | XAxis?:XAxis, 29 | LeftYAxis?:LeftYAxis, 30 | RightYAxis?:RightYAxis, 31 | BaseSettings?:BaseChartSettings 32 | 33 | } 34 | 35 | export interface IPoint{ 36 | x: number, 37 | y: number 38 | } 39 | 40 | export interface ILineSeries extends Dataset{ 41 | color?: string|number, 42 | lineData:Array, 43 | name:string, 44 | highLightColor?:string|number, 45 | drawHighlightIndicators?:boolean, 46 | highlightLineWidth?:number, 47 | fillColor?:string|number, 48 | fillAlpha?:number, 49 | drawFilled?:boolean, 50 | lineWidth?:number, 51 | circleRadius?:number, 52 | circleColor?:string|number, 53 | circleColorHole?:string|number, 54 | drawCircleHole?:boolean, 55 | enableDashedLine?:{ 56 | lineLength:number, spaceLength:number, phase:number 57 | } 58 | } 59 | 60 | var ArrayList = java.util.ArrayList; 61 | 62 | 63 | export class LineChartCommon extends View { 64 | public static chartSettingsProperty = chartSettingsProperty; 65 | public static chartDataProperty = chartDataProperty; 66 | 67 | 68 | 69 | get chartSettings(): ILineChart { 70 | return this._getValue(LineChartCommon.chartSettingsProperty); 71 | } 72 | set chartSettings(value: ILineChart) { 73 | //console.dump(value); 74 | //this.notify({eventName:"chartSettingsProperty",:value}); 75 | //this.notifyPropertyChange("chartSettingsProperty",value); 76 | 77 | this._setValue(LineChartCommon.chartSettingsProperty, value); 78 | //this.notify({ object: this, eventName: Observable.propertyChangeEvent, propertyName: chartSettingsProperty, value: value }); 79 | } 80 | 81 | get chartData(): Array { 82 | return this._getValue(LineChartCommon.chartDataProperty); 83 | } 84 | set chartData(value: Array) { 85 | //console.dump(value); 86 | //this.notifyPropertyChange("chartDataProperty",value); 87 | this._setValue(LineChartCommon.chartDataProperty, value); 88 | //this.notify({ object: this, eventName: Observable.propertyChangeEvent, propertyName: chartDataProperty, value: value }); 89 | } 90 | 91 | constructor(protected lineChartArgs:ILineChart) { 92 | super(); 93 | } 94 | protected resolveColor(color){ 95 | return resolveColor(color); 96 | } 97 | 98 | protected setDataset(dataset,lineData){ 99 | dataset.setColor(resolveColor(lineData.color)); 100 | if('valueTextColor' in lineData){ 101 | dataset.setValueTextColor(resolveColor(lineData.valueTextColor)); 102 | } 103 | if('valueTextColors' in lineData){ 104 | var colors = new ArrayList(); 105 | lineData.valueTextColors.forEach((item)=>{ 106 | colors.add(new java.lang.Integer(resolveColor(item))); 107 | }); 108 | dataset.setValueTextColors(colors); 109 | colors=null; 110 | } 111 | if('valueTextSize' in lineData){ 112 | if(lineData.valueTextSize>0) 113 | dataset.setValueTextSize(lineData.valueTextSize); 114 | } 115 | if('drawValues' in lineData){ 116 | if(typeof lineData.drawValues=="boolean") 117 | dataset.setDrawValues(lineData.drawValues); 118 | } 119 | if('highlightEnabled' in lineData){ 120 | if(typeof lineData.highlightEnabled=="boolean") 121 | dataset.setHighlightEnabled(lineData.highlightEnabled); 122 | } 123 | if('drawVerticalHighlightIndicator' in lineData){ 124 | if(typeof lineData.drawVerticalHighlightIndicator=="boolean") 125 | dataset.setDrawVerticalHighlightIndicator(lineData.drawVerticalHighlightIndicator); 126 | } 127 | if('drawHorizontalHighlightIndicator' in lineData){ 128 | if(typeof lineData.drawHorizontalHighlightIndicator=="boolean") 129 | dataset.setDrawHorizontalHighlightIndicator(lineData.drawHorizontalHighlightIndicator); 130 | } 131 | if('highLightColor' in lineData){ 132 | dataset.setHighLightColor(resolveColor(lineData.highLightColor)); 133 | } 134 | if('drawHighlightIndicators' in lineData){ 135 | if(typeof lineData.drawHighlightIndicators=="boolean") 136 | dataset.setDrawHighlightIndicators(lineData.drawHighlightIndicators); 137 | } 138 | if('highlightLineWidth' in lineData){ 139 | if(lineData.highlightLineWidth>0) 140 | dataset.setHighlightLineWidth(lineData.highlightLineWidth); 141 | } 142 | if('fillColor' in lineData){ 143 | dataset.setFillColor(resolveColor(lineData.fillColor)); 144 | } 145 | if('fillAlpha' in lineData){ 146 | if(lineData.fillAlpha <= 255 && lineData.fillAlpha >= 0){ 147 | dataset.setFillAlpha(lineData.fillAlpha); 148 | } 149 | } 150 | if('drawFilled' in lineData){ 151 | if(typeof lineData.drawFilled=="boolean") 152 | dataset.setDrawFilled(lineData.drawFilled); 153 | } 154 | if('lineWidth' in lineData){ 155 | if(lineData.lineWidth>0) 156 | dataset.setLineWidth(lineData.lineWidth); 157 | } 158 | if('circleRadius' in lineData){ 159 | if(lineData.circleRadius>0) 160 | dataset.setCircleRadius(lineData.circleRadius); 161 | } 162 | if('circleColor' in lineData){ 163 | dataset.setCircleColor(resolveColor(lineData.circleColor)); 164 | } 165 | if('circleColorHole' in lineData){ 166 | dataset.setCircleColorHole(resolveColor(lineData.circleColorHole)); 167 | } 168 | if('drawCircleHole' in lineData){ 169 | if(typeof lineData.drawCircleHole=="boolean") 170 | dataset.setDrawCircleHole(lineData.drawCircleHole); 171 | } 172 | if('enableDashedLine' in lineData){ 173 | if(lineData.enableDashedLine.lineLength>0 && lineData.enableDashedLine.spaceLength>0 && lineData.enableDashedLine.phase>0) 174 | dataset.enableDashedLine(lineData.enableDashedLine.lineLength, lineData.enableDashedLine.spaceLength, lineData.enableDashedLine.phase); 175 | } 176 | 177 | } 178 | 179 | } -------------------------------------------------------------------------------- /line-chart/package.json: -------------------------------------------------------------------------------- 1 | { "name" : "line-chart", 2 | "main" : "line-chart", 3 | "typings":"index.d.ts" } 4 | -------------------------------------------------------------------------------- /nativescript-charts.android.d.ts: -------------------------------------------------------------------------------- 1 | import { Common } from "./nativescript-charts.common"; 2 | export declare class NativescriptCharts extends Common { 3 | constructor(); 4 | } 5 | -------------------------------------------------------------------------------- /nativescript-charts.android.ts: -------------------------------------------------------------------------------- 1 | import {Common} from "./nativescript-charts.common"; 2 | import appModule = require("application"); 3 | import fs = require("file-system"); 4 | 5 | declare var com:any; 6 | 7 | export class NativescriptCharts extends Common { 8 | constructor() { 9 | super(); 10 | //this.message = Utils.SUCCESS_MSG(); 11 | if (typeof(com.github.mikephil.charting) === "undefined") { 12 | console.log("error"); 13 | }else{ 14 | console.log("OK"); 15 | } 16 | 17 | } 18 | } -------------------------------------------------------------------------------- /nativescript-charts.common.d.ts: -------------------------------------------------------------------------------- 1 | export declare class Common { 2 | message: string; 3 | constructor(); 4 | } 5 | export declare class Utils { 6 | static SUCCESS_MSG(): string; 7 | } 8 | -------------------------------------------------------------------------------- /nativescript-charts.common.ts: -------------------------------------------------------------------------------- 1 | import * as app from "application"; 2 | import * as dialogs from "ui/dialogs"; 3 | 4 | export class Common { 5 | public message: string; 6 | 7 | constructor() { 8 | this.message = Utils.SUCCESS_MSG(); 9 | } 10 | } 11 | 12 | export class Utils { 13 | public static SUCCESS_MSG(): string { 14 | let msg = `Your plugin is working on ${app.android ? "Android" : "iOS"}.`; 15 | 16 | 17 | return msg; 18 | } 19 | } 20 | 21 | -------------------------------------------------------------------------------- /nativescript-charts.ios.d.ts: -------------------------------------------------------------------------------- 1 | import { Common } from "./nativescript-charts.common"; 2 | export declare class NativescriptCharts extends Common { 3 | } 4 | -------------------------------------------------------------------------------- /nativescript-charts.ios.ts: -------------------------------------------------------------------------------- 1 | import {Common} from "./nativescript-charts.common"; 2 | 3 | export class NativescriptCharts extends Common { 4 | 5 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nativescript-charts", 3 | "version": "0.0.7", 4 | "description": "Chart plugin for Nativescript.", 5 | "main": "nativescript-charts.js", 6 | "typings": "index.d.ts", 7 | "nativescript": { 8 | "platforms": { 9 | "android": "2.4.0" 10 | } 11 | }, 12 | "scripts": { 13 | "build": "tsc", 14 | "demo.ios": "npm run preparedemo && cd demo && tns emulate ios", 15 | "demo.ios.device": "npm run preparedemo && cd demo && tns run ios", 16 | "demo.android": "npm run preparedemo && cd demo && tns run android", 17 | "preparedemo": "npm run build && cd demo && tns plugin remove nativescript-nativescript-charts && tns plugin add .. && tns install", 18 | "setup": "npm i && cd demo && npm i && cd .. && npm run build && cd demo && tns plugin add .. && cd ..", 19 | "postclone": "npm i && node scripts/postclone.js", 20 | "rebuild": "tsc && cd demo && tns plugin remove nativescript-charts && tns plugin add .. && tns platform clean android && tns run android", 21 | "run.android": "cd demo && tns run android" 22 | }, 23 | "repository": { 24 | "type": "git", 25 | "url": "git+https://github.com/markosko/nativescript-charts.git" 26 | }, 27 | "keywords": [ 28 | "NativeScript", 29 | "JavaScript", 30 | "Android", 31 | "nativescript-charts", 32 | "charts" 33 | ], 34 | "author": "Marek Maszay ", 35 | "bugs": { 36 | "url": "https://github.com/markosko/nativescript-charts/issues" 37 | }, 38 | "license": { 39 | "type": "MIT", 40 | "url": "https://github.com/markosko/nativescript-charts/blob/master/LICENSE" 41 | }, 42 | "homepage": "https://github.com/markosko/nativescript-charts", 43 | "devDependencies": { 44 | "tns-core-modules": "^2.2.1", 45 | "tns-platform-declarations": "^2.2.0", 46 | "typescript": "^1.8.10", 47 | "prompt": "^1.0.0", 48 | "rimraf": "^2.5.0" 49 | }, 50 | "_shasum": "37ad381b1ed77de29d59ce39fba540e38cc91d6d", 51 | "_from": "..", 52 | "_resolved": "file:.." 53 | } 54 | -------------------------------------------------------------------------------- /platforms/android/include.gradle: -------------------------------------------------------------------------------- 1 | android { 2 | productFlavors { 3 | "nativescriptscharts" { 4 | dimension "nativescriptscharts" 5 | } 6 | } 7 | } 8 | 9 | allprojects { 10 | repositories { 11 | maven { url "https://jitpack.io" } 12 | } 13 | } 14 | 15 | dependencies { 16 | compile 'com.github.PhilJay:MPAndroidChart:v3.0.1@aar' 17 | } -------------------------------------------------------------------------------- /references.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// -------------------------------------------------------------------------------- /scripts/postclone.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var prompt = require('prompt'); 3 | var rimraf = require('rimraf'); 4 | var exec = require('child_process').exec; 5 | 6 | var plugin_name, 7 | class_name, 8 | github_username, 9 | seed_plugin_name = "yourplugin", 10 | seed_class_name = "YourPlugin", 11 | seed_demo_property_name = "yourPlugin", 12 | seed_github_username = "YourName", 13 | demo_folder = "demo", 14 | init_git; 15 | 16 | console.log('NativeScript Plugin Seed Configuration'); 17 | prompt.start(); 18 | askGithubUsername(); 19 | 20 | function askGithubUsername() { 21 | prompt.get({ 22 | name: 'github_username', 23 | description: 'What is your GitHub username (used for updating package.json)? Example: NathanWalker / EddyVerbruggen' 24 | }, function (err, result) { 25 | if (err) { 26 | return console.log(err); 27 | } 28 | if (!result.github_username) { 29 | return console.log("Dude, the GitHub username is mandatory!"); 30 | } 31 | github_username = result.github_username; 32 | askPluginName(); 33 | }); 34 | } 35 | 36 | function askPluginName() { 37 | prompt.get({ 38 | name: 'plugin_name', 39 | description: 'What will be the name of your plugin? Use lowercase characters and dashes only. Example: yourplugin / google-maps / bluetooth' 40 | }, function (err, result) { 41 | if (err) { 42 | return console.log(err); 43 | } 44 | if (!result.plugin_name) { 45 | return console.log("Dude, the plugin name is mandatory!"); 46 | } 47 | plugin_name = result.plugin_name; 48 | generateClassName(); 49 | }); 50 | } 51 | 52 | function generateClassName() { 53 | // the classname becomes 'GoogleMaps' when plugin_name is 'google_maps' 54 | class_name = ""; 55 | var plugin_name_parts = plugin_name.split("-"); 56 | for (var p in plugin_name_parts) { 57 | var part = plugin_name_parts[p]; 58 | class_name += (part[0].toUpperCase() + part.substr(1)); 59 | } 60 | console.log('Using ' + class_name + ' as the TypeScript Class name..'); 61 | renameFiles(); 62 | } 63 | 64 | function renameFiles() { 65 | console.log('Will now rename some files..'); 66 | var files = fs.readdirSync("."); 67 | for (var f in files) { 68 | var file = files[f]; 69 | if (file.indexOf(seed_plugin_name) === 0) { 70 | var newName = plugin_name + file.substr(file.indexOf(".")); 71 | fs.renameSync(file, newName); 72 | } 73 | } 74 | 75 | adjustScripts(); 76 | } 77 | 78 | function adjustScripts() { 79 | console.log('Adjusting scripts..'); 80 | 81 | // add all files in the root 82 | var files = fs.readdirSync("."); 83 | 84 | // add demo's package.json 85 | files.push(demo_folder + "/package.json"); 86 | 87 | // add the demo files 88 | var demoFiles = fs.readdirSync(demo_folder + "/app/"); 89 | for (var d in demoFiles) { 90 | var demoFile = demoFiles[d]; 91 | files.push(demo_folder + "/app/" + demoFile); 92 | } 93 | 94 | // prepare and cache a few Regexp thingies 95 | var regexp_seed_plugin_name = new RegExp(seed_plugin_name, "g"); 96 | var regexp_seed_class_name = new RegExp(seed_class_name, "g"); 97 | var regexp_seed_demo_property_name = new RegExp(seed_demo_property_name, "g"); 98 | var regexp_seed_github_username = new RegExp(seed_github_username, "g"); 99 | 100 | for (var f in files) { 101 | var file = files[f]; 102 | if (file.indexOf(".") > 0) { 103 | var contents = fs.readFileSync(file, 'utf8'); 104 | var result = contents.replace(regexp_seed_plugin_name, plugin_name); 105 | result = result.replace(regexp_seed_class_name, class_name); 106 | result = result.replace(regexp_seed_demo_property_name, class_name[0].toLowerCase() + class_name.substr(1)); 107 | result = result.replace(regexp_seed_github_username, github_username); 108 | fs.writeFileSync(file, result); 109 | } 110 | } 111 | 112 | initGit(); 113 | } 114 | 115 | function initGit() { 116 | prompt.get({ 117 | name: 'init_git', 118 | description: 'Do you want to init a fresh local git project? If you previously \'git clone\'d this repo that would be wise (y/n)', 119 | default: 'y' 120 | }, function (err, result) { 121 | if (err) { 122 | return console.log(err); 123 | } 124 | if (result.init_git && result.init_git.toLowerCase() === 'y') { 125 | rimraf.sync('.git'); 126 | exec('git init -q .', function(err, stdout, stderr) { 127 | if (err) { 128 | console.log(err); 129 | } else { 130 | exec("git add '*' '.*'", function(err, stdout, stderr) { 131 | if (err) { 132 | console.log(err); 133 | } 134 | }); 135 | } 136 | }); 137 | } 138 | console.log("Configuration finished! If you're not happy with the result please clone the seed again and rerun this script."); 139 | console.log("You can now run 'npm run setup' and start cracking!"); 140 | }); 141 | } -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "removeComments": true, 6 | "experimentalDecorators": true, 7 | "noEmitHelpers": true, 8 | "declaration": true 9 | }, 10 | "files": [ 11 | "node_modules/tns-core-modules/tns-core-modules.d.ts", 12 | "node_modules/tns-platform-declarations/tns-core-modules/android17.d.ts", 13 | "node_modules/tns-platform-declarations/tns-core-modules/ios.d.ts", 14 | "node_modules/tns-platform-declarations/tns-core-modules/org.nativescript.widgets.d.ts", 15 | "nativescript-charts.common.ts", 16 | "nativescript-charts.android.ts", 17 | "nativescript-charts.ios.ts", 18 | "line-chart/line-chart.android.ts" 19 | 20 | ], 21 | "compileOnSave": true, 22 | "include":[ 23 | "components/**/*", 24 | "line-chart/**/*" 25 | ] 26 | } --------------------------------------------------------------------------------