2

I want to integrate a Highchart code with the Dash that I have already developed . I referred the github linkDash alternate-viz but i did not find how to embed .

Can someone suggest any guidance.

The highchart code that I want to embed is

<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/highcharts-more.js"></script>
<script src="https://code.highcharts.com/modules/draggable-points.js"></script>

<div id="container" style="min-width: 300px;height: 500px;"></div>

Highcharts.chart('container', {
    chart: {
        animation: false
    },

    title: {
        text: 'Highcharts draggable bubbles demo'
    },

    tooltip: {
        valueDecimals: 2
    },

    series: [{
        type: 'bubble',
        cursor: 'move',
        dragDrop: {
            draggableX: false,
            draggableY: true
        },
        data: [
            [100, 240, 3],
            [200, 130, 10],
            [450, 290, 15]
        ]
    }],

    yAxis: {
        softMin: 0,
        softMax: 350
    }
});

As per the requirement when I click a button in Dash I should be able to run this code and give the output in Dash.

Can someone help me with this requirement. Dash code I have written already but I don’t know how to embed this highchart version.

Thanks, Meera

Meera S
  • 57
  • 5
  • I've answered another similar question of yours on embedding d3 in Dash [here](https://stackoverflow.com/q/67372439/9098350). I would approach this the same way (applies to any other javascript really). Either you include your javascript code by putting it in a `.js` in an `assets` folder in your root directory (https://dash.plotly.com/external-resources). Only other thing you need to account for is to wait before the page load and to use the `external_scripts` param of `Dash` to include `highchartjs`... – 5eb May 04 '21 at 21:17
  • ...The other more involved approach is to create a custom `React` component using the `highcharts` library and to convert these components to `Dash` components. See the official documentation [here](https://dash.plotly.com/react-for-python-developers) and my answer [https://stackoverflow.com/questions/66121787/converting-responsive-grid-layout-to-plotly-dash/66141429#66141429](here) – 5eb May 04 '21 at 21:20
  • I am afraid that the Highcharts support is not able to help in this case. – Sebastian Wędzel May 06 '21 at 07:51
  • Hey @BasvanderLinden , I did embed the Highchart with dash . I was not able to figure out D3 so opted this solution . Thank you so much for the support and response . – Meera S May 06 '21 at 13:50

0 Answers0