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

PriceScale scaleMargins doesn't work #9

Closed
cjkoepke opened this issue May 26, 2023 · 6 comments
Closed

PriceScale scaleMargins doesn't work #9

cjkoepke opened this issue May 26, 2023 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@cjkoepke
Copy link

The PriceScale component does not update the actual price scale of the matching Series.

<Chart
            handleScale={{
              axisDoubleClickReset: true,
            }}
            timeScale={{
              timeVisible: true,
              fixLeftEdge: true,
              fixRightEdge: true,
              lockVisibleTimeRangeOnResize: true,
            }}
          >
<HistogramSeries
  priceScaleId="right"
  priceFormat={{
    type: "volume",
  }}
  data={volumeData ?? []}
/>
<PriceScale
  id="right"
  scaleMargins={{
    top: 0.8,
    bottom: 0
  }}
/>
</Chart>
@trash-and-fire
Copy link
Owner

looks like a bug. I'll see what could be the problem.

@trash-and-fire
Copy link
Owner

What version of react and lightweight-charts are you using?

@trash-and-fire
Copy link
Owner

Try using as workaround:

<Chart
    rightPriceScale: {
        scaleMargins={
            top: 0.8,
            bottom: 0
        }
    }
>

@trash-and-fire trash-and-fire self-assigned this May 28, 2023
@trash-and-fire trash-and-fire added the bug Something isn't working label May 28, 2023
@cjkoepke
Copy link
Author

I would try using the top-level default settings, but I have two charts and need them to have independent scale margins. My example was just for brevity as it doesn't seem to matter how many there are.

React: 18.2.0
Lightweight Charts: 4.0.1

@trash-and-fire
Copy link
Owner

Try using 1.3.3. There should be a fix.

@cjkoepke
Copy link
Author

Try using 1.3.3. There should be a fix.

This fixed the issue! Thanks for the quick response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants