<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Yashas Gowda</title>
    <description>The latest articles on DEV Community by Yashas Gowda (@yashas_gowda_).</description>
    <link>https://dev.to/yashas_gowda_</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2101271%2F61ac0de6-bbc9-4cef-a95c-52cdb698630c.jpg</url>
      <title>DEV Community: Yashas Gowda</title>
      <link>https://dev.to/yashas_gowda_</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yashas_gowda_"/>
    <language>en</language>
    <item>
      <title>CanvasJS Real-Time Audio Visualization with Hearing Damage Alert</title>
      <dc:creator>Yashas Gowda</dc:creator>
      <pubDate>Tue, 18 Mar 2025 13:09:17 +0000</pubDate>
      <link>https://dev.to/yashas_gowda_/visualizing-sound-with-canvasjs-real-time-audio-with-a-hearing-damage-alert-4fhf</link>
      <guid>https://dev.to/yashas_gowda_/visualizing-sound-with-canvasjs-real-time-audio-with-a-hearing-damage-alert-4fhf</guid>
      <description>&lt;p&gt;In the multimedia era, understanding and visualizing audio data has become increasingly valuable—whether you're a musician tweaking a mix, a developer building an interactive app, or just someone curious about the soundscape around you. Today, we’re diving into a neat project that combines the Web Audio API with &lt;a href="https://canvasjs.com/" rel="noopener noreferrer"&gt;CanvasJS&lt;/a&gt; to create a real-time frequency analyzer, complete with a hearing damage alert.&lt;/p&gt;

&lt;h3&gt;
  
  
  What’s the Project About?
&lt;/h3&gt;

&lt;p&gt;Imagine a webpage with three sleek column charts: one for bass frequencies (0-200 Hz), another for mids (200-2000 Hz), and a third for treble (2000 Hz and up). These charts update in real-time as your microphone picks up sound, giving you a visual breakdown of the audio spectrum. If the sound gets too loud—say, approaching levels that could harm your hearing—a warning pops up, and the charts turn red.&lt;/p&gt;

&lt;h3&gt;
  
  
  Breaking Down the Code
&lt;/h3&gt;

&lt;p&gt;Let’s walk through how this audio analyzer comes to life.&lt;/p&gt;

&lt;h4&gt;
  
  
  Initializing the Charts
&lt;/h4&gt;

&lt;p&gt;In JavaScript, we create three CanvasJS charts, each targeting one of the div containers. Each chart is configured with a column type to display frequency bins as vertical bars, a light2 theme for a crisp look, and sensible axis labels. The dataPoints arrays (one for each range) will hold the amplitude values we’ll update in real-time. Below is the initialization of one of the three charts.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;charts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;CanvasJS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Chart&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;bassChart&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;light2&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Bass Frequencies (0-200 Hz)&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;axisX&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Bin&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;axisY&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Amplitude&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;maximum&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;255&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;column&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;dataPoints&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;dataPointsBass&lt;/span&gt; &lt;span class="p"&gt;}]&lt;/span&gt;
&lt;span class="p"&gt;}));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This setup is repeated for the mid and treble charts, with adjusted titles.&lt;/p&gt;

&lt;h4&gt;
  
  
  Capturing Audio
&lt;/h4&gt;

&lt;p&gt;The startAudio function uses the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API" rel="noopener noreferrer"&gt;Web Audio API&lt;/a&gt; to access the user’s microphone. Once the stream is captured, an AnalyserNode is created with an fftSize of 128, giving us 64 frequency bins to work with. It is with these frequency bins we are able to represent the captured sound across the three different frequency ranges; bass, mid, and treble.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;startAudio&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;stream&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;mediaDevices&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getUserMedia&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;audio&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;audioContext&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;AudioContext&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;webkitAudioContext&lt;/span&gt;&lt;span class="p"&gt;)();&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;source&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;audioContext&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createMediaStreamSource&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="nx"&gt;analyser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;audioContext&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createAnalyser&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="nx"&gt;analyser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;fftSize&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;128&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// 64 bins&lt;/span&gt;
  &lt;span class="nx"&gt;source&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;analyser&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="nf"&gt;updateCharts&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Updating the Charts
&lt;/h4&gt;

&lt;p&gt;The updateCharts function is where the magic happens. It grabs frequency data from the analyzer as a Uint8Array, splits it into bass, mid, and treble ranges (roughly 21 bins each), and pushes the values into the respective dataPoints arrays.&lt;/p&gt;

&lt;p&gt;To add a safety feature, we estimate decibel (dB) levels from the maximum amplitude. If it exceeds a threshold (set at 90 dB here, a conservative flag), the alert becomes visible, and the charts turn red—a visual cue powered by CanvasJS’s dynamic styling options.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;dB&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log10&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;maxAmplitude&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;255&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;dB&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;DB_THRESHOLD&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;alertElement&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;display&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;block&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;charts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;chart&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;chart&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;options&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;color&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;red&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;alertElement&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;display&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;none&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;charts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;chart&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;chart&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;options&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;color&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The requestAnimationFrame call keeps the loop running, ensuring the charts reflect the audio in real-time.&lt;/p&gt;

&lt;h3&gt;
  
  
  Closing Thoughts
&lt;/h3&gt;

&lt;p&gt;The complete code is available in &lt;a href="https://codepen.io/Yashas-Gowda-the-selector/pen/QwWQZOZ" rel="noopener noreferrer"&gt;&lt;strong&gt;this&lt;/strong&gt;&lt;/a&gt; Codepen URL.&lt;br&gt;
And that’s a wrap! With a few lines of code, we’ve built a live frequency analyzer that not only looks cool but also watches out for your ears.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Create an Animated Pie Chart in Less Than 20 Lines of Code!</title>
      <dc:creator>Yashas Gowda</dc:creator>
      <pubDate>Fri, 20 Sep 2024 12:43:41 +0000</pubDate>
      <link>https://dev.to/yashas_gowda_/create-an-animated-pie-chart-in-less-than-20-lines-of-code-4ck0</link>
      <guid>https://dev.to/yashas_gowda_/create-an-animated-pie-chart-in-less-than-20-lines-of-code-4ck0</guid>
      <description>&lt;p&gt;&lt;em&gt;Keep It Super Simple!&lt;/em&gt;&lt;br&gt;
When it comes to data visualization, clarity and simplicity are crucial. A well-crafted chart can convey important insights without overwhelming your audience with numbers and decimals. Let's embrace simplicity and create an animation-rich pie chart using CanvasJS, all in less than 20 lines of code.&lt;/p&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fozxpwuzhkkkkfbqqrs8k.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fozxpwuzhkkkkfbqqrs8k.PNG" alt="Pie Chart" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Copy and paste the code below into an HTML file and open it in a modern browser. For legacy browsers, please use the code on this &lt;a href="https://canvasjs.com/javascript-charts/animated-chart/" rel="noopener noreferrer"&gt;page&lt;/a&gt;. For a straightforward API explanation, scroll down!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE HTML&amp;gt;
&amp;lt;html lang="en"&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;meta charset="UTF-8"&amp;gt;
    &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt;
    &amp;lt;title&amp;gt;Animated Pie Chart&amp;lt;/title&amp;gt;
    &amp;lt;script src="https://cdn.canvasjs.com/canvasjs.min.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;div id="chartContainer" style="height: 370px; width: 100%;"&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;script&amp;gt;
        window.onload = () =&amp;gt; {
            const chart = new CanvasJS.Chart("chartContainer", {
                theme: "light2", // "light1", "light2", "dark1", "dark2"
                animationEnabled: true,
                title: {
                    text: "Desktop Browser Market Share in 2024"
                },
                data: [{
                    type: "pie",
                    indexLabel: "{label}: {y}%",
                    dataPoints: [
                        { y: 67.15, label: "Chrome" },
                        { y: 15.47, label: "Edge" },
                        { y: 7.89, label: "Safari" },
                        { y: 5.81, label: "Firefox" },
                        { y: 2.24, label: "Opera" },
                        { y: 1.44, label: "Others" }
                    ]
                }]
            });
            chart.render();
        };
    &amp;lt;/script&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Breakdown of the Code&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;&amp;lt;script src="https://cdn.canvasjs.com/canvasjs.min.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;/code&gt;&lt;br&gt;
First and foremost, we load the CanvasJS library via CDN.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;window.onload = () =&amp;gt; { ... };&lt;/code&gt;&lt;br&gt;
This line sets up an event handler that runs the enclosed code when the window (webpage) has finished loading. It ensures that all elements are available before the script executes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;const chart = new CanvasJS.Chart("chartContainer", { ... });&lt;/code&gt;&lt;br&gt;
Here, we create a new chart instance. The "chartContainer" is the ID of the HTML element where the chart will be rendered.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Chart Configuration Object:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Inside the parentheses, we pass an object that configures the chart. This object includes several properties:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;theme: "light2"&lt;/code&gt;: Sets the color theme of the chart. There are options like "light1", "light2", "dark1", and "dark2".&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;animationEnabled: true&lt;/code&gt;: Enables animations when the chart is rendered, making it visually engaging.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;title: { text: "Desktop Browser Market Share in 2024" }&lt;/code&gt;: Defines the title of the chart, displayed at the top.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;data: [{ ... }]&lt;/code&gt;: This array contains the data for the chart. Each object inside it represents a dataset. In this case, it’s a pie chart.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Pie Chart Configuration:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Inside the data array, we define:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;type: "pie"&lt;/code&gt;: Specifies that we are creating a pie chart.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;indexLabel: "{label}: {y}%"&lt;/code&gt;: Displays the label of each segment followed by its percentage, providing a clear representation of the data directly on the chart.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;dataPoints: [ ... ]&lt;/code&gt;: An array of objects that represent the individual segments of the pie chart. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each object has:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;y&lt;/code&gt;: The percentage value for that segment.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;label&lt;/code&gt;: The name of the segment (e.g., "Chrome").&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Rendering the Chart:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;chart.render();&lt;/code&gt;: This line finally draws the chart on the screen using the specified configuration.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Data source: SimilarWeb&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>canvasjs</category>
      <category>datavisualization</category>
    </item>
  </channel>
</rss>
