Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #103780
    salasidis
    Participant

    My embedded CPU has a poor implementation for the async Web server, in that it uses heap space to recreate a valid json file that is to be replied back when a request for a graph is made.

    The graph has to have up to 2 years of data, and can be about 2Mb. There is enough SDRAM to hold it, but not enough microcontroller RAM (the CPU allocates regular RAM at 2x-3x the size of the string passed).

    Assuming the library creator is unable to optimize this, my only solution is to break up the 2 years of graph into 24 month JSON strings – and send them individually.

    I am using JQuery. Is there a best way you can see how this should be implemented, and can the data be passed to the chart elements one month at a time, or should the entire array be concatenated before sending to the chart.

    Thanks

    • This topic was modified 2 years, 2 months ago by salasidis.
    • This topic was modified 2 years, 2 months ago by salasidis.
    #103791
    ivanpeevski
    Participant

    Hi salasidis,

    You can have a look at the code for the Live Update demo.

    You can just push the next month data one by one in the dataSource, but the chart will draw them only if you call chart.update() after that

     

    Best Regards,
    Ivan Peevski

    Smart UI Team
    https://www.htmlelements.com/

    #103795
    salasidis
    Participant

    Thanks, that would work.

    I commented out the data.splice function in the demo, as I would want to display all the data all at once. The X axis gets very crowded, and does not seem to update the distance between labels, etc.

    Is there a way to do this.

    Also presumably in my application, I could just push the data x 24 or so times, and do a single update at the end (should be faster).

    #103799
    ivanpeevski
    Participant

    <div class=”bbp-voting bbp-voting-post-103791 view-only bbp-voting-float”></div>
    Hi salasidis,

     

    The X axis in the demo looks crowded because xAxis -> unitInterval is set to 1. This forces the chart to show every single x Axis element. If you remove that, it will be automatic and will update the distance between the labels.

     

    Best Regards,
    Ivan Peevski

    Smart UI Team
    https://www.htmlelements.com/

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.