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

341
Views
Error while loadind data to react-native-pure-chart

Actually i'm would load data dynamically to react-native-pure-chart.

I have an API that give the data for each time where there was some measures and the response look's like the following:

Array [
  230,
  230,
  230,
  50,
  250,
]
Array [
  "14",
  "13",
  "09",
  "09",
  "09",
]



const [itemsY, setItemsY] = useState([]);
  const [itemsX, setItemsX] = useState([]);

  useEffect(() => {
     fetchData1();

  }, [1])
const fetchData1 = () => {
      DataService.getEnergyDataList()
      .then(response => {
          setItemsY([...itemsY,...response.data.map(res => res.Voltage)]);
          setItemsX([...itemsX, ...response.data.map(res => res.Time.substr(11, 2))]);
      })
      .catch(e => {
          console.log(e);
      });
   
  };
  let sampleData = [
     {x: itemsX, y: itemsY},
]

     <PureChart 
     data={sampleData} 
     type='line' width={'100%'}
    height={300}
    customValueRenderer={(index, point) => {
      if (index % 2 === 0) return null
      return (
        <Text style={{textAlign: 'center'}}>{point.y}</Text>
      )
    }}/>

Error: Exception in HostFunction: Malformed calls from JS: field sizes are different.

[[3,3,3,3,3],[2,2,2,2,2],[[357,"RCTView",21,{"position":"absolute","height":"100%","width":"100%"}],[367,"RCTView",21,{"borderTopColor":-2039584,"borderTopWidth":1,"width":"100%"}]],2038]

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!