Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create a market depth chart #181

Closed
longpq18 opened this issue Jun 28, 2018 · 4 comments
Closed

How to create a market depth chart #181

longpq18 opened this issue Jun 28, 2018 · 4 comments

Comments

@longpq18
Copy link

workspace 1_010

@JesperLekland
Copy link
Owner

JesperLekland commented Jun 28, 2018

Check out the examples repo for partial charts and gradient decorators.

@Sandeep200995
Copy link

The above example repo is empty please suggest any svg for Market Depth Chart (same as above image)in react native .

@JesperLekland
Copy link
Owner

My bad, link was broken. Fixed now 👍

@thanhvk
Copy link

thanhvk commented Feb 17, 2020

Recently I faced this challenge. I have resolved it by using the area chart.

<View style={{ height: 200 }}>
    <AreaChart
        style={{ flex: 1 }}
        data={ data }
        contentInset={{ top: 30, bottom: 30 }}
        svg={{
            fill: 'url(#bid-gradient)',
            clipPath: 'url(#clip-path-bid)',
        }}
        curve={ shape.curveStep }
        yAccessor={ ({ item }) => item.total }
        xAccessor={ ({ item }) => item.price }
        xScale={ scale.scaleLinear }
    >
        <BidGradient/>
        <Clips/>
    </AreaChart>

    <AreaChart
        style={ StyleSheet.absoluteFill }
        data={ data }
        contentInset={{ top: 30, bottom: 30 }}
        svg={{
            fill: 'url(#ask-gradient)',
            clipPath: 'url(#clip-path-ask)',
        }}
        curve={ shape.curveStep }
        yAccessor={ ({ item }) => item.total }
        xAccessor={ ({ item }) => item.price }
        xScale={ scale.scaleLinear }
    >
        <AskGradient/>
        <Clips/>
        <BidLine/>
        <AskLine/>
    </AreaChart>
</View>

Hope it will be helpful for someone who is looking a solution to create depth chart with react-native-svg-charts.
Thank you for the great library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants