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 8157003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:07:57+00:00 2026-06-06T17:07:57+00:00

I am quite new to client-side web development, so just feel free to edit

  • 0

I am quite new to client-side web development, so just feel free to edit my questions and if anything just does not make much sense.

Regarding HTML5/JavaScript and jQuery based charting libraries, let me just take RGraph (named as a HTML5 / JavaScript charts)and HighCharts (named as JavaScript charts under jQuery framework) for example.

The RGraph uses <canvas> tag for displaying the charts generated as exemplified in their documentation. However HighCharts uses <div> tag as placeholder for their charts.

I am trying to put HighCharts into <canvas> tag as the way RGraph does (which might sound weird to you…I don’t know), the charts won’t be able to displayed. The other way around, same issue happens if I put RGraph charts into <div> placeholder as HighCharts.

All I see is that either and are just placeholders, all the fancy interactive actions are down by the JavaScript. So Why came up with the above issues? I believe there might be reasons that some config differences between RGraph and HighCharts, but have NO idea what are those…

What is the difference for rendering charts in <canvas> and <div> tags?

~~~~~~~~~~~~~~~~~

Below is my scripts for demonstration:

Put RGraph in <canvas>, works perfectly fine:

<!DOCTYPE html>
<html>
    <head>

        <script>
                Scripts go here 
        </script>

    </head>
    <body>

        <div>
            <h1>Basic RGraph Example</h1>
            <h2>Line Chart</h2>
            <canvas id="line" width="400" height="300"></canvas>
            <h2>Pie Chart</h2>
            <canvas id="pie" width="400" height="300"></canvas>
            <h2>Bar Chart</h2>
            <canvas id="bar" width="400" height="300"></canvas>

        </div>

    </body>
</html>

Does not work if I put charts into <div> tag:

<!DOCTYPE html>
<html>
    <head>

        <script>
                Scripts go here 
        </script>

    </head>
    <body>

        <div>
            <h1>Basic RGraph Examples</h1>
            <h2>Pie Chart</h2>
            <div id="line" width="400" height="300"></div>
            <h2>Line Chart</h2>
            <div id="pie" width="400" height="300"></div>
            <h2>Bar Chart</h2>
            <div id="bar" width="400" height="300"></div>

        </div>

    </body>
</html>

Any comments are appreciated. Thanks!

  • 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-06-06T17:07:58+00:00Added an answer on June 6, 2026 at 5:07 pm

    The <div> tag and the <canvas> tag is not really the dividing line on javascript charting. It is really canvas vs SVG. RCharts uses canvas to draw their charts. Highcharts uses SVG. Highcharts simply uses a div as a container for the chart. This allows the user to specify where the chart will be drawn in the DOM. Similarly, flot and jqplot (which both use the canvas to render their plots) use a div tag in the same manner.

    So now your question becomes canvas vs SVG for drawing? Read about that here and here.

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

Sidebar

Related Questions

I am a quite new to web development and I am trying to do
I am quite new to web development and have a task to develop a
Quite new to maven here so let me explain first what I am trying
Im quite new to spring mvc. What I'm trying to achive is separating static
Being quite new to rails and currently building a project, i'm begining to be
Scenario: Quite new to DI and Ninject but would love to master it so
Still quite new to Haskell.. I want to read the contents of a file,
Iam quite new to functions in SQL and I would like to create a
I'm quite new in PHP dev and I can't find a way to solve
I am quite new to mongoid and rails. So I have some troubles to

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.