Devextreme-reactive: Chart crashes when dynamically changing Barseries to display

Created on 20 Aug 2020  路  3Comments  路  Source: DevExpress/devextreme-reactive

  • [x] I have searched this repository's issues and believe that this is not a duplicate.

I'm using ...

  • [ ] React Grid
  • [x] React Chart
  • [ ] React Scheduler

Current Behaviour

I want to dynamically display BarSeries depending on wether the user selects a BarSeries or not from a dropbox, but the app crashed with this error:
"Cannot read property 'scaleName' of undefined"

Expected Behaviour

The user should be able to display the Barseries of his choice when selecting the wanted values from the drop box.

Steps to Reproduce

Link to codesandbox: https://codesandbox.io/s/autumn-https-nsphk

1- The chart first displays data for both countries japan and france.
2- The user clicks on the countries dropbox and unselects france
3- The chart now only displays japan's data <= OK
4- Now, the user clicks on the countries dropbox again to re-select france
5- The chart crashes with the error <= KO

Screenshots


image

Environment

  • devextreme-reactive: ^2.7.0
  • react: 16.13.1
  • browser: any
  • bootstrap: none
  • react-bootstrap: none
  • material-ui: 4.11.0
Chart duplicate

Most helpful comment

Nevermind,

I have read the issue #2947, and after two failed trials I have finally fixed my problem.

This issue can be closed, thank you and sorry for the inconvenience.

All 3 comments

Nevermind,

I have read the issue #2947, and after two failed trials I have finally fixed my problem.

This issue can be closed, thank you and sorry for the inconvenience.

Whats the answer to that ? i have the same problem.

Whats the answer to that ? i have the same problem.

@manodupont I solved it by using the Plugin from "@devexpress/dx-react-core"

Here is my example with a working version: https://codesandbox.io/s/barseries-crash-forked-10hh8?file=/demo.js

Note the import at line 9:
import { Plugin } from "@devexpress/dx-react-core";

and the Plugin use at line 62:
<Plugin name="ser">{getSeries()}</Plugin>

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jesusgp22 picture jesusgp22  路  3Comments

stclairdaniel picture stclairdaniel  路  3Comments

sintuchintu picture sintuchintu  路  3Comments

acentfrio picture acentfrio  路  3Comments

ccamusso picture ccamusso  路  3Comments