<?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: Agata</title>
    <description>The latest articles on DEV Community by Agata (@kaerub).</description>
    <link>https://dev.to/kaerub</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F332334%2Fc78a2cc6-6876-4a24-99f1-5ee63aed16a1.png</url>
      <title>DEV Community: Agata</title>
      <link>https://dev.to/kaerub</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kaerub"/>
    <language>en</language>
    <item>
      <title>React.useRefの理解を含めるエクササイズ</title>
      <dc:creator>Agata</dc:creator>
      <pubDate>Sat, 29 Jul 2023 05:57:20 +0000</pubDate>
      <link>https://dev.to/kaerub/reactuserefnoli-jie-wohan-meruekusasaizu-3d9j</link>
      <guid>https://dev.to/kaerub/reactuserefnoli-jie-wohan-meruekusasaizu-3d9j</guid>
      <description>&lt;h2&gt;
  
  
  document.getElementById vs useRef vs useState
&lt;/h2&gt;

&lt;p&gt;違いはわかりますか…？&lt;br&gt;
いつ使えばいいか迷ったら、ぜひ下記のエクササイズをやってみてください!&lt;/p&gt;

&lt;h2&gt;
  
  
  エクササイズはこちらです：
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://codesandbox.io/s/react-useref-t7pmkn?file=/read.me"&gt;https://codesandbox.io/s/react-useref-t7pmkn?file=/read.me&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;プロジェクトでは４つエクササイズがあります：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;エクササイズ1：src/components/Zero.tsx　（document.getElementById vs useState）&lt;/li&gt;
&lt;li&gt;エクササイズ2：src/components/First.tsx (document.getElementById vs useRef)&lt;/li&gt;
&lt;li&gt;エクササイズ3：src/components/Second.tsx (useRef vs useState：useRefを使いすぎた場合)&lt;/li&gt;
&lt;li&gt;エクササイズ4：src/components/Third.tsx (useRef vs useState：不要なレンダリング防ぎ方)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;read.meを参考にしてください。&lt;/p&gt;

&lt;h2&gt;
  
  
  回答はこちらになります：
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://codesandbox.io/s/react-hooks-good-answers-6mhjcz?file=/read.me"&gt;https://codesandbox.io/s/react-hooks-good-answers-6mhjcz?file=/read.me&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>useref</category>
      <category>usestate</category>
    </item>
    <item>
      <title>Hole in Highchart Stacked Chart</title>
      <dc:creator>Agata</dc:creator>
      <pubDate>Sun, 02 Oct 2022 07:44:12 +0000</pubDate>
      <link>https://dev.to/kaerub/hole-in-highchart-stacked-chart-1on9</link>
      <guid>https://dev.to/kaerub/hole-in-highchart-stacked-chart-1on9</guid>
      <description>&lt;h2&gt;
  
  
  Sample problem
&lt;/h2&gt;

&lt;p&gt;Let's imagine we want to create a stacked chart showing a state of a group of 30 robots. Some robots are working (live state), some are switched off (dead state). &lt;br&gt;
Let's have two series for both states:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Live series: [[t1, 30], [t2, 0], [t3, 30]]&lt;/li&gt;
&lt;li&gt;Dead series: [[t2, 30]]&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We want to catch on the graph the moment t2, when robots are in dead state. Let's see what we get on the graph:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe8k278argloxxwe9ghxp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe8k278argloxxwe9ghxp.png" alt="No data painted for red series?" width="800" height="387"&gt;&lt;/a&gt;&lt;br&gt;
We don't see any data for red "dead" series. When we hover over the chart we can find the point when all robots are in dead state, but it's not visible for us at the first glance.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codesandbox.io/s/area-chart-with-hole-problem-5cov88?file=/src/index.js" rel="noopener noreferrer"&gt;Link to live example&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Reason
&lt;/h2&gt;

