Skip to content

Cannot run the chart using official documentation #57

@art1c0

Description

@art1c0

Hello, I am trying to run your beautiful chart using documentation here: https://pro.klinecharts.com/en-US/getting-started.html

I just want to run it in a browser using CDN without compiling it myself, so I use following code from the docs:

<!-- Import js -->
<script src="https://cdn.jsdelivr.net/@klinecharts/pro/dist/klinecharts-pro.umd.js"></script>

<!-- Import css -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/@klinecharts/pro/dist/klinecharts-pro.css"/>
<script>
  // Create Instance
  const chart = new klinechartspro.KLineChartPro({
    container: document.getElementById('container'),
    // Default symbol info
    symbol: {
      exchange: 'XNYS',
      market: 'stocks',
      name: 'Alibaba Group Holding Limited American Depositary Shares, each represents eight Ordinary Shares',
      shortName: 'BABA',
      ticker: 'BABA',
      priceCurrency: 'usd',
      type: 'ADRC',
    },
    // Default period
    period: { multiplier: 15, timespan: 'minute', text: '15m' },
    // The default data access is used here. If the default data is also used in actual use, you need to go to the https://polygon.io/ apply for API key
    datafeed: new klinechartspro.DefaultDatafeed(`${polygonIoApiKey}`)
  })
</script>

However the URLs to JS and CSS are not correct and return 404 error.
I found correct URLs:
JS https://cdn.jsdelivr.net/npm/@klinecharts/pro@0.1.1/dist/klinecharts-pro.umd.min.js
CSS https://cdn.jsdelivr.net/npm/@klinecharts/pro@0.1.1/dist/klinecharts-pro.min.css

But even after putting correct URLs I get following errors:

TypeError: undefined is not an object (evaluating '_.registerOverlay')
TypeError: undefined is not a constructor (evaluating 'new klinechartspro.DefaultDatafeed...

Apparently klinechartspro is an ampty object when checked in the console, so there are no klinechartspro.KLineChartPro and klinechartspro.DefaultDatafeed classes.

I also tried to use npm install method and used files from the dist folder - but get the same errors.

Please help me to run the example from your documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions