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

overflowTop parameter behaviour & verticalLinesHeight #884

Closed
McFly78 opened this issue Oct 30, 2024 · 1 comment
Closed

overflowTop parameter behaviour & verticalLinesHeight #884

McFly78 opened this issue Oct 30, 2024 · 1 comment

Comments

@McFly78
Copy link

McFly78 commented Oct 30, 2024

Description

I'm working on a LineChart graph and I'm seeing some strange behaviour when I use the overflowTop parameter.
As you can see, if the value of this parameter is other than 0, the height of the vertical lines displayed using the parameter verticalLinesHeight is much higher than the area of the graph.

There is no issue for vertical lines displayed using the global parameter showVerticalLines.
However, as I would like to only display some verticals lines I can not use the global parameter showVerticalLines.

So I've tried using the verticalLinesHeight parameter to limit the height of the vertical lines, but this parameter doesn't seem to work for the vertical lines displayed using the showVerticalLine parameter.
The verticalLinesHeight parameter only seems to have an effect for vertical lines displayed with the global parameter showVerticalLines.

Is there something I am missing ?

With an overflowTop parameter other than 0 and whatever the value
image

Without overflowTop parameter
image

As a temporary workaround, in the renderSpecificVerticalLines function I added 30 to the y2 value of the SVG Line component -> y2= -xAxisThickness +30

Many thanks for your help

Steps to reproduce

<View style={{backgroundColor: '#1A3461', paddingTop:60}}>
    <LineChart
        data={
          [10, 10, 10, 10, 10, 10, 10, 50].map((v, index) => {
          
            const showVerticalLine= index%2 !=0 // To show only half of verticals lines
            
            return {
              value: v,
              showVerticalLine: showVerticalLine ? true : false,
              verticalLineColor: "red",
              verticalLineThickness:2
            }
        })
        }
        
        overflowTop={1}
  
        // Vertical lines configuration
        verticalLinesColor= "white"
        //verticalLinesHeight={180}
        showVerticalLines={true}
        
        // graph configuration
        height={180}
        spacing={40}
        hideRules
        hideYAxisText
        yAxisColor="white"
        xAxisColor="white"
        color="#0BA5A4"
        initialSpacing={0}
        backgroundColor='#1A3461'
    />
</View>

Snack or a link to a repository

No response

version of react-native-gifted-charts

1.4.46

React Native version

0.74.4

Platforms

iOS

Workflow

None

@Abhinandan-Kushwaha
Copy link
Owner

Hi @McFly78 Thanks for pointing out this issue.
It has been fixed from versions 1.4.48 onwards. Please use the latest version of the 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

2 participants