&lt;p&gt;Let's analyze our points on the following picture.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk3h8l6u4fdvlkr4w5nil.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk3h8l6u4fdvlkr4w5nil.png" alt="Reason - the series has only one data point" width="800" height="263"&gt;&lt;/a&gt;&lt;br&gt;
By default, Highcharts don't show single data points. That's why the red "dead" series is not visible. &lt;/p&gt;

&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;p&gt;If we have in one series more than one point, then it will be displayed. For example, we could add to red series the follwing points to get the desired shape:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dead series: [[t1, 0], [t2, 30], [t3, 0]]
Or - to distinguish points added by ourselves:&lt;/li&gt;
&lt;li&gt;Dead series: [[t1, Number.EPSILON], [t2, 30], [t3, Number.EPSILON]]&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Number.EPSILON is used here, because it's a number near zero that would never ever be in our dataset, thus it would be easy to filter it out in tooltip if necessary (we add some data here only for visualization, so in some cases it's not good to show it to the user in a tooltip). &lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhl2p8d0ot444bacdhaw6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhl2p8d0ot444bacdhaw6.png" alt="If a red series have more than one data point - area will be printed" width="800" height="299"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Final result
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsjww8xoents8e7up5lqz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsjww8xoents8e7up5lqz.png" alt="Image description" width="800" height="293"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codesandbox.io/s/stacked-area-chart-with-hole-problem-fixed-qrde4h?file=/src/index.js:418-460" rel="noopener noreferrer"&gt;Link to live example&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we can see clearly when all 30 robots were not working.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>3 Tips to Make Your UI Better - Tables</title>
      <dc:creator>Agata</dc:creator>
      <pubDate>Fri, 19 Aug 2022 17:43:00 +0000</pubDate>
      <link>https://dev.to/kaerub/3-tips-to-make-your-ui-better-tables-5d85</link>
      <guid>https://dev.to/kaerub/3-tips-to-make-your-ui-better-tables-5d85</guid>
      <description>&lt;p&gt;If you are a frontend developer and create some tables/grids, keep in mind the following 3 simple tips so the outcome is more readable for your users:&lt;/p&gt;

&lt;h2&gt;
  
  
  Tip 1 - format and use monospaced fonts for numbers
&lt;/h2&gt;

&lt;p&gt;Imagine that you have a table like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn9a2yg1jxlj7wpb4l6jv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn9a2yg1jxlj7wpb4l6jv.png" alt="Image description" width="800" height="192"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The column &lt;em&gt;No of items&lt;/em&gt; is hard to read - can you tell what is the number 9111111 at first glance? Let’s format it:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh2w7tmeyhcwmqprifgqc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh2w7tmeyhcwmqprifgqc.png" alt="Image description" width="800" height="209"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Much better, but if you look at 9 111 111 and 1 999 999 in the table, the length of the 1 999 999 is much bigger and makes an illusion that 1 999 999 is greater than 9 111 111. It’s because the width of 1 and 9 in the chosen font is different. Let’s fix it with a monospaced font (all characters in such a font have the same width):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxpzgv5b7413nl4wdrzaw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxpzgv5b7413nl4wdrzaw.png" alt="Image description" width="800" height="286"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The numbers are now easy to compare but the text became also monospaced. Unlike in the case of numbers, text is more readable without a monospaced font. There are fonts that are monospaced for numbers but not for other characters - let’s see the result:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgmlfvnuxwe5g9j7bk53z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgmlfvnuxwe5g9j7bk53z.png" alt="Image description" width="800" height="223"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Tip 2 - proper alignment in header and columns
&lt;/h2&gt;

&lt;p&gt;Let’s consider such an example:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fco0hia7mcxnwcilh80oi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fco0hia7mcxnwcilh80oi.png" alt="Image description" width="800" height="204"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see, the alignment is a bit strange. &lt;/p&gt;

&lt;h4&gt;
  
  
  Alignment in columns
&lt;/h4&gt;

