3

I´m trying to update my highchart serie appending new data.

My series look like:

series: [{
        name: 'Serie1',
        data:[
            {
                x: 0,
                low: Date.UTC(2013, 07, 03, 0, 00, 00),
                high: Date.UTC(2013, 07, 03, 4, 0, 0),
                cliente:[{nombre:'Pepe',
                    Partida:'11111',
                    Bandejas:'35'},
                    {nombre:'Pepe1',
                    Partida:'222',
                    Bandejas:'50'}]
            },
            {
                x: 0,
                low: Date.UTC(2013, 07, 03, 5, 0, 0),
                high: Date.UTC(2013, 07, 03, 9, 0, 0)
            },
                            {
                x: 0,
                low: Date.UTC(2013, 07, 03, 18, 0, 0),
                high: Date.UTC(2013, 07, 03, 24, 0, 0)
            }
      ]
    },
        {
        name: 'Serie2',
        data:[
            {
                x: 2,
                low: Date.UTC(2013, 07, 03, 4, 0, 0),
                high: Date.UTC(2013, 07, 03, 10, 0, 0)
            },
                            {
                x: 2,
                low: Date.UTC(2013, 07, 03, 18, 0, 0),
                high: Date.UTC(2013, 07, 03, 24, 0, 0)
            },
                            {
                x: 2,
                low: Date.UTC(2013, 07, 03, 0, 0, 0),
                high: Date.UTC(2013, 07, 03, 2, 0, 0)
            },
                            {
                x: 2,
                low: Date.UTC(2013, 07, 03, 11, 0, 0),
                high: Date.UTC(2013, 07, 03, 18, 0, 0)
            }
      ]
    }          
            ]

When I click a button I want to append new data inside "Serie 1".

I´ve tried chart.series[pos].setData(newdata); and it works, but delete all the previous data. I´ve also tried using chart.series[pos-1].data.push(newdata); but it doesn´t work.

Any solution?

1 Answer 1

4

You can use addPoint function which allows to add new data.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.