Skip to content

Chart fails to render data when tooltip formatter function is provided #138

Description

@ddnelaka2000

When providing a custom formatter function in the tooltip configuration, the chart does not render properly often it renders only the y-axis labels but no data points, lines, or other chart elements. The chart works correctly when the formatter is removed or replaced with a simple string formatter.

example:
tooltip: {
show: true,
trigger: 'item',
formatter: (params: any) => {
// Any custom logic here causes the issue
const param = Array.isArray(params) ? params[0] : params;
return Value: ${param?.value?.[1] || 'N/A'};
}
},

The same options works in @wuba/react-native-echarts
Simple string formatters work correctly
(The issue could to be related to JavaScript function serialization.)
(Using JSON.parse(JSON.stringify(options)) sometimes works as a workaround but is not a proper solution.)

Environment

React Native ECharts Pro version: 1.9.3
React Native version: 0.77.2
Expo Version: 52.0.42
Platform: iOS
Device: iphone 16

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions