3.1.8 • Published 2 years ago

corefinancialwidgets v3.1.8

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

Financial Solutions

Render different type of graphics or items


WARNING: You need to have previously the node_modules folder before install the modules

( if you dont have the node_modules folder make a npm install)

Step 1. Installation of module

npm i corefinancialwidgets

Setep 2. Aditional (required)

npm i react-native-charts-wrapper

Usage

import * as React from 'react';
import {ParentComponent} from 'corefinancialwidgets';

export default function Widget1() {
  const rics = ['AMXL.MX', 'BIMBOA.MX', 'AAPL.MX', 'WALMEX.MX'];

  return (
    <ParentComponent
      type={'issuerParent'}
      rics={rics}
      onPress={item => {
        console.log(item.last);
        Alert.alert(
          'Event',
          `${
            item.last.commonName !== undefined
              ? `${item.last.commonName}`
              : item.last.cfname
          }`,
        );
      }}
      onBuy={item => {
        console.log(item.last);
        Alert.alert(
          'Buy event',
          `${
            item.last.commonName !== undefined
              ? `${item.last.commonName}`
              : item.last.cfname
          }`,
        );
      }}
      onSell={item => {
        console.log(item.last);
        Alert.alert(
          'SellEvent',
          `${
            item.last.commonName !== undefined
              ? `${item.last.commonName}`
              : item.last.cfname
          }`,
        );
      }}
      period={'intraday'}
    />
  );
}

Props

nametypevaluesdescriptionrequired
typestring"minichart", "issuerParent", "watchlistrender the different graphicsYes
ricsarraystring"AMXL.MX", "BIMBOA.MX", "AAPL.MX" (example values)rics in the array will use to render the componentsYes


Props Watchlist

nametypevaluesdescriptionrequired
onPressFunc eventFunction EventEvent for redirect activityNo
onBuyFunc eventFunction Eventanonymous function for Buy ButtonNo
onSellFunc eventFunction Eventanonymous function for Sell ButtonNo
positionsBooleantrue or falserender titles in watchlist componentNo
titlesintnumberNumbers of titles to render in watchlistNo
configurationarray object{ symbol : 'ALFAA.MX', positions : true , titles : 1}json object contains the configuration for every nodeNo

Examples

Issuer charts

Line chart

Candles chart

Watchlist

Watchlist Items


SETUP

iOS

( use cocoapods (suggested) )

  • Install the react-native-charts-wrapper
  • In <your_project>/ios/podfile file, add this line pod 'RNCharts', :path => '../node_modules/react-native-charts-wrapper'
  • cd ios && pod install
  • open <project_name>.xcworkspace
  • create a empty swift file, the xcode will prompt a message 'Would you like to configure an Objective-C bridging header?' to Create Bridging Header, accept it.

Errors

If the installation of the modules are not correct you can find with some errors

  • For the next error see the step 1