Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highchart export server is not working on some systems #138

Closed
vishvajitgirase opened this issue Feb 17, 2021 · 0 comments
Closed

Highchart export server is not working on some systems #138

vishvajitgirase opened this issue Feb 17, 2021 · 0 comments

Comments

@vishvajitgirase
Copy link

i am trying to generate svg file using highchart export server and svg file is generating in my system but when i run same code in others system it gives message as Chart input data error. any help will be appreciated.
i am using nodejs for exporting svg file.
`
const chartExporter = require('highcharts-export-server')

const generateGraph = data => {
return new Promise((reject, resolve) => {
chartExporter.initPool()

const chartOptions1 = {
  type: 'image/svg+xml',
  options: {
    chart: {
      type: 'column'
    },
    title: {
      text: ''
    },
    xAxis: {
      categories: [
        'Year 1',
        'Year 2',
        'Year 3',
        'Year 4',
        'Year 5',
        'Year 5',
        'Year 7',
        'Year 8',
        'Year 9',
        'Year 10'
      ],
      crosshair: true,
      title: {
        text: 'Years'
      }
    },

    yAxis: {
      title: {
        text: 'Rain'
      }
    },
    credits: {
      enabled: false
    },
    legend: {
      enabled: false
    },

    series: [ {
      "name": "rain vs Year",
      "color": "blue",
      "data": [
        -2,
        -1,
        0,
        1,
        2,
        3,
        5,
        6,
        7,
        8
      ]
    }]
  }
}


chartExporter.export(chartOptions1, (err, res) => {

  if (err) {
    console.error('error ', err)
    reject(err)
  }
  try {
    console.log('file generated ', res)

    chartExporter.killPool()
    resolve('success')
  } catch (err) {
    console.error('error', err)
    reject(err)
  }
})

})
}

generateGraph().then(function (res) {
console.log("result")

}).catch((err)=>{
console.log(err)
})

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant