• Stars
    star
    133
  • Rank 263,165 (Top 6 %)
  • Language
    Swift
  • License
    Apache License 2.0
  • Created over 4 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

iOS LightweightCharts

Version License Platform

The iOS LightweightCharts is an iOS wrapper of the TradingView Lightweight Charts library.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • iOS 10.0+

Installation

LightweightCharts is available through CocoaPods. To install it, just simply add the following line to your Podfile:

pod 'LightweightCharts', '~> 3.8.0'

Usage

import LightweightCharts

Create instance of LightweightCharts, which is a subclass of UIView, and add it to your view.

var chart: LightweightCharts!

// ...
chart = LightweightCharts()
view.addSubview(chart)
// ... setup layout

Add any series to the chart and store a reference to it.

var series: BarSeries!

// ...
series = chart.addBarSeries(options: nil)

Add data to the series.

let data = [
    BarData(time: .string("2018-10-19"), open: 180.34, high: 180.99, low: 178.57, close: 179.85),
    BarData(time: .string("2018-10-22"), open: 180.82, high: 181.40, low: 177.56, close: 178.75),
    BarData(time: .string("2018-10-23"), open: 175.77, high: 179.49, low: 175.44, close: 178.53),
    BarData(time: .string("2018-10-24"), open: 178.58, high: 182.37, low: 176.31, close: 176.97),
    BarData(time: .string("2018-10-25"), open: 177.52, high: 180.50, low: 176.83, close: 179.07)
]

// ...
series.setData(data: data)

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License. You may obtain a copy of the License at LICENSE file. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

This software incorporates several parts of tslib (https://github.com/Microsoft/tslib, (c) Microsoft Corporation) that are covered by the Apache License, Version 2.0.

This license requires specifying TradingView as the product creator. You shall add the "attribution notice" from the NOTICE file and a link to https://www.tradingview.com/ to the page of your website or mobile application that is available to your users. As thanks for creating this product, we'd be grateful if you add it in a prominent place.

More Repositories

1

lightweight-charts

Performant financial charts built with HTML5 canvas
TypeScript
8,167
star
2

charting-library-examples

Examples of Charting Library integrations with other libraries, frameworks and data transports
Ruby
1,279
star
3

charting-library-tutorial

This tutorial explains step by step how to connect your data to the Charting Library
JavaScript
392
star
4

awesome-tradingview

🎉 A curated list of awesome things related to TradingView (widgets, charting library, lightweight-charts, etc)
312
star
5

webpack-uglify-parallel

Identical to standard uglify webpack plugin, with an option to build multiple files in parallel
JavaScript
144
star
6

lightweight-charts-android

Android wrapper for lightweight-charts library
Kotlin
95
star
7

saveload_backend

Python
91
star
8

tradingview.github.io

Featuresets Map
HTML
64
star
9

fancy-canvas

TypeScript
33
star
10

documentation-guidelines

Documentation Guidelines
12
star
11

rest_integrations_docs

Python
7
star
12

s3-groundskeeper

TypeScript
6
star
13

retry-ensure-webpack-plugin

Webpack plugin for retrying async chunk loading
TypeScript
6
star
14

css-file-rules-webpack-separator

JavaScript
4
star
15

scanner_data

JavaScript
4
star
16

svgasset

Client side inline SVG library and backend building tool
JavaScript
2
star
17

dynamic-dual-import-webpack-plugin

Dual import (js chunk + css chunk) for dynamic import and require.ensure
JavaScript
2
star
18

msixty

C++
2
star
19

tv-polyfill

JavaScript
2
star
20

tv-webpack-svg-loader

JavaScript
1
star
21

broker-integration-manual

Documentation for brokers
JavaScript
1
star
22

study_repo_data

1
star
23

scanner-check

1
star
24

tv-pylint-translations-rule

Python
1
star