Struggling to integrate the c3 chart library with Angular, encountering loading issues

I've been attempting to utilize the c3 angular charts, but unfortunately nothing is displaying on my page. Despite checking for console errors and following a tutorial, I still can't seem to get anything to show up.

I have cloned the git repo and included the necessary files as references.

Any ideas why the charts are not appearing?

Charts:

https://github.com/jettro/c3-angular-directive

Tutorial:

Code:

<!DOCTYPE html>
<html ng-app="chart_test" xmlns="http://www.w3.org/1999/html">

  <head>


  </head>

  <body ng-controller="ChartController">
    <h1>Line Graph</h1>
      <div id="chart1"></div>
      <c3chart bindto-id="chart1" show-labels="true">
        <chart-column column-id="line1"
                      column-name="Line 1"
                      column-color="green"
                      column-values="30,200,100,400,150,250"
                      column-type="line"/>
        <chart-points point-radius="5"
                      show-point="true"
                      point-expand-enabled="true"
                      point-expand-radius="10"/>
    </c3chart>
    <script src="d3.min.js"></script>
    <script data-require="<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9efff0f9ebf2ffecb0f4eddeafb0abb0ad">[email protected]</a>" data-semver="1.5.3" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.min.js"></script>
    <script src="c3-angular.min.js"></script>
    <script src="app.js"></script>
    <script src="ChartController.js"></script>




  </body>

</html>

App.js:

var app = angular.module("chart_test", []);

Chart Controller:

var myApp = angular.module("chart_test");

myApp.controller("ChartController", ["$scope", function($scope){
  $scope.message = "hi";






}]);

Answer №1

While I may not be an expert in this topic, the starting point on the provided page suggests:

You need to incorporate the following libraries and stylesheet.

It then displays the code snippet below:

<link href="css/c3.min.css" rel="stylesheet" type="text/css"/>

<script src="js/d3.min.js" charset="utf-8"></script>
<script src="js/c3.min.js"></script>
<script src="js/angular.min.js"></script>
<script src="js/c3-angular.min.js"></script>

<script src="js/app.js"></script>

Based on my observation, you have added d3.min.js, angular.min.js, c3-angular.min.js, and app.js but have not included c3.min.css and c3.min.js.
I recommend including them and updating your question with the outcome if the issue persists.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best way for my web application to interface with a serial port?

I am working on a cloud-based web application that uses ASP Web API and Angular, both hosted on Azure. I have a requirement for my Angular app to communicate with a serial port for reading and writing data. How can I achieve this functionality? I've ...

Set AngularJS Material Design custom component back to its original state

I've developed a unique AngularJS custom component that acts as a wrapper for a Material Design mdSelect. It allows for easy configuration of available, default, and current values through its bindings. This component serves as an editing tool within ...

Unable to modify the chosen option within a select dropdown

I am trying to change the selected option of a select element using jQuery, but I can't seem to make it work. Here is the code I have: $("#ID option[value=grpValue]").prop('selected', 'selected').change(); If I manually type in a ...

($rootScope: busy) Applying changes right now

Whenever I try to make changes to the UI grid after refreshing the data, I keep encountering this error message: angular.js:13236 Error: [$rootScope:inprog] $apply already in progress http://errors.angularjs.org/1.5.0/$rootScope/inprog?p0=%24apply ...

How can I prevent my service worker from caching text/html documents such as the index page?

When my PWA is offline, I want it to display the offline.html page. However, even when the homepage fails to fetch due to being offline, my service worker still uses cached text/html requests to retrieve the homepage. To create my PWA, I am utilizing work ...

Struggling with organizing my code in node.js - it's all over the place and not very reliable. How should I tackle this

Can anyone help me troubleshoot an issue I'm facing with code that writes to the console late or in random order? var request = require('request'); var vFind = 'HelloWorld'; var vFound = false; var vSites = ['http://www.youtu ...

Navigate to the editing page with Thymeleaf in the spring framework, where the model attribute is passed

My goal is to redirect the request to the edit page if the server response status is failed. The updated code below provides more clarity with changed variable names and IDs for security reasons. Controller: @Controller @RequestMapping("abc") public clas ...

"I'm encountering an issue with Passport.js where req.isAuthenticated is throwing an error as not

Recently I started working with node and express, along with passport.js for building an authentication feature. However, I encountered an issue while using a middleware function called "checkNotAuthenticated" in my routes. The error message I received was ...

Guide to transferring text to clipboard using PHP and JS

Forgive me if this sounds a bit silly. I've been trying to figure this out for a while now, and it seems like the only solution I found involves clicking some sort of button. I have a form that generates license keys, and after generating one, I wan ...

Navigating the techniques of filtering an object with an array

I am looking to filter this object using the aaData array in order to display only unique values. For example, if the first item has the name "testowy2" and the second and third have the name "testowy", I want to show only one instance of "testowy". var j ...

Challenges encountered while creating a Number Tables Program (such as displaying 12 x 1 = 12) using Javascript

Currently, I am working on developing a program that can generate mathematical tables for any given number. For example: 3 x 1 = 3 3 x 2 = 6 3 x 3 = 9 3 x 4 = 12 To achieve this, the user should provide the following inputs: (1) The number they want ...

displaying a pair of distinct elements using React techniques

I need help adding a react sticky header to my stepper component. When I try to render both components together, I encounter an error. To troubleshoot, I decided to render them separately. Surprisingly, when rendering separately, I do not get the "store is ...

Button-controlled automated presentation

I have devised a method to create an automatic slideshow using JavaScript. However, I am looking to incorporate manual control buttons as well. After adding manual control code, the slideshow seems to be malfunctioning. The provided code below is used for ...

Discovering an Element in jQuery through its ID using Spaces and Variables

My issue involves locating an element within another element using an ID and then adding a class when the ID is hardcoded. For example: var tableId = el.id; $('#' + tableId).find("[id='Checkout On']").addClass('highlight'); ...

Is there a way to access just the concealed text within an element?

Is there a way to create a JavaScript function that can specifically extract hidden text from an element? Are there any existing libraries with this capability, and if so, how efficient are they? In order for an element to be considered visible ac ...

Transform the appearance of buttons within AppBar using Material UI React

Embarking on a new project using React and Node JS has led me into the battle with Material UI. My current challenge is customizing the style of AppBar items, particularly the Buttons. Here's what I have in my "Menu" component: const Menu = () => ...

Navigate back to the previous route within the Vue router hierarchy

In my Vue application, I have a Settings page with child routes such as settings/user, settings/addUser, etc. I am looking to implement a back button that when pressed, takes the user back to the specific page they visited within the Settings section. Usin ...

The functionality of AJAX is successful when tested on a local server, but encounters issues when deployed on a live

While the following code functions correctly on localhost, it fails to work on the live server. IMPORTANT UPDATE: There's only 1 issue remaining: Upon successful execution of this AJAX block: $(".FixedDiv").addClass("panel-danger"); setTimeout(c ...

Balancing website speed with capturing product impression

I've been tasked with capturing impressions of all the products visible in the viewport on a website that features thousands of products. To achieve this, I implemented a directory and utilized the IntersectionObserver, which was referenced within the ...

Populate the auto complete input box with items from a JSON encoded array

I have a PHP file that returns a JSON encoded array. I want to display the items from this JSON array in an autocomplete search box. In my search3.php file, I have the following code: <?php include 'db_connect.php'; $link = mysqli_connect($ho ...