&lt;p&gt;Let’s start with correcting the alignment in columns:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;align to left: text&lt;/li&gt;
&lt;li&gt;align to right: numbers - because it’s easier to compare the numbers this way&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvcaisvpamc2db9kalyz5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvcaisvpamc2db9kalyz5.png" alt="Image description" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What about centering in columns?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbtvqjcffx8sueo1n04ua.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbtvqjcffx8sueo1n04ua.png" alt="Image description" width="800" height="343"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It’s ok for columns with values of the same length (like “Sent”) but not recommended for other cases (like numbers and text with various length) because it’s much less readable.&lt;/p&gt;

&lt;h4&gt;
  
  
  Alignment in headers
&lt;/h4&gt;

&lt;p&gt;General rule for alignment in headers is to fit the alignment in its column:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2k1xvn8sfwmqxqfr1bib.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2k1xvn8sfwmqxqfr1bib.png" alt="Image description" width="800" height="529"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It’s clear what the header is corresponding to.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tip 3 - don’t overuse colors and lines
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fww6tbl5dzmgphokl8oc9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fww6tbl5dzmgphokl8oc9.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It’s good to use delicate colors to make it easier to follow data in a row but too many lines make the look less readable and a bit old-fashioned.  &lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;From my experience, a neat and readable table should follow at least the following tips (of course there are many exceptions, I’m generalizing 🙂 ):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;for numbers - use monospaced font, for text - use not monospaced font,&lt;/li&gt;
&lt;li&gt;numbers should be aligned to right, text to left,&lt;/li&gt;
&lt;li&gt;colors shouldn’t bring users attention but the data should be easy to track in rows and columns.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thanks for reading! &lt;/p&gt;

</description>
      <category>design</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>[Performance] Drawing 300 stacked series with 60 000 points in Highcharts’s Highstock charts</title>
      <dc:creator>Agata</dc:creator>
      <pubDate>Sun, 14 Aug 2022 13:48:00 +0000</pubDate>
      <link>https://dev.to/kaerub/performance-drawing-300-stacked-series-with-60-000-points-in-highchartss-highstock-charts-22ja</link>
      <guid>https://dev.to/kaerub/performance-drawing-300-stacked-series-with-60-000-points-in-highchartss-highstock-charts-22ja</guid>
      <description>&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;Highcharts is a charting library for JavaScript projects ( &lt;a href="https://www.highcharts.com/" rel="noopener noreferrer"&gt;see more&lt;/a&gt; ). It offers various types of charts, the API is very intuitive to use, the documentation is also clear and the Highcharts Team is always ready to help.&lt;br&gt;
Although, working with huge data sets can be quite demanding. In this article, let me introduce some general performance improvement solutions and one for Highstock stacked charts.&lt;/p&gt;

&lt;h2&gt;
  
  
  General performance improvement solutions
&lt;/h2&gt;

&lt;p&gt;Performance can be improved by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Switching off animations&lt;/li&gt;
&lt;li&gt;Switching off series in navigator&lt;/li&gt;
&lt;li&gt;Using Data grouping&lt;/li&gt;
&lt;li&gt;Using Boost module&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For React users, don’t forget to control re-rendering - use shouldComponentUpdate / useMemo / useEffect etc. Re-rendering the whole chart with a huge data set can be quite time consuming 🙂 &lt;/p&gt;

&lt;h2&gt;
  
  
  Highstock stacked AREA chart performance problem
&lt;/h2&gt;

&lt;h4&gt;
  
  
  Requirements
&lt;/h4&gt;

&lt;p&gt;My task was to create a chart with following requirements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use Highcharts stock stacked chart&lt;/li&gt;
&lt;li&gt;Display about 300 series (about 60 000 points)&lt;/li&gt;
&lt;li&gt;Series with various lengths (some series have about 4 000 data points, some can have about 10)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I was quite sad to find out it’s barely usable - it takes about 10 seconds to navigate in the bottom navigation bar ( &lt;a href="https://codesandbox.io/s/area-chart-300-series-no-performance-improvements-final-m9kddc?file=/src/index.js" rel="noopener noreferrer"&gt;Live demo&lt;/a&gt; ).&lt;/p&gt;

