2.242.0 • Published 5 days ago

@barchart/chart-lib v2.242.0

Weekly downloads
91
License
UNLICENSED
Repository
-
Last release
5 days ago

Barchart HTML5 chart SDK

The contents of the package

The archive contains the following files:

  1. barchart.chart.js - the chart component you're integrating into your product(s)
  2. barchart.chart.d.ts - TypeScript declaration file for the library; please note that this is useful for both TypeScript and JavaScript projects
  3. index.html - a web page hosting a single chart; please note that you may host many charts inside a single page, we've tested dozens of charts shown simultaneously
  4. index.js - the script needed to add a chart to the page using a custom data feed (complete implementation is provided) for demonstration purposes; in practice, the feed is provided by Barchart and using the chart requires only a few lines of code
  5. style.css - a simple CSS for styling some elements of the UI using a dark theme
  6. chart.def.json - a default chart definition (its state) with one symbol plot and the volume study using a dark theme
  7. AMZN_Daily.json - a snapshot of Amazon's daily data for demonstration purposes
  8. AMZN_Events.json - a snapshot of Amazon's events data for demonstration purposes
  9. package.json - an npm package definition

How to run the example

Please note that because the timeseries data is loaded using JavaScript fetch functionality, the web page must be served using a web server (in other words, you can't just open index.html from the local filesystem). You could use a very mature and popular one that we like on NPM. Assuming you've decompressed the SDK into the chart-lib folder, simply go into the chart-lib folder and run serve .. By default, the server will serve the index.html on a port 5000. In order to keep the example running, please contact Barchart and obtain an API key, which should replace the <YOUR_API_KEY> in the index.js.

Browser support

In order to keep the chart component's size reasonably small, we have built the component for the last EcmaScript (JavaScript) standard. The last 2 versions of all major browsers support this standard, so you will need a modern browser to use the component.

Please note that the component can be made to support older browsers (for example IE 11, we have not tested older versions) at the expense of its size which typically grows significantly for very old browsers.

Using the library with npm

While the example code (index.html and related files) is complete and works, it does not show a modern JavaScript development scenario - it's more akin to a traditional approach where you'd reference the library in your HTML, then use the resources from the Barchart "namespace" in your scripts.

However, this is just one and definitely not the only way of using the library. If you would like to reference and build the library with your code and you are using npm - which practically all modern approaches do - and any of the modern bundlers (Webpack, Rollup, Parcel or Vite) and transpilers like Babel, then please do one of the two:

  1. If you have network access, install our library from npm as usual, that is to say npm i @barchart/chart-lib or yarn add @barchart/chart-lib
  2. If you don't have network access, you may install the package directly from this very archive (no need to decompress) by running npm i /path/to/chart-lib.tgz or yarn add file:/path/to/chart-lib.tgz

You are now able to import any of the functions/classes/constants the chart library exports; these are all documented in the above mentioned TypeScript declaration file. Our module name is @barchart/chart-lib.

The chart component is framework-agnostic and works equally well with any modern JS framework as well as with no framework at all.

Where to find more information

The chart component/SDK does not ship with any form of UI. The API the chart responds to is documented here. We're busy at work making the docs clearer and easier to use, please check back often.

We do have a product - called widget - which includes the UI. A UI builder producing the small snippet of the HTML needed to get the widget on your page can be seen at the widget site. The very same widget powers our demo site. The widget is written using Barchart's cutting edge (proprietary) library which produces Web Components, helping keep the package size small and efficient.

Please note that we're using the component as-is in many of Barchart's products. The component is in production since 2016 and is battle tested across several different scenarios - both page based and SPA based. We're happy to help you integrate the component into your product(s).

2.242.0

5 days ago

2.241.1

6 days ago

2.241.2

5 days ago

2.240.0

7 days ago

2.241.0

7 days ago

2.239.0

8 days ago

2.238.0

12 days ago

2.237.0

13 days ago

2.236.0

14 days ago

2.235.2

15 days ago

2.235.1

23 days ago

2.235.0

1 month ago

2.234.1

2 months ago

2.233.1

2 months ago

2.234.0

2 months ago

2.233.0

2 months ago

2.232.0

2 months ago

2.231.1

2 months ago

2.231.2

2 months ago

2.231.0

3 months ago

2.230.2

3 months ago

2.230.1

3 months ago

2.230.0

3 months ago

2.229.0

3 months ago

2.228.4

3 months ago

2.228.3

3 months ago

2.228.2

3 months ago

2.228.1

3 months ago

2.228.0

3 months ago

2.227.0

3 months ago

2.226.0

3 months ago

2.225.0

3 months ago

2.224.0

4 months ago

2.223.0

4 months ago

2.222.1

4 months ago

2.222.2

4 months ago

2.221.0

4 months ago

2.221.2

4 months ago

2.221.1

4 months ago

2.221.3

4 months ago

2.222.0

4 months ago

2.220.2

4 months ago

2.220.1

4 months ago

2.220.0

4 months ago

2.219.0

5 months ago

2.218.0

5 months ago

2.217.5

5 months ago

2.217.4

5 months ago

2.217.3

5 months ago

2.217.2

5 months ago

2.217.1

5 months ago

2.217.0

5 months ago

2.216.2

5 months ago

2.216.1

5 months ago

2.216.0

5 months ago

2.215.4

6 months ago

2.215.3

6 months ago

2.214.0

6 months ago

2.214.2

6 months ago

2.214.1

6 months ago

2.213.6

6 months ago

2.213.3

6 months ago

2.213.4

6 months ago

2.215.1

6 months ago

2.215.0

6 months ago

2.215.2

6 months ago

2.188.2

11 months ago

2.202.0

8 months ago

2.206.0

7 months ago

2.210.0

7 months ago

2.196.0

10 months ago

2.192.0

10 months ago

2.203.5

8 months ago

2.201.1

9 months ago

2.201.2

9 months ago

2.201.0

9 months ago

2.205.1

7 months ago

2.201.3

8 months ago

2.205.0

8 months ago

2.199.5

9 months ago

2.199.6

9 months ago

2.199.1

10 months ago

2.199.2

10 months ago

2.199.3

9 months ago

2.213.1

6 months ago

2.213.0

6 months ago

2.199.0

10 months ago

2.191.1

10 months ago

2.213.2

6 months ago

2.191.2

10 months ago

2.191.3

10 months ago

2.195.0

10 months ago

2.191.0

10 months ago

2.200.0

9 months ago

2.204.0

8 months ago

2.212.0

7 months ago

2.212.2

6 months ago

2.198.0

10 months ago

2.212.1

6 months ago

2.212.3

6 months ago

2.194.0

10 months ago

2.190.0

11 months ago

2.209.0

7 months ago

2.190.1

10 months ago

2.189.0

11 months ago

2.203.0

8 months ago

2.203.3

8 months ago

2.207.0

7 months ago

2.203.4

8 months ago

2.203.1

8 months ago

2.203.2

8 months ago

2.211.1

7 months ago

2.211.0

7 months ago

2.193.0

10 months ago

2.208.0

7 months ago

2.208.1

7 months ago

2.188.1

11 months ago

2.188.0

11 months ago

2.186.0

11 months ago

2.186.1

11 months ago

2.185.8

11 months ago

2.187.2

11 months ago

2.187.3

11 months ago

2.185.7

12 months ago

2.187.0

11 months ago

2.187.1

11 months ago

2.185.4

12 months ago

2.185.5

12 months ago

2.185.6

12 months ago

2.185.0

1 year ago

2.185.1

1 year ago

2.185.2

1 year ago

2.185.3

12 months ago

2.183.10

1 year ago

2.183.11

1 year ago

2.184.5

1 year ago

2.183.7

1 year ago

2.183.9

1 year ago

2.184.1

1 year ago

2.184.2

1 year ago

2.184.3

1 year ago

2.184.4

1 year ago

2.184.0

1 year ago

2.183.6

1 year ago

2.183.2

1 year ago

2.183.3

1 year ago

2.183.4

1 year ago

2.183.5

1 year ago

2.106.1

3 years ago

2.81.1

3 years ago

2.81.0

3 years ago

2.80.1

3 years ago

2.79.0

3 years ago

2.78.0

3 years ago

2.77.0

3 years ago

2.74.1

3 years ago

2.72.2

4 years ago

2.72.1

4 years ago

2.72.0

4 years ago

2.68.0

4 years ago

2.63.1

4 years ago

2.62.3

4 years ago

2.62.1

4 years ago

2.60.4

4 years ago

2.60.2

4 years ago

2.59.0

4 years ago

2.58.13

4 years ago

2.58.12

4 years ago

2.58.8

4 years ago

2.57.4

4 years ago

2.56.3

4 years ago

2.54.3

4 years ago

2.54.2

4 years ago

2.53.9

4 years ago