Highcharts error 15

后端 未结 3 1178
深忆病人
深忆病人 2020-12-19 04:09

i\'m trying to represent these data using highcharts:

[
  {
    \"name\": \"c1\",
    \"data\": [
      [
        -52587360000000,
        2
      ],
      [         


        
相关标签:
3条回答
  • 2020-12-19 04:27

    As the link in the error message will tell you:

    Highcharts expects data to be sorted

    This happens when you are trying to create a line series or a stock chart where the data is not sorted in ascending X order. For performance reasons, Highcharts does not sort the data, instead it is required that the implementer pre-sorts the data.

    In your case the x-values in your first series are:

    -52587360000000
    -52590038400000
    -52611724800000
    -52622611200000
    -52655184000000
    -52663392000000
    -52855545600000
    

    Just looking at the first two it is clear that -52587360000000 is a smaller (more negative) number than -52590038400000. It appears that you have in fact reverse-sorted them. That is, the largest number is first, then they get increasingly smaller (more negative).

    You will have to change the order of the data in the series so that the smallest number is first and then the values increase.

    0 讨论(0)
  • 2020-12-19 04:29

    in my case, the first element of the "data array" , is datetime-descend. this is incorrect for HiChart. e.g.

    # this sort cause error 15 of highchart
    [   5,        'content...' ],
    [   4,        'content...' ],
    [   3,        'content...' ]
    

    solution: re-order the array with the 'asend order' for the first element, e.g.

    # this is working good
    [   3,        'content...' ],
    [   4,        'content...' ],
    [   5,        'content...' ]
    
    0 讨论(0)
  • 2020-12-19 04:46

    This issue occurs when you sort the date order by desc

    Note

    • Do not sort the data order by date desc
    • Instead sort the data order by date Asc

    Your issue will be resolved. Happy Coding

    0 讨论(0)
提交回复
热议问题