kleinohad
kleinohad

Reputation: 5912

Highcharts json data format

I am using the highcharts wind rose example I am trying to achieve this: https://jsfiddle.net/bqwprojc/1/ Read data from table:

data: {
        table: 'freq',
        startRow: 1,
        endRow: 17,
        endColumn: 7
    },

This example is reading data from inline table and I need to reed the data from json but I don't know what json format should I pass as series.

This is what I tried so far: https://jsfiddle.net/e97cr6js/

Series data I tried:

series: [{
        "name": "High",
        "data": [
            ["Unsafe device behavior", 1],
            ["Hardware", 1],
            ["OS/FIRMWARE", 0],
            ["Configuration", 0],
            ["Applications", 0],
            ["Vulnerabilities", 0],
            ["Policies", 0]
        ],
        "_colorIndex": 2
    },
    {
        "name": "Med",
        "data": [
            ["Unsafe device behavior", 1],
            ["Hardware", 1],
            ["OS/FIRMWARE", 0],
            ["Configuration", 0],
            ["Applications", 0],
            ["Vulnerabilities", 0],
            ["Policies", 1]
        ],
        "_colorIndex": 1
    },
    {
        "name": "Low",
        "data": [
            ["Unsafe device behavior", 1],
            ["Hardware", 1],
            ["OS/FIRMWARE", 0],
            ["Configuration", 1],
            ["Applications", 1],
            ["Vulnerabilities", 0],
            ["Policies", 1]
        ],
        "_colorIndex": 0
    }],
colors: ['#009F5C', '#FFBD2F', '#FF001D'],

Upvotes: 0

Views: 661

Answers (1)

kleinohad
kleinohad

Reputation: 5912

I was manage to solve it by adding categories to the xAxis what made the chart rotate and made everything align.

xAxis: {
    categories: categories
    },

https://jsfiddle.net/chbw28dg/

Upvotes: 1

Related Questions