Giter Club home page Giter Club logo

qognicafinance-react-lightweight-charts's People

Contributors

aurelreb avatar axdra avatar benjaminchevoor avatar jtdaugh avatar mfbz avatar nemani avatar silvercondor avatar simondamberg avatar yoeven avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qognicafinance-react-lightweight-charts's Issues

How to add priceFormat?

I dont know how to add priceFormat in wrappet, in js library is ->

const candleSeries = chart.addCandlestickSeries({
  priceFormat: {
    type: "price",
    minMove: Math.pow(10, -precision),
    precision: precision,
  },
});

Release first version

  • Figure out how to publish to NPM
  • Add install instructions to readme
  • Add embeded images from NPM

CHART UPDATE

How do i update the chart with new data from API?

Background layout color ERROR

Describe the bug
I have problem when I want to change background layout color. Exist only white color and the code doesn't change with another color.

To Reproduce
Try change background layout color and you will see

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

React 18 support

Describe the bug
There's a peerDependency on react ^17

To Reproduce
Install on a react 18 project

Expected behavior
Ideally we can use this library with React 18

How do I use fitcontent() in this library?

You want all the cans to be visible on one screen based on the x-axis.
I used fitContent() as follows, but it doesn't work.
What should I do?

스크린샷 2022-10-06 오후 6 42 49

<Chart
        options={options}
        candlestickSeries={[{ data: candleSeries }]}
        autoWidth
        height={380}
        onCrosshairMove={handleCrosshairMoved}
        chartRef={(chart) => {
	        chart.timeScale().fitContent();
        }}
/>

and more There is Korean on the marker, can I change it to English?

y-axis issue for status update when axisPressedMouseMove is enabled

Describe the bug

React code that distributes data for multiple coins to the chart.
With the AxisPressedMouseMove option enabled, if you change the status and insert new data into the chart, the y-axis remains the same as the y-axis value of the previous data.


To Reproduce

https://github.com/perifinance/peri.dex/blob/main/src/screens/Chart/LWchart.tsx

This is the code that contains the entire contents.
The content was too large to be included in codepen.


Expected behavior

As new data enters the chart during status update, the y-axis also changes to suit its status volume


Screenshots

  1. Pre-Update Chart
    스크린샷 2022-10-11 오후 7 41 38

  2. Chart after update
    스크린샷 2022-10-11 오후 7 43 40

If you zoom in or out on the y-axis, you can see that the data is in.


Additional context

If only AxisPressedMouseMove is false in the code, the issue will occur

addCandlestickSeries custom type formatter issue

Describe the bug

The decimal fraction of the values in the chart corresponding to the y-axis is not regular.
ex) 1.4200, 1.32, 1.2200 ...

This is a formatter that applies logic that cuts the decimal point. We checked that the input and output values are output normally.

However, the priceFormat function within the addCandlestickSeries indicates an irregular decimal length.


To Reproduce

// LWchart.tsx

<Chart
  options={options}
  candlestickSeries={[{ data: chart }]}
  autoWidth
  height={380}
  onCrosshairMove={(param) => handleCrosshairMoved(param, chart[chart.length - 1])}
  chartRef={(chart) => {
  chart.timeScale().fitContent();
  // chart.timeScale().scrollToPosition(2, true);
  chart.addCandlestickSeries({
	  priceFormat: {
		  type: "custom",
		  formatter: (priceValue) => {
			  return decimalSplit(priceValue);
		  },
		  minMove: 0.0000000001,
	  },
  });
  }}
/>

// decimalSplit.ts
export const decimalSplit = (value: string | number) => {
	// return value;

	if (!value) return "0";
	const splitStr = String(value).split(".");
	if (!splitStr[1]) return splitStr[0];

	if (Number(splitStr[0]) > 10) {
		return `${splitStr[0]}.${splitStr[1].slice(0, 2)}`;
	} else if (Number(splitStr[0]) > 0) {
		return `${splitStr[0]}.${splitStr[1].slice(0, 4)}`;
	} else {
		return `${splitStr[0]}.${splitStr[1].slice(0, 8)}`;
	}
};

Github code => https://github.com/perifinance/peri.dex/blob/main/src/screens/Chart/LWchart.tsx


Expected behavior

The values on the y-axis must be numbers of regular length


Screenshots
스크린샷 2022-10-11 오후 8 00 57


Additional context

There was no problem with the input output value through the logic I made myself.
An issue occurs in the view group only through priceFormat.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.