&lt;h4&gt;
  
  
  Data Grouping
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://www.highcharts.com/docs/stock/data-grouping" rel="noopener noreferrer"&gt;Data grouping replaces a sequence of data points in a series with one grouped point.&lt;/a&gt; &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I tried to improve the performance with data grouping but I wasn't satisfied with the results. Here's why ( &lt;a href="https://codesandbox.io/s/area-chart-300-series-data-grouping-final-cq6g4c?file=/src/series_serials.js:0-4930484" rel="noopener noreferrer"&gt;Live demo&lt;/a&gt; ) :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigation with the bottom navigation bar works much faster but it still freezes for about 2 seconds. &lt;/li&gt;
&lt;li&gt;The data is flatter which leads to hiding spikes in data.
Exemple 1: Before - without data grouping:
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa1t2ppuujrvmesitixoy.png" alt="Before - without data grouping" width="800" height="317"&gt;
Exemple 1: After - with data grouping:
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Focwgliohgyfe7y29uv4x.png" alt="Image description" width="800" height="333"&gt;
Example 2 (data spike): Before - without data grouping - the spike is at about 1000M 
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhgnlpul3iqayt8bnn25b.png" alt="Image description" width="800" height="374"&gt;
Example 2 (data spike): After - with data grouping - the spike doesn’t reach 1000M
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F478ij3y0klp8kkkatq9m.png" alt="Image description" width="800" height="404"&gt; &lt;/li&gt;
&lt;li&gt;Also, with data grouping I have observed weird shapes that didn’t stack properly, but I didn’t dig into it further.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqea7gfowmizwwkjb0wxe.png" alt="Image description" width="800" height="407"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I needed some faster and more precise visualization so I gave up on data grouping and tried out the Boost module.&lt;/p&gt;

&lt;h2&gt;
  
  
  Boost module
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://www.highcharts.com/docs/advanced-chart-features/boost-module" rel="noopener noreferrer"&gt;focuses on handling and rendering as many data points as possible as quickly as possible&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Also boost module didn't fit my data set:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The rendering time was’t perfect as well, as you can see in the &lt;a href="https://codesandbox.io/s/highstock-area-chart-300-series-boost-module-final-sgnlol" rel="noopener noreferrer"&gt;Live example&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Sadly, as you read in &lt;a href="https://www.highcharts.com/docs/advanced-chart-features/boost-module#caveats" rel="noopener noreferrer"&gt;the documentation&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;The area of area and areaspline series are drawn as 1px columns.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It’s not perfectly suited to area charts. In short - my data set looked like that:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwffji2228hpq4co383fc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwffji2228hpq4co383fc.png" alt="Image description" width="800" height="338"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Because my series had various lengths it was hard to adjust the boost parameters. There are two parameters to do so:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://api.highcharts.com/highcharts/boost.seriesThreshold" rel="noopener noreferrer"&gt;seriesThreshold&lt;/a&gt;- a threshold which describe the minimal number of series to start rendering in boost mode, eg. if you have it set to 20 and you have 10 series the chart will never render with the boost module (it seems like it also counts series in navigator).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://api.highcharts.com/highcharts/plotOptions.series.boost" rel="noopener noreferrer"&gt;boostThreshold&lt;/a&gt; - a threshold which for a single series describes when to enter the boost mode. For example if you have displayed a part of series &lt;em&gt;a&lt;/em&gt; with 100 points, second series &lt;em&gt;b&lt;/em&gt; with 10 points, and boostThreshold = 50, the boost mode will be active only for the series with &lt;em&gt;a&lt;/em&gt; with 100 points. &lt;br&gt;
In my case most of the series were short, so I had to use a low value of boostThreshold to enable it on the short series and increase performance. This way, when I zoomed in the chart with the navigator, the boost mode was enabled constantly (because the displayed part of the series always had more than the boostThreshold number) showing the 1px width columns with a lot of blank space.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F55917nrqdrzqxrzgkaiq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F55917nrqdrzqxrzgkaiq.png" alt="Image description" width="800" height="332"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For my dataset it was a useless module but it works great with line charts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final solution - switching to stacked LINE chart
&lt;/h2&gt;

