Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

267
Views
onDataPointClick de react-native-chart-kit no funciona en la web. funciona en android

Estoy usando react-native-chart-kit en un proyecto de exposición para graficar datos.

Configuré onDataPointClick como se muestra a continuación y Expo snack aquí demostrando el error: https://snack.expo.dev/@warm__tape/react-native-chart-kit-test

 <LineChart ... onDataPointClick={(data) => { console.log('Data point clicked'); }} />

El clic se registra correctamente en la consola en Android. No pasa nada en web. ¿No está seguro de cuál es el problema?

App.js completo de demostración del problema:

 import React from 'react'; import { StyleSheet, Text, View, Dimensions } from 'react-native'; import { LineChart } from 'react-native-chart-kit'; console.log('Test'); export default function App() { return ( <View> <Text>Bezier Line Chart</Text> <LineChart data={{ labels: ["January", "February", "March", "April", "May", "June"], datasets: [ { data: [ Math.random() * 100, Math.random() * 100, Math.random() * 100, Math.random() * 100, Math.random() * 100, Math.random() * 100 ] } ] }} width={Dimensions.get("window").width} // from react-native height={220} yAxisLabel="$" yAxisSuffix="k" yAxisInterval={1} // optional, defaults to 1 chartConfig={{ backgroundColor: "#e26a00", backgroundGradientFrom: "#fb8c00", backgroundGradientTo: "#ffa726", decimalPlaces: 2, // optional, defaults to 2dp color: (opacity = 1) => `rgba(255, 255, 255, ${opacity})`, labelColor: (opacity = 1) => `rgba(255, 255, 255, ${opacity})`, style: { borderRadius: 16 }, propsForDots: { r: "6", strokeWidth: "2", stroke: "#ffa726" } }} bezier style={{ marginVertical: 8, borderRadius: 16 }} onDataPointClick={data => { console.log(data, 'data'); }} /> </View> ); } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#fff', alignItems: 'center', justifyContent: 'center', }, });
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!