Can't find variable: TKChartDelegate

4 posts, 2 answers
  1. Raúl
    Raúl avatar
    7 posts
    Member since:
    Jan 2017

    Posted 18 Jan Link to this post

    NativeScript version: 2.4.0
    iOS SDKs version: 10.1
    Version of UI for NativeScript: 1.5.1
    IDE: Visual Studio Code.

    Using angular 2.

    Using Iphone 7 on simulator.

    Hello, I only added the UI with npm i nativescript-telerik-ui-pro and tns plugin install nativescript-telerik-ui-pro

    Then I just import in my main module in declarations array:

    import { CHART_DIRECTIVES } from 'nativescript-telerik-ui-pro/chart/angular';

    And I'm getting this error:

    1   0x10ed005dc -[TNSRuntime executeModule:referredBy:]
    2   0x10ae00d02 main
    3   0x110d7868d start
    file:///app/tns_modules/nativescript-telerik-ui-pro/chart/chart.js:151:55: JS ERROR ReferenceError: Can't find variable: TKChartDelegate
    Jan 18 10:54:55 mba com.apple.CoreSimulator.SimDevice.BBBDDC7A-4EEC-4F8E-B6A9-B5C1534B0E30.launchd_sim[69718] (UIKitApplication:org.nativescript.bluedragonapp[0xf949][65367]): Service exited due to Segmentation fault: 11

     anyone know something about this issue?

     

  2. Answer
    nikolay.tsonev
    Admin
    nikolay.tsonev avatar
    220 posts

    Posted 19 Jan Link to this post

    Hi,

    I reviewed your problem, however was unable to reproduce this behavior on my side.

    As a solution, you could try to delete node_modules , platforms and hooks folders from the project.
    Clear npm cache, while using npm cache clear command, then try to rebuild the app with `tns run ios`.

    If this does not help, please build your app with tns run ios --log trace and send us the full log from the terminal.

    Regarding to the ticket, you could use only tns plugin add <plugin_name>`, while installing plugin. The tns command will save the plugin as a dependency in the project package.json file and will download the plugin in node_modules folder.


    Hope this helps

    Regards,
    nikolay.tsonev
    Telerik by Progress
    Did you know that you can open private support tickets which are reviewed and answered within 24h by the same team who built the components? This is available in our UI for NativeScript Pro + Support offering.
  3. Dipanjan
    Dipanjan avatar
    2 posts
    Member since:
    Jan 2017

    Posted 19 Jan Link to this post

    Thank you so much.

    The error is gone, the only thing is that I follow the get started guide in the docs to plot s simple graph, but the graph is not displayed.

    the only log I get is this:

    [Graphics] UIColor created with component values far outside the expected range. Set a breakpoint on UIColorBreakForOutOfRangeColorComponents to debug. This message will only be logged once.

  4. Answer
    nikolay.tsonev
    Admin
    nikolay.tsonev avatar
    220 posts

    Posted 20 Jan Link to this post

    Hi,

    Could you provide some code snippets or sample project, where the problem could be reproduced? We tried to reproduce this error, however the given information is not enough to investigate the problem further.

    For you help I am also providing sample code, where has been used LineSeries .

    app.module.ts
    ........
    import { CHART_DIRECTIVES } from 'nativescript-telerik-ui-pro/chart/angular';
     
    @NgModule({
        declarations: [AppComponent, CHART_DIRECTIVES],
        bootstrap: [AppComponent],
        imports: [NativeScriptModule],
        schemas: [NO_ERRORS_SCHEMA]
    })
    export class AppModule { }

    app.component.html
    <RadCartesianChart tkExampleTitle tkToggleNavButton>
        <CategoricalAxis tkCartesianHorizontalAxis></CategoricalAxis>
        <!-- >> chart-line-axis -->
        <LinearAxis tkCartesianVerticalAxis></LinearAxis>
        <!-- << chart-line-axis -->
        <LineSeries tkCartesianSeries [items]="categoricalSource" categoryProperty="Country" valueProperty="Amount"></LineSeries>
    </RadCartesianChart>

    app.component.ts

    import { Component } from "@angular/core";
    import {ObservableArray} from "data/observable-array"
     
     
    @Component({
        selector: "my-app",
        templateUrl: "app.component.html",
    })
    export class AppComponent {
           public categoricalSource: Array<any>;
       
        constructor() { }
       
        ngOnInit() {
            this.categoricalSource = [
                { Country: "Germany", Amount: 15, SecondVal: 14, ThirdVal: 24, Impact: 0, Year: 0 },
                { Country: "France", Amount: 13, SecondVal: 23, ThirdVal: 25, Impact: 0, Year: 0 },
                { Country: "Bulgaria", Amount: 24, SecondVal: 17, ThirdVal: 23, Impact: 0, Year: 0 },
                { Country: "Spain", Amount: 11, SecondVal: 19, ThirdVal: 24, Impact: 0, Year: 0 },
                { Country: "USA", Amount: 18, SecondVal: 8, ThirdVal: 21, Impact: 0, Year: 0 }
            ];
        }
     
    }


    Hope this helps.
    Regards,
    nikolay.tsonev
    Telerik by Progress
    Did you know that you can open private support tickets which are reviewed and answered within 24h by the same team who built the components? This is available in our UI for NativeScript Pro + Support offering.
Back to Top