&lt;p&gt;I decided to change the approach. I changed the area chart to a line chart and the performance problem was fixed (&lt;a href="https://codesandbox.io/s/highstock-line-stacked-chart-result-final-0nyi8q?file=/src/index.js" rel="noopener noreferrer"&gt;Live demo&lt;/a&gt;)!&lt;/p&gt;

&lt;p&gt;But… another problem approached me 🙂&lt;/p&gt;

&lt;h4&gt;
  
  
  Disorder of series problem
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyq3ftyevei04gjoikcq8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyq3ftyevei04gjoikcq8.png" alt="Image description" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see in the &lt;a href="https://codesandbox.io/s/highstock-line-stacked-chart-sudden-change-in-order-of-series-final-opzhs4?file=/src/problematicSeries.js" rel="noopener noreferrer"&gt;live demo&lt;/a&gt; and the picture above, the order of series is wrong (it's changed) at Jun 10, 14:15:18 - green series with name “b” goes under yellow series “c” instead of stacking on the top of them giving an illusion that the value drops suddenly. &lt;/p&gt;

&lt;p&gt;Why is it happening? Because of a lack of a data point in series “a” at Jun 10, 14:15:18. &lt;/p&gt;

&lt;p&gt;Solution: add a point that has a null value at Jun 10, 14:15:18. This will prevent the series from changing order ( &lt;a href="https://codesandbox.io/s/highstock-line-stacked-chart-sudden-change-in-order-of-series-solved-final-hr5jwx?file=/src/problematicSeries.js" rel="noopener noreferrer"&gt;Live demo&lt;/a&gt; ).&lt;/p&gt;

&lt;h2&gt;
  
  
  Final word
&lt;/h2&gt;

&lt;h4&gt;
  
  
  Note about initial loading time of each chart type
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://codesandbox.io/s/area-chart-300-series-no-performance-improvements-final-m9kddc?file=/src/index.js:1306-1392" rel="noopener noreferrer"&gt;Stacked Area chart without improvements&lt;/a&gt;: about &lt;strong&gt;7 468 ms&lt;/strong&gt; (7s is way too long!)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://codesandbox.io/s/area-chart-300-series-data-grouping-final-cq6g4c?file=/src/index.js" rel="noopener noreferrer"&gt;Stacked Area chart with Data Grouping&lt;/a&gt;: 885 ms&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://codesandbox.io/s/highstock-area-chart-300-series-boost-module-final-sgnlol?file=/src/index.js" rel="noopener noreferrer"&gt;Stacked Area chart with Boost Module&lt;/a&gt;: 745 ms&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://codesandbox.io/s/highstock-line-stacked-chart-result-final-0nyi8q?file=/src/index.js" rel="noopener noreferrer"&gt;Stacked Line chart without improvements&lt;/a&gt;: 716 ms&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The fastest is definitely the Line chart, also it's visible that navigating on this chart is the fastest. &lt;/p&gt;

&lt;p&gt;Performance is a very important matter and it was worth spending some time on investigating possible improvement methods. I hope you can find some hints for your data visualizations here!&lt;/p&gt;

&lt;p&gt;Also, I would like to thank the Highcharts Team for their support in resolving the issue with wrong series ordering in stacked line chart.&lt;/p&gt;

</description>
      <category>performance</category>
      <category>highcharts</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
