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

  • Home
  • SEARCH
  • 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 8995995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:41:40+00:00 2026-06-15T23:41:40+00:00

I have a dojox chart (chartDiv) that gets created within another container div (panelContainer).

  • 0

I have a dojox chart (chartDiv) that gets created within another container div (panelContainer).

Even though I have the width and height of the chartDiv set to be 90%, it either introduces scroll bars into the chartDiv, or if I dtart altering the padding and margin settigns for the ChartDiv, it will spill outside of the parent container.

I know this is going to be a basic issue, but I have been playing with lots of different CSS settings but nothing seems to solve keeping the chartDiv within the confines of the panelContainer (taking up 95% of the space)

enter image description here

This fiddle might help you spot where I have gone wrong.

  • 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-15T23:41:41+00:00Added an answer on June 15, 2026 at 11:41 pm

    When you make a chart (or a dojox.gfx canvas) without width/height, it will try its best to determine its dimensions from the container you put it in. It can get confused though!

    In your fiddle’s case, #chart has a known width, because it’s a block element and inherits its width from panelBG which is 100% of panelContainer’s width.

    The #chart div doesn’t really have a height though, since a block element is 0px tall until you put something in it (or add some style to it). As a consequence, (I think) the chart simply assumes a height of some proportion to the width.

    In your CSS, I see you have a #chartDiv rule with width and height 90%. I’m guessing you intended that to be #chart. That wouldn’t actually have resolved the problem entirely though!

    Assuming you changed that, the chart would now use 90%x90% as width/height, but if you try it, you’ll see that the labels/axis are still positioned incorrectly.

    Because you’ve floated the title container to the left, the chart container starts on the same “line” and tries to have its content “float” around the title container. This skews the axis labels out of place (green), while the actual chart (svg/canvas, pink) drops down below the title container.

    floats

    To fix this, tell the chart container to stay clear of floats on both sides:

    #chart {
        width: 90%;
        height: 90%;
        clear: both;
    }
    

    It isn’t really necessary to float anything though, and setting the height to 90% isn’t always ideal. I made a suggestion in an updated fiddle: http://fiddle.jshell.net/froden/WsrHs/4/ .

    The differences are just that the title container is a div spanning across the top, while the chart container is absolutely positioned so that it fills whatever space is left underneath. You can then just set width/height on panelContainer.

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

Sidebar

Related Questions

I have a dojox chart where the legend created for the chart never has
I have a page with 6 dojox.charting.Chart2d charts that works fine in all browsers
I have a DataGrid that is loaded from an XML data store, all created
Every Dojo chart that I have worked with has allowed for the use of
I have a working chart that graphs sales by week. I'd like to add
I have a div that is not contentEditable. I capture keystrokes, insert the associated
i have a datagrid (created programmatically) wich is connected to an JsonRestStore. In that
Let's say in a view I have a DojoX Mobile ListItem that is pulling
I have a div in which a page is loaded with the DojoX Layout
I am struggling to use dojox.mobile.ScrollableView for scrolling horizontally: I have a <div data-dojo-type=dojox.mobile.ScrollableView

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.