Forum Discussion

Dora's avatar
Dora
Helper I
8 years ago
Solved

Custom Visual Issue

Dear All,

 

I want to make a circular gauge ,I used following published code to make it

https://github.com/maqsoftware/PowerBI-visuals/tree/master/src/CustomVisuals/Published/CircularGauge

But I get following error" Cannot find name '_'."as in image .

I add the following 

npm install lodash --save

typings install dt~lodash --save

but still not working.

 

Please help since I am new to coding world.

 

Thank You In Advance,

Best Reagrds,

Dora

 

4 Replies

  • v-viig's avatar
    v-viig
    Community Champion

    Did you include a link to lodash.d.ts into tsconfig.json?

     

    Ignat Vilesov,

    Software Engineer

     

    Microsoft Power BI Custom Visuals

    [email protected]

    • Dora's avatar
      Dora
      Helper I

      Yes , I insatll the lodash from this:-npm install --save lodash @types/lodash,but cannot find the "lodash.d.ts" file.Now I get the error as follows.

      Best regards,

      Dora

       

      • Dora's avatar
        Dora
        Helper I
        solved it by adding following code to the loadsh.d.ts file
         
        import * as _ from 'lodash'

        declare global{
        var _:_.LoDashStatic & {
        remove<T, K extends keyof T>(
        object: T,
        key?: K,
        defaultValue?: T[K]
        ): T[K]
        getKeyByValue(object, value)
        mapIfDefined(array, func)
        mod(n, m)
        move(array, oldIndex, newIndex)
        pick<T, K extends keyof T>(obj: T, ...keys: K[]): Pick<T, K>
        }
        }
         
        Now I am getting following error
         
        Best Regards,
        Dora