Skip to content

Fix graphs on new architecture with interop layer#1007

Open
MaxToyberman wants to merge 5 commits intowuxudong:masterfrom
MaxToyberman:master
Open

Fix graphs on new architecture with interop layer#1007
MaxToyberman wants to merge 5 commits intowuxudong:masterfrom
MaxToyberman:master

Conversation

@MaxToyberman
Copy link
Copy Markdown

No description provided.

@NikldjOne
Copy link
Copy Markdown

BarChart don't working, LineChart work

@NikldjOne
Copy link
Copy Markdown

NikldjOne commented Dec 28, 2024

added in node_modules/react-native-charts-wrapper/ios/ReactNativeCharts/bar/RNBarChartView.swift

   override func layoutSubviews() {
        super.layoutSubviews()
        _chart.frame = self.bounds // Adjust the chart's frame to fill the entire component's bounds
    }

It's work for me, for BarChart

@HasanElfalt
Copy link
Copy Markdown

HasanElfalt commented Dec 30, 2024

we need to add these lines to each chart kind (Line, bar, pie... etc)
I am using this Repo for the Line and Pie chart, and after adding these lines to the line and pie chart, it works well

override func layoutSubviews() {
        super.layoutSubviews()
        _chart.frame = self.bounds // Adjust the chart's frame to fill the entire component's bounds
}

@longprao
Copy link
Copy Markdown

Can someone merge this please? confirmed this PR works with the latest RN and Expo

@urvish-procare
Copy link
Copy Markdown

This is just for iOS. we are facing issue of Warning: TypeError: Cannot read property 'bubblingEventTypes' of null in Android. so do you have any idea on it. @MaxToyberman

@ferrannp
Copy link
Copy Markdown
Contributor

ferrannp commented Nov 29, 2025

What also stopped working is this for cleaning highlights:

chartRef.current.highlights([])

Had to fix it by:

    func _highlights(_ reactTag: NSNumber, config: NSArray) {
        _bridge?.uiManager.addUIBlock { (uiManager: RCTUIManager?, _) in
            guard let view = uiManager?.view(forReactTag: reactTag) as? RNBarLineChartViewBase,
                  let barLineChart = view.chart as? BarLineChartViewBase
            else {
                return
            }

            barLineChart.highlightValues(HighlightUtils.getHighlights(config))
        }
    }

And:

   const node = findNodeHandle(chartRef.current);
   if (!node) {
     return;
   }
   const { Commands } = UIManager.getViewManagerConfig('RNLineChart');
   if (isNil(Commands.highlights)) {
     return;
   }
   UIManager.dispatchViewManagerCommand(node, Commands.highlights, [[]]);

angelos3lex added a commit to angelos3lex/react-native-charts-wrapper that referenced this pull request Feb 4, 2026
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

Successfully merging this pull request may close these issues.

8 participants