Home forums Chart Support Zooming does not work in production environment

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #15111

    I use CanvasJS in electron. The zooming function works in development environment but not in production environment.

    I use https://github.com/chentsulin/electron-react-boilerplate.

    The example code is as below:

    import '../../third/canvasjs/canvasjs.min';
    const Chart = window.CanvasJS.Chart;
      chart = new Chart('chart2D1', {
        zoomEnabled: true,
        zoomType: 'xy',
        backgroundColor: Const.Colors.white,


    It seems like you haven’t defined rangeChanged, Check console if you are getting some error in the production environment. It would be helpful if you can share working code which reproduces the issue, so that we can look into it and help you to solve it.
    Suyash Singh
    Team CanvasJS


    Thanks. it is not about zoomEnabled. The example code is not complete.

    I have fixed this issue as a work around by importing canvasjs in the way below:

    if (process.env.NODE_ENV === 'development') {
    } else {

    If the webpack makes bundle with canvasjs.min.js in production environment, this issue occurs.

    If the webpack makes bundle with canvasjs.js in production environment, it would be okay.

    I don’t know the specific reason.


    Thanks. I think it is an issue more involved with electron and reported it in electron project.


Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.