Incorporate an additional ring around the outer edge of the donut pie chart

I have been attempting to create a donut pie chart similar to the one shown below.

The main challenge I am facing is with the outer strip. How can I achieve this effect?

Your guidance in the right direction would be greatly appreciated.

https://i.sstatic.net/QP02A.png

While I am currently using flotchart, I am open to exploring other options if you can provide some insight.

This is the progress I have made so far:

<div id="report_score_summary" class="chart" style="height:303px;width:100%">
<script>
data_score_summary = [
  { label: "Description Score", data: 20, color: '#BA2B6B' },
  { label: "Image Score", data: 30, color: '#375EAB' },
  { label: "Header Score", data: 50, color: '#4BB748' },
  { label: "Content Score", data: 10, color: '#F6871E' },
  { label: "Title Score", data: 18, color: '#E1DC3A' },
  { label: "Free", data: 16, color: '#E6E5E3' }
];


$.plot(report_score_summary, data_score_summary, {
series: {
    pie: { 
        innerRadius: 0.5,
        show: true
    }
}
});

setCode([
"$ .plot('# report_score_summary', data_score_summary, {",
" series: {",
" pie: {",
" innerRadius: 0.5,",
" show: true",
" }",
" }",
" });"
]);  
</script>
</div>

You can also view it on jsfiddle.

Answer №1

If you want to enhance your plot, consider adding a larger donut with a bigger inner hole positioned behind it. This method may not be the most elegant solution, but it works without the need to switch to SVG (which could potentially be a better choice).

HTML

 <div id="report_score_summary" class="chart" style="height:303px;width:100%;z-index:2;margin-top:75px;margin-left: 62px;">

</div>

 <div id="report_score_summary_outer" class="chart" style="height:453px;width:100%;position: absolute; top: 0; left: 0;z-index: 1;">

</div>

JS

 $.plot(report_score_summary_outer, data_score_summary, {
    series: {
        pie: { 
            innerRadius: 0.8,
      width: 0.1,
            show: true,
      label: {
                show: false
            }
        }
    },
  legend: {
        show: false
    }
});

Check out the updated jsfiddle 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

Deactivating and activating an HTML input button

So I was tinkering with this cool button: <input id="Button" type="button" value="+" style="background-color:grey" onclick="Me();"/> I've been wondering, how can I conveniently control its state of being disabled or enabled? Initially, I attem ...

What is the best way to bring a local package into another npm package and verify its functionality using Typescript?

In a scenario where there are 3 npm projects utilizing Webpack and Typescript, the folder structure looks like this: ├── project1/ │ ├── tsconfig.json │ ├── package.json │ ├── src/ │ │ └── index.ts │ ...

Leveraging JQuery to retrieve the string value from an onclick() event

Curious if there's a more efficient approach to tackle this issue, decided to seek input from the SO community... There's a third-party web page over which I have no control in terms of how it's displayed, but they do allow me to integrate ...

Leveraging Template Variables for Styling in Vue 3's CSS Classes

Struggling to find the perfect way to utilize variables returned by Vue functions in CSS inline styles, specifically with the "width" style. I have two variables that are returned to the template and can be used with the {{}} syntax, but not directly as a ...

Rendering the page using ReactDOM.render

Just started with ReactJS, I'm struggling to figure out why my page isn't displaying anything - <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> ...

Are English letters equivalent to Chinese characters on a one-to-one basis?

As a UX designer, my team is currently developing a product that requires a text input field for users to enter their notes. It's important to have a clear indication of the word limit, regardless of whether they are typing in Traditional Chinese or E ...

Adjust the size of CSS sprite pixel art without blurring the image

I am attempting to enlarge CSS sprite pixel art images and need to completely eliminate anti-aliasing/image smoothing. After reading this post on the subject: Disable antialising when scaling images, I experimented with the following CSS: image-rendering ...

Tips for organizing your CSS from scratch without relying on a pre-existing framework such as bootstrap, bulma, or materialize

As I embark on a new Angular project, the decision has been made to create our own component library instead of using frameworks like Bootstrap, Bulma, or Materialize. Despite some initial research, I'm feeling a bit lost on where to begin (other than ...

I wonder what's causing the issue with my ajax request

In my code snippet, I am using the $.ajax method like this: var w_command = "add_holiday" var w_type = "POST" var w_id = "123321" $.ajax( { type: w_type, url: w_command, parameters: { to_find_id: w_id }, succe ...

Having trouble getting the text on the menu to align to the right side

I have a website at: I am attempting to shift the menu so that the links appear on the right side of the window instead of the left side. I have experimented with various text-align: right; properties, but none of them seem to be effective. I was able t ...

jquery code to show/hide all elements

My webpage contains multiple content tabs with expand/collapse icons in each panel. To simplify the process of closing all expanded sections, I have included buttons for expanding and collapsing all panels at once. While this feature is functioning correc ...

Is there a way to implement a feature that automatically closes the chatbot when the user clicks outside of it?

Here is an example of my HTML code: <div class="chatbot chatbot--closed "> <div class="chatbot__header"> <p><strong>Got a question?</strong> <span class="u-text-highlight">Ask Harry</span></p> < ...

Instructions for activating the click function for each individual looping image

When creating a blog page, I am using PHP to loop the like button images according to the total count of posts (example: Facebook like button). The issue I am facing is that while the PHP loop is working, when I click on the first post image, only the firs ...

JavaScript code: Restricting spaces on all pages but one

I've been facing a challenge trying to restrict the space button from being pressed on all pages except for two where I have textareas. These two pages require spaces for users to enter their support ticket messages. Despite numerous attempts, I haven ...

Tips for styling the selected or clicked cell of an HTML5 table

Currently, I am working on a web development project to enhance my skills. I am looking to incorporate a feature that changes the color of a clicked cell to a specific color. For a demonstration, you can view this link: https://jsfiddle.net/pz6tc3ae/30/ T ...

Running dynamically imported jQuery script

I am in the process of developing a website that loads pages dynamically using the .load function. Essentially, I have an index.php file with a link that, when clicked, loads another page containing HTML and some jQuery code (plugins initialization and so ...

Is it possible to utilize a contenteditable div in place of a textarea?

Is it possible to replace a textarea with a content editable div? Will the behavior be the same? Can data processing be done in the same way as with textarea data? ...

What is the best way to insert an image that is absolutely positioned inside a <td>?

I'm facing an issue with placing an absolutely positioned image inside a td. The code I have tried seems to create gaps above the image in FF 3.6 and causes the image to disappear in IE 7. I have included the necessary external style sheet elements ab ...

Is it possible to create a dropdown menu that exceeds the width of its parent column?

I currently have a dropdown that contains 3 main "categories," each of which includes multiple checkboxes for search filtering purposes. Here is an example snippet of the code: <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4. ...

The mobile view of the Bootstrap navigation bar is unresponsive and unable to be clicked when

Does anyone know how to fix an issue with a collapsed navbar on mobile? The navbar collapses properly, but nothing happens when the collapsed button is clicked. It works fine on desktop, but not on mobile. Any suggestions on how to resolve this problem? &l ...