Adjust the height and width of the divisions in Fusion Charts

I'm attempting to adjust the dimensions of a Fusion Chart division, but it seems that changing the height and width also impacts the size of the chart itself.

Code:

    <div class="col-lg-4">
      <div class="modal-body padding0" style="min-height:300px;">
        <fusioncharts width= '300' height= '150' type="doughnut2d" [dataSource]="dataSpurceUserExp"> </fusioncharts>
      </div>
    </div>

    <div class="col-lg-4">
      <div class="modal-body padding0" style="min-height:300px;">
        <fusioncharts width= '300' height= '150' type="doughnut2d" [dataSource]="dataSpurceUserExp"> </fusioncharts>
      </div>
    </div>

Check out the image below.

https://i.sstatic.net/0n2Cx.png

Answer №1

The FusionCharts Doughnut chart is designed to adjust its inner and outer doughnut radius, as well as other components like legends, labels, and values, to fit within the specified dimensions of the chart height and width.

As a result, the doughnut radius will dynamically change based on the dimensions provided for the chart, ensuring optimal use of available space.

When specifying chart dimensions in percentage, it is important to set the height/width of the container div either in pixels or dynamically, possibly using Bootstrap, to ensure proper rendering.

In cases where the div dimension is dynamically set using Bootstrap and the chart dimension in percentage, the doughnut radius will adapt accordingly to changes in the chart dimension.

For more details, you can view a sample fiddle: https://jsfiddle.net/kv8npm1w/

FusionCharts.ready(function() {
  // Chart initialization code goes here
});

The chart also provides an option to explicitly set the inner and outer radius using "doughnutRadius" and "pieRadius" properties in the chart dataSource.

However, it's important to note that setting the radius explicitly may lead to overlapping or the doughnut exceeding the chart dimension limits, as it won't dynamically adjust its radius once set explicitly.

You can view a sample fiddle showcasing a chart with radius set explicitly here: https://jsfiddle.net/kv8npm1w/2/

FusionCharts.ready(function() {
  // Chart initialization code with explicitly set radius goes here
});

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Move the width from left to right with animation

Currently, I am exploring ways to use jQuery to create an animation effect on a div where the width shrinks from left to right. My first step is to have the element animate as follows: Slide in from left to right Then continue moving to the right off th ...

range input in firefox not functioning properly with focus method

One issue with using the input type range in HTML code is that when a focus event is triggered, it may not work properly in Firefox. Below is an example of the code: var p = document.getElementById("price"), res = document.getElementById("result"); t ...

Stop images from being stored in the database instead of text characters

Using a proxy, I attempt to parse some HTML. One of the elements is retrieved using jQuery: var site = 'http://www.kartabu.com/pl/index.php?filter=random' var url = 'http://localhost/taboo.blue-world.pl/admin/proxy.php?url=' + encodeUR ...

Set up a mouseover function for a <datalist> tag

Currently, I am delving into the world of javascript/jquery and I have set up an input field with a datalist. However, I am encountering a slight hurdle - I am unable to trigger an event when hovering over the datalist once it appears. Although I have man ...

Tips for creating JSON using AngularJs to store tabular information

I successfully created an HTML page using AngularJS. <form name="target" ng-submit="createAllKeywordsJSON(codeMasterList)"><!-- createAllKeywordsJSON() --> <input type="submit" value="Save" class="myButton" name="submit" style="margin: ...

Don't forget to preserve the hover state of divs even after refreshing

I recently added a navigation bar that expands in width upon hovering over it. For an illustration, check out this example: http://jsfiddle.net/Gsj27/822/ However, I encountered an issue when clicking on a button within the hover effect area. After load ...

Creating uniform-sized flex items with varying image sizes

When setting flex: 1 1 0 on flex items, it does not work as expected especially when the flex items contain images of varying sizes. In this scenario, the flex-item containing the image ends up becoming significantly wider than the others. Below is the H ...

HTML code featuring multiple dropdown menus, each equipped with its own toggleable textarea

I have multiple HTML drop downs, each triggering a textarea based on the selection. Currently, I'm using show and hide JavaScript functions for each question individually. Is there a way to streamline this so that I don't have to write separate c ...

Executing JavaScript code within ASP.NET Visual Basic

My current web application uses jQuery and JavaScript, but I want to add more features that are supported in ASP.net VB. However, I am unsure if the JavaScript can run after the VB code. Essentially, I would like the web app to follow this sequence: ...

Challenges with implementing CSS transitions

I've been delving into CSS3 transitions, and I'm encountering some confusion. I can't tell if I'm misunderstanding something or if it's the browsers causing issues. Initially, I believed Opera had transition support starting from ...

"Managing output buffers, styling with CSS, and sending emails with PHP

I am currently using a script to send emails that result in a couple of HTML tables: $from = "example.com <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="82efebe7ef83898ce0ede1e9e3e6d2edeee8">[email protected]</a ...

Position a <div> element in the center of another <div> element

Link to code: https://jsfiddle.net/z4udfg3o/ My goal is to center the "caixa" divs within the "produtos" div. Initially, I achieved this by using exact values with margin-left. However, I now want it to be responsive across different screen sizes, so I ha ...

Tips on causing a div to overflow instead of wrapping onto a new line

Are you looking to design a slider with 3 image containers all in the same row, where the third one overflows instead of wrapping to a new line? Here is an example: Desired Design: https://i.stack.imgur.com/dKyEg.png Current State: https://i.stack.imgu ...

What is the most effective method to exhibit every element within a content wrapper at a specific interval of time?

I am looking for a way to display each div within the content-wrapper after a specific time interval. Currently, I am using individual classes like el1, el2, el3, ... to accomplish this task. However, when dealing with content-wrappers containing multipl ...

Is there a way to determine the remaining time between the present moment and a specific time in JavaScript?

Here's a snapshot of the snippetI have this great idea for a prayer app that can calculate the time remaining between the current time and the scheduled prayer times. My initial approach was to directly find the difference using the following code: ...

Selecting objects within a small three.js view

I am able to showcase an entire page filled with graphical elements using three.js and can even select objects by clicking on them. However, when attempting to display three.js graphics in a small viewport within an HTML page, issues arise. In order to ca ...

Divs in multiple columns within a table: The containing div is limited to the width of the first column

I'm attempting to enclose one "div" within another that might have multiple columns inside. But, as shown in this example <table class="datatable"> <tr> <td class="leftcolumn">Radiobuttons:</td> <td class="rightcolum ...

What is the best way to make a button stretch across the entire width of the footer on a mobile device screen?

I'm attempting to make a button located in the right rail column on my test page (in desktop view) expand to fill the entire footer of the page in mobile view. Below is the CSS and JavaScript code I am currently using: @media screen and (max-width: ...

Django causing CSS issues following the utilization of an if statement

I have been working on adding a dropdown list to my navbar, which I created using Bootstrap. However, whenever I place the dropdown menu inside an if statement for looping categories into a list, it seems to be breaking the CSS. Check out the navbar witho ...

Styling X and Y axis font color in charts using JavaFX 2.x CSS

Is there a way to change the font color of both X and Y axes? In my search through the css reference for fonts, I only found properties like font-size, font-style, and font-weight. font-size, font-style and font-weight I attempted to use -fx-font-color ...