How would I go about getting eCharts to work in C3?

0 favourites
  • 3 posts
From the Asset Store
The ultimate voice pack filled with 1,536 files of .......wav and mp3 of individual numbers, letters, and words (that go
  • I got this to work locally where index.html and echarts.js are in the same folder.

    How would I do this in C3? I tries the HTML element but it's giving me grief. HTML and JS are my nemesis.

    This is the index.html file:

    <!DOCTYPE html>
    <html>
     <head>
     <meta charset="utf-8" />
     <title>ECharts</title>
     <!-- Include the ECharts file you just downloaded -->
     <script src="echarts.js"></script>
     </head>
     <body>
     <!-- Prepare a DOM with a defined width and height for ECharts -->
     <div id="main" style="width: 600px;height:400px;"></div>
     <script type="text/javascript">
     // Initialize the echarts instance based on the prepared dom
     var myChart = echarts.init(document.getElementById('main'));
     // Specify the configuration items and data for the chart
     var option = {
     title: {
     text: 'ECharts Example'
     },
     tooltip: {},
     legend: {
     data: ['sales']
     },
     xAxis: {
     data: ['Shirts', 'Cardigans', 'Chiffons', 'Pants', 'Heels', 'Socks']
     },
     yAxis: {},
     series: [
     {
     name: 'sales',
     type: 'bar',
     data: [5, 20, 36, 10, 10, 20]
     }
     ]
     };
     // Display the chart using the configuration items and data just specified.
     myChart.setOption(option);
     </script>
     </body>
    </html>
  • I believe you need to dowload echarts.js or echarts.min.js and put it to Scripts folder in the project. In script properties (on the left panel) select "Main script". If it doesn't work, try "Import for events".

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Put echarts.js into the scripts folder, selected it as "Main script". Profit!

    More coffee coming your way :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)