Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6781085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:34:58+00:00 2026-05-26T16:34:58+00:00

I have the following code to draw candlestick visualization. But the visualization is not

  • 0

I have the following code to draw candlestick visualization. But the visualization is not generated. I am unable to trace error using Error Console!.

<script type="text/javascript" src="http://www.google.com/jsapi"></script>
  <script type="text/javascript">
    google.load('visualization', '1', {packages: ['corechart']});

function drawVisualization() {
   // Populate the data table.
     var data = new google.visualization.DataTable();
      data.addColumn('string', 'Date');
      data.addColumn('number');
      data.addColumn('number');
      data.addColumn('number');
      data.addColumn('number');   
      data.setValue(0, 0,'Mon');
      data.setValue(0, 1, '2');
      data.setValue(0,2,'6');
      data.setValue(0,3,'8');
      data.setValue(0,4,'10');
      data.setValue(1, 0,'Mon');
      data.setValue(1, 1, '2');
      data.setValue(1,2,'6');
      data.setValue(1,3,'8');
      data.setValue(1,4,'10');
    // Draw the chart.
     var chart = new google.visualization.CandlestickChart(document.getElementById('visualization'));
    chart.draw(data, {legend:'none', width:600, height:400});
    }

google.setOnLoadCallback(drawVisualization);
  </script>

Any Help Greatly Appreciated!
Thank You!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T16:34:58+00:00Added an answer on May 26, 2026 at 4:34 pm

    Two problems:

    1 – You need to add rows to the table before you try and set their values.

    2 – Values for index 1,2,3 and 4 have to be numbers instead of strings since Columns 1,2,3,4 are of a numeric type

    ...
      // Populate the data table.
      var data = new google.visualization.DataTable();
      data.addColumn('string', 'Date');
      data.addColumn('number');
      data.addColumn('number');
      data.addColumn('number');
      data.addColumn('number');
      //Add new rows first
      data.addRow();
      data.addRow();
      data.setValue(0, 0, 'Mon');
      data.setValue(0, 1, 2);
      data.setValue(0, 2, 6);
      data.setValue(0, 3, 8);
      data.setValue(0, 4, 10);
      data.setValue(1, 0, 'Mon');
      data.setValue(1, 1, 2);
      data.setValue(1, 2, 6);
      data.setValue(1, 3, 8);
      data.setValue(1, 4, 10);
      // Draw the chart.
    ...
    

    Here is a working example

    http://jsfiddle.net/WcKFf/2/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code to draw an array of points but it only
I have following code. But AddGameComponent doesn't draw. protected override void Initialize() { //
I am using the following code to draw text onto a jpg image but
I have the following code and the markers are not appearing on the map
I can draw a hyperlinked shape in tikz using the following code: \documentclass{article} \usepackage{tikz}
I have the following code to draw a square outline with the following code.
I am using the following code to draw Strings. In GDI+ Graphics tempFontGr(XXX); Matrix*
I have the following code which does nothing but reading some values from a
I am using the following code to draw a graph and print it to
I have following code to draw my logistic distribution: x=seq(-2000,2000,length=1000) dat <- data.frame(x=x) dat$value

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.