troubleshooting Question

Chart.js not showing the line

Avatar of Bob Schneider
Bob SchneiderFlag for United States of America asked on
ASPJavaScript
8 Comments1 Solution33 ViewsLast Modified:
Any one have any idea why my Chart.js is not showing the line?  The points are in the correct place, as are the axes labels.  They were showing.  Now sure what I did wrong.
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.js"></script>
</head>
<body data-open="hover" data-menu="horizontal-top-icon-menu" data-col="2-columns" class="horizontal-layout horizontal-top-icon-menu 2-columns ">

<!-- navbar-fixed-top-->
    <!--#include virtual="/templates/admin/navNavbar.asp"-->
    <!--#include virtual="/templates/admin/navSearch.asp"-->
<!-- ////////////////////////////////////////////////////////////////////////////-->
<!-- Horizontal navigation-->
<!--#include virtual="/templates/admin/navHorizontal.asp"-->
<!-- main content -->

<div class="app-content content container-fluid">
    <div class="content-wrapper">
        <div class="content-body">
             <div id="content">
                <div class="bg-warning" style="text-align:right;">
                    <a href="fitness_graph.asp">Fitness Graph</a>&nbsp;|
                    <a href="pulse_graph.asp">Pulse Graph</a>&nbsp;|
                    <a href="weight_graph.asp">Weight Graph</a>&nbsp;|
                    <a href="sta_graph.asp">STA Graph</a>
                </div>
                <h3>My eTRaXC Pulse Graph</h3>

                <p>
                    There is nothing like a visual display to help us really see how things are going.  Whether the news is good or bad, a 
                    visual reference to measure with is incredibly helpful.  You will find that here.
                </p>
            </div>
            <section class="flexbox-container">
                <div class="col-md-4 offset-md-4 col-xs-10 offset-xs-1  box-shadow-2 p-0">
                    <div class="card border-grey border-lighten-3 m-0">
                        <div class="card-body collapse in">
                            <div class="card-block">
                                <canvas id="myChart" style="width:100%;max-width:600px"></canvas>

                                <script>
                                    var xValues = [<%=sXVal%>];
                                    var yValues = [<%=sYVal%>];
                                     
                                    new Chart("myChart", {
                                    type: "line",
                                    data: {
                                        labels: xValues,
                                        datasets: [{
                                        fill: false,
                                        lineTension: 0,
                                        backgroundColor: "rgba(0,0,255,1)",
                                        borderColor: "rgba(0,0,0,0)",
                                        data: yValues
                                        }]
                                    },
                                    options: {
                                        legend: {display: false},
                                        scales: {
                                        yAxes: [{ticks: {min: 40, max:60}}],
                                        }
                                    }
                                    });
                                </script>



Open in new window

ASKER CERTIFIED SOLUTION
Log in to continue reading
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform for $9.99/mo
View membership options
Unlock 1 Answer and 8 Comments.
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
The Value of Experts Exchange in My Daily IT Life

Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>

Mike

Owner of Outages.IO
Phoenix, Arizona, United States
Member Since 2016
Join a full scale community that combines the best parts of other tools into one platform.
Unlock 1 Answer and 8 Comments.
View membership options
“All of life is about relationships, and EE has made a virtual community a real community. It lifts everyone's boat.”
William Peck

Member since 2004