Home forums Using CanvasJS Display HTML values in canvas chart

This topic contains 1 reply, has 2 voices, and was last updated by  Vishwas R 6 months, 2 weeks ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #10110

    I’ve recently started looking into canvasjs and i think it’s great. I’m using the following JavaScript and HTML code. I currently have the bar chart displaying set results. How can i change this to display the values which are displayed in the HTML div’s (test and duration). I want to try and put these values into the chart? these values come from local storage and i have them displaying on the HTML page. Can someone please help me?

          data: [
            type: "bar",
            showInLegend: true,
            name: "Black",
            color: "#000000",
            dataPoints: [
            { y: 0.18, label: "Test"},
            { y: 0.12, label: "Test 1"},
            { y: 0.59, label: "Test 2"},        
            { y: 1.15, label: "Test 3"},        
            <div id="bar">
    			<div id="chartContainer" style="height: 300px; width: 100%;"></div>
    		  <div id="startTime">
    		<div id="startDate">
    		<div id="duration">
    		<div id="test">
    • This topic was modified 6 months, 3 weeks ago by  user864731537.

    Vishwas R

    Here is an example where you can access data from HTML and pass it to chart.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.