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

add paneSize getter to IChartApi #1411

Merged
merged 3 commits into from
Sep 19, 2023
Merged

add paneSize getter to IChartApi #1411

merged 3 commits into from
Sep 19, 2023

Conversation

SlicedSilver
Copy link
Contributor

Type of PR: enhancement

PR checklist:

  • N/A Addresses an existing issue
  • Includes tests
  • Documentation update

Overview of change:

Adds a paneSize method to the IChartApi which returns the dimensions of the chart pane (the area excluding the time and price scales) where the actual series rendering takes place.

This is useful for Plugin development because there isn't an easy way to determine the pane height from the API, and you typically need to either use some getBoundingClientRect call, or get the height within the renderer scope.

@SlicedSilver SlicedSilver added the polish Very minor behavior improvement that users will enjoy. label Aug 23, 2023
@SlicedSilver SlicedSilver self-assigned this Aug 23, 2023
@edew edew self-requested a review August 25, 2023 13:20
@edew
Copy link
Contributor

edew commented Aug 25, 2023

The d.ts changes are expected

+/**
+ * Dimensions of the Chart Pane
+ * (the main chart area which excludes the time and price scales).
+ */
+export interface PaneSize {
+       /** Height of the Chart Pane (pixels) */
+       height: number;
+       /** Width of the Chart Pane (pixels) */
+       width: number;
+}

edew
edew previously approved these changes Aug 25, 2023
@ghost
Copy link

ghost commented Sep 1, 2023

Any updates on this merging? This is a pre req to closing #1407 I think

@SlicedSilver
Copy link
Contributor Author

Any updates on this merging? This is a pre req to closing #1407 I think

@skdillon This is unrelated. This PR just adds a method for reading the paneSize. This isn't useful for any existing use cases and we are adding it for one of our upcoming features. (plugins support)

We do plan on merging this but it wouldn't solve your existing issue.

@edew edew self-requested a review September 19, 2023 09:45
@edew edew merged commit 10c183c into master Sep 19, 2023
21 of 22 checks passed
@edew edew deleted the pane-size-getter branch September 19, 2023 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
polish Very minor behavior improvement that users will enjoy.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants