@bhumika,
The example in Gallery seems to be working fine. Please take a look at this working sample for rendering dynamic line chart in React. You can also download sample project from our download page.
If you are still facing issue, kindly create sample project reproducing the issue you are facing and share it with us over Google-Drive or Onedrive so that we can look into your code, run it locally to understand the scenario better and help you resolve.
—
Vishwas R
Team CanvasJS