Glenn
Glenn

Reputation: 121

How to bind data in SQL Server to Highcharts?

I am using high charts in my application. My data resides in SQL server database. I am looking for expert advice about what are the best ways to bind the database values to the charts. Should i use python or .net stack? If I use Python, will I still need a webservice?

Your help is greatly appreciated.

Upvotes: 1

Views: 1235

Answers (1)

Wilts C
Wilts C

Reputation: 1750

This is quite a broad question that has multiple solutions. Let me suggest you a simple one.

  1. Identify the chart that you want

  2. Click at VIEW OPTIONS button and focus at the series field and learn about the data format needed for the chart that you want

eg. I want to create a Line chart and the series data needed is as following

    [{
        name: 'Tokyo',
        data: [7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6]
    }, {
        name: 'New York',
        data: [-0.2, 0.8, 5.7, 11.3, 17.0, 22.0, 24.8, 24.1, 20.1, 14.1, 8.6, 2.5]
    }]
  1. Create a web service which queries your database and returns JSON data in correct format (refer to step2)

  2. On your HTML page, call your web service and initialize Highcharts with the JSON data

Upvotes: 3

Related Questions