[HighChartsComponent] Ajax Refresh on Highcharts

[HighChartsComponent] Ajax Refresh on Highcharts

  
Forge Component
(26)
Published on 2016-08-30 by J.
26 votes
Published on 2016-08-30 by J.

Hey guys, really like this plug in. I have a small problem though, was thinking if someone could help me.

I am using Highcharts component for plotting data from a consumed API. The user can choose dimensions and measures in real time and therefore the component has to be ajax refreshed when the user changes the input. When I tried this with the simple script-component the chart just disappeared when the refresh came and I wonder if this has something to do with the javascript or if I am implementing it wrongly.

I changed to using the Web Block and it worked better however I am plotting things that are dependent of categories, which means I would like to have text instead of numbers in one of the axis, is this possible with the web block? 

Many thanks in advance!

Hey Jack,

I had this problem when not setting the min height for the chart.

However is possible to use text as the value of the axis.
You have checked the documentation?

https://www.highcharts.com/docs

Oh that's interesting! Thanks for your help! :)

Raphael Ranieri wrote:

Hey Jack,

I had this problem when not setting the min height for the chart.

However is possible to use text as the value of the axis.
You have checked the documentation?

https://www.highcharts.com/docs

I tried to set the height of the component to an arbitrary number but it still disappeared when I use Ajax refresh, here is my code with hard coded data:

SyntaxEditor Code Snippet

"$(function () {
    $('#" + container.Id +"').highcharts({
        chart: {
            type: 'line',
            zoomType: 'xy',
            height: 500,
            width: 600
        },
        title: {
            text: 'Create PDP Failure'
        },
        subtitle: {
            text: 'time'
        },
        series: [{
            name: 'Users',
            data: [[233,444][444,222]]
      }]
    });
});
"


As I am interpreting the documentation I have to set the xAxis type to categories for the labels to show the strings, (which is not possible through the input variables of the web block) but I haven't read it all. Would mean a lot if you can educate me on how to get the HighChart Web block to do so..

Thanks again for your time!