{"id":6972,"date":"2019-12-05T15:15:06","date_gmt":"2019-12-05T12:15:06","guid":{"rendered":"https:\/\/dhtmlx.com\/blog\/?p=6972"},"modified":"2026-04-03T15:41:12","modified_gmt":"2026-04-03T12:41:12","slug":"javascripthtml5-line-spline-charts-effective-forecasting","status":"publish","type":"post","link":"https:\/\/dhtmlx.com\/blog\/javascripthtml5-line-spline-charts-effective-forecasting\/","title":{"rendered":"JavaScript\/HTML5 Line &#038; Spline Charts for Effective Forecasting"},"content":{"rendered":"<p>\n        <div class=\"info-block\">\n            <div class=\"info-icon\">\n                <svg viewBox=\"0 0 14 16\">\n                    <path fill-rule=\"evenodd\" d=\"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z\"><\/path>\n                <\/svg>\n\n                INFO\n            <\/div>\n\n            <div class=\"info-content\">\n                <p>\n                    If you are using an outdated version of DHTMLX Suite 5 and require the documentation for it, \n                    please <a href=\"https:\/\/dhtmlx.com\/docs\/contact.shtml\" title=\"\">contact us<\/a>, <br \/>and we will send it to you.\n                <\/p>\n            <\/div>\n        <\/div>\n    <br \/>\n<em>This article is a part of the series about <a href=\"https:\/\/dhtmlx.com\/docs\/products\/dhtmlxChart\/\" rel=\"noopener\" target=\"_blank\">DHTMLX JavaScript and HTML5 Charts<\/a> &#8211; providing insights and best practices for the most popular graph types. Today, we&#8217;ll try to find out what a line chart is used for and what design tricks are needed to provide a better user experience.<\/em> <\/p>\n<p><em>Test our charting library during a <a href=\"https:\/\/dhtmlx.com\/docs\/products\/dhtmlxChart\/download.shtml\" rel=\"noopener\" target=\"_blank\">30-day free trial<\/a> period.<\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2019\/12\/line-chart-dhtmlx.png\" alt=\"JavaScirpt Line Chart by DHTMLX\" width=\"1089\" height=\"446\" class=\"aligncenter size-full wp-image-6983\" srcset=\"https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2019\/12\/line-chart-dhtmlx.png 1089w, https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2019\/12\/line-chart-dhtmlx-300x123.png 300w, https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2019\/12\/line-chart-dhtmlx-768x315.png 768w, https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2019\/12\/line-chart-dhtmlx-1024x419.png 1024w\" sizes=\"auto, (max-width: 1089px) 100vw, 1089px\" \/><\/p>\n<p>A series of data points, joined by a line in a dot-to-dot fashion, can show startling results along its peaks and valleys. A simple line chart has the power to display the dynamic, highlight successes, and warn about potential dangers &#8211; all in seconds.<\/p>\n<p>Horizontal line charts are primarily used for displaying <strong>behavior over a period of time<\/strong>: technology trends by a year, price dynamics over a quarter, website page visits per hour, and so on. In most cases, the way the data is trending <strong>allows predicting easily the results<\/strong> of data not yet recorded.<\/p>\n<p>The time unit (years, months, days, etc.) is distributed evenly along the horizontal x-axis. The magnitude of each data element in the series is represented by its position on the vertical y-axis.<\/p>\n<h5>Specificities of a JavaScript Dynamic Line Chart<\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2019\/12\/dynamic-javascript-charts.gif\" alt=\"Dynamic Live Chart\" width=\"1295\" height=\"473\" class=\"aligncenter size-full wp-image-6973\" \/><br \/>\n<a href=\"https:\/\/docs.dhtmlx.com\/suite\/samples\/chart\/03_usage\/02_add_points.html\" rel=\"noopener\" target=\"_blank\">Check the sample ><\/a><\/p>\n<p>Dynamic or real-time charts are useful in displaying data that changes with time like a stock price, exchange rate, etc. These graphs are interactive, support animation and live updates.<\/p>\n<h5>Keys to Create a Simple JavaScript Line Chart<\/h5>\n<h6>Consider Adding Data Comparison<\/h6>\n<p>It&#8217;s possible to include more than one line on the same axis. Thus, for instance, you can compare the number of tasks completed by each team for a certain period of time. Such a horizontal line graph depicts the totals with a separate line for a team.<\/p>\n<p>However, if you&#8217;re building a multiple line chart, do not match too many data series. Graphs with more than 5 lines usually become cluttered and hard to understand.<\/p>\n<h6>Prefer Contrasting Colors for Multiple Lines<\/h6>\n<p>Users should not spend too much time trying to perceive your graph clearly. So when you draw a JavaScript line chart with multiple items, set clear contrasting colors. The color difference allows viewers to capture the aha moment quickly.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2019\/12\/line-chart.png\" alt=\"Simple Line Chart\" width=\"1077\" height=\"563\" class=\"aligncenter size-full wp-image-6974\" srcset=\"https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2019\/12\/line-chart.png 1077w, https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2019\/12\/line-chart-300x157.png 300w, https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2019\/12\/line-chart-768x401.png 768w, https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2019\/12\/line-chart-1024x535.png 1024w\" sizes=\"auto, (max-width: 1077px) 100vw, 1077px\" \/><br \/>\n<a href=\"https:\/\/docs.dhtmlx.com\/suite\/samples\/chart\/02_configuration\/08_legend.html\" rel=\"noopener\" target=\"_blank\">Check the sample ><\/a><\/p>\n<p>The palette you choose should be pleasing to look at. We recommend avoiding jarring and eyesore colors as well as variations of the same shade. If you have to build a JS line chart for a dashboard or business report, select a few brand colors harmonizing with each other. <\/p>\n<h6>Do Not Overwhelm Your JavaScript Line Chart with Text<\/h6>\n<p>When you add the text content, don&#8217;t be tempted to overcrowd the chart with too many symbols. There&#8217;s no need to mark every value on the x-axis and include all the data you have about the chart. Try to avoid bulky legends, paragraphs of texts, and multiple axis labels.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2019\/12\/tooltips.gif\" alt=\"Line Chart Tooltip\" width=\"1334\" height=\"560\" class=\"aligncenter size-full wp-image-6975\" \/><\/p>\n<p>Instead, you need readable titles and labels. The axis&#8217; intervals have to be spaced evenly. Use special marks to label specific numbers that make sense for your datasets. Moreover, you can <a href=\"https:\/\/docs.dhtmlx.com\/suite\/samples\/chart\/02_configuration\/10_tooltip_template.html\" rel=\"noopener\" target=\"_blank\">add tooltips<\/a> to show the values when a user hovers over the data items.<\/p>\n<h5>Alternatives to a JS Horizontal Line Chart<\/h5>\n<p>We should note that line charts are not suitable for all kinds of data. For example, they fail in demonstrating percentages and proportions. Instead, consider choosing a <a href=\"https:\/\/dhtmlx.com\/blog\/javascript-pie-chart-use-properly\/\" rel=\"noopener\" target=\"_blank\">pie chart<\/a>. If you want to show how values differ in various categories or at the same time intervals, consider using <a href=\"https:\/\/dhtmlx.com\/blog\/javascript-bar-chart-exploring-data-visualization-techniques\/\" rel=\"noopener\" target=\"_blank\">JavaScript bar charts<\/a>.<\/p>\n<h6>Differences Between a Line Graph and Spline Chart<\/h6>\n<p>Are you looking for a way to display changes over time that isn&#8217;t a line graph? Then you may experiment with a JavaScript\/HTML5 spline chart. Line and spline charts are deeply related, the only difference is that the spline includes a fitted curve linking each data point in a series.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2019\/06\/Spline-chart.png\" alt=\"JavaScript Spline Chart by DHTMLX\" width=\"902\" height=\"442\" class=\"aligncenter size-full wp-image-6362\" srcset=\"https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2019\/06\/Spline-chart.png 902w, https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2019\/06\/Spline-chart-300x147.png 300w, https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2019\/06\/Spline-chart-768x376.png 768w\" sizes=\"auto, (max-width: 902px) 100vw, 902px\" \/><br \/>\n<a href=\"https:\/\/docs.dhtmlx.com\/suite\/samples\/chart\/01_init\/03_init_spline.html\" rel=\"noopener\" target=\"_blank\">Check the sample ><\/a><\/p>\n<h5>Why Choose DHTMLX JavaScript Visualization Library to Build a Line Chart<\/h5>\n<p>Our JavaScript charting library provides a simple and convenient way to integrate 10+ chart types into your web applications and interfaces. You can create Bar and X-Bar, Line and Spline, Area and Spline Area, Pie and Donut, Radar and Scatter graphs. Some of them have 3D variations.<\/p>\n<h6>Modern Design<\/h6>\n<p>DHTMLX follows the guidelines of a <strong>Material Design<\/strong> styling. We&#8217;ll help you build scalable web interfaces with a user-friendly look and feel.<\/p>\n<h6>Rich Configuration<\/h6>\n<p>A comprehensive DHTMLX <a href=\"https:\/\/docs.dhtmlx.com\/suite\/chart\/api\/api_overview\/\" rel=\"noopener\" target=\"_blank\">Chart API<\/a> allows configuring any element to achieve the desired appearance without a hitch. For instance, you can <a href=\"https:\/\/docs.dhtmlx.com\/suite\/chart\/usage\/\" rel=\"noopener\" target=\"_blank\">add multiple data items<\/a> into your dynamic line chart. A new item will appear along the x-axis.<\/p>\n<div class=\"codecolorer-container javascript default\" style=\"overflow:auto;white-space:nowrap;height:600px;\"><div class=\"javascript codecolorer\"><span class=\"kw1\">var<\/span> config <span class=\"sy0\">=<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; type<span class=\"sy0\">:<\/span><span class=\"st0\">&quot;line&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; scales<span class=\"sy0\">:<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"st0\">&quot;bottom&quot;<\/span> <span class=\"sy0\">:<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; text<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;text&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; showText<span class=\"sy0\">:<\/span> <span class=\"kw2\">false<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"st0\">&quot;left&quot;<\/span> <span class=\"sy0\">:<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; maxTicks<span class=\"sy0\">:<\/span> <span class=\"nu0\">10<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; max<span class=\"sy0\">:<\/span> <span class=\"nu0\">100<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; min<span class=\"sy0\">:<\/span> <span class=\"nu0\">0<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; series<span class=\"sy0\">:<\/span> <span class=\"br0\">&#91;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; value<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;value&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; color<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;#5E83BA&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; strokeWidth<span class=\"sy0\">:<\/span> <span class=\"nu0\">2<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#93;<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp;<br \/>\n<span class=\"kw1\">var<\/span> chart <span class=\"sy0\">=<\/span> <span class=\"kw1\">new<\/span> dhx.<span class=\"me1\">Chart<\/span><span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot;chart&quot;<\/span><span class=\"sy0\">,<\/span> config<span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\nchart.<span class=\"me1\">data<\/span>.<span class=\"me1\">parse<\/span><span class=\"br0\">&#40;<\/span><span class=\"br0\">&#91;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; value<span class=\"sy0\">:<\/span> <span class=\"kw4\">Math<\/span>.<span class=\"me1\">random<\/span><span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span> <span class=\"sy0\">*<\/span> <span class=\"nu0\">100<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; text<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;u&quot;<\/span> <span class=\"sy0\">+<\/span> <span class=\"kw4\">Date<\/span>.<span class=\"me1\">now<\/span><span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span> <span class=\"sy0\">+<\/span> <span class=\"nu0\">1<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; value<span class=\"sy0\">:<\/span> <span class=\"kw4\">Math<\/span>.<span class=\"me1\">random<\/span><span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span> <span class=\"sy0\">*<\/span> <span class=\"nu0\">100<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; text<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;u&quot;<\/span> <span class=\"sy0\">+<\/span> <span class=\"kw4\">Date<\/span>.<span class=\"me1\">now<\/span><span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span> <span class=\"sy0\">+<\/span> <span class=\"nu0\">2<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; value<span class=\"sy0\">:<\/span> <span class=\"kw4\">Math<\/span>.<span class=\"me1\">random<\/span><span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span> <span class=\"sy0\">*<\/span> <span class=\"nu0\">100<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; text<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;u&quot;<\/span> <span class=\"sy0\">+<\/span> <span class=\"kw4\">Date<\/span>.<span class=\"me1\">now<\/span><span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span> <span class=\"sy0\">+<\/span> <span class=\"nu0\">3<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n<span class=\"br0\">&#93;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n<span class=\"kw1\">function<\/span> add<span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; chart.<span class=\"me1\">data<\/span>.<span class=\"me1\">add<\/span><span class=\"br0\">&#40;<\/span><span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; value<span class=\"sy0\">:<\/span> <span class=\"kw4\">Math<\/span>.<span class=\"me1\">random<\/span><span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span> <span class=\"sy0\">*<\/span> <span class=\"nu0\">100<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; text<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;u&quot;<\/span> <span class=\"sy0\">+<\/span> <span class=\"kw4\">Date<\/span>.<span class=\"me1\">now<\/span><span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><span class=\"sy0\">;<\/span><\/div><\/div>\n<p>You can <a href=\"https:\/\/docs.dhtmlx.com\/suite\/chart\/configuration_properties\/\" rel=\"noopener\" target=\"_blank\">enable a legend and define its position<\/a>. Indeed it should be available if your goal is to display more than one data series. The legend will provide information about the tracked data to help your users translate the graph.<\/p>\n<div class=\"codecolorer-container javascript default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"javascript codecolorer\"><span class=\"kw1\">var<\/span> chart <span class=\"sy0\">=<\/span> <span class=\"kw1\">new<\/span> dhx.<span class=\"me1\">Chart<\/span><span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot;chart_container&quot;<\/span><span class=\"sy0\">,<\/span><span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; scales<span class=\"sy0\">:<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co1\">\/\/ scales config<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; series<span class=\"sy0\">:<\/span> <span class=\"br0\">&#91;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co1\">\/\/ list of series <\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#93;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; legend<span class=\"sy0\">:<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; series<span class=\"sy0\">:<\/span> <span class=\"br0\">&#91;<\/span><span class=\"st0\">&quot;A&quot;<\/span><span class=\"sy0\">,<\/span> <span class=\"st0\">&quot;B&quot;<\/span><span class=\"sy0\">,<\/span> <span class=\"st0\">&quot;C&quot;<\/span><span class=\"br0\">&#93;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; valign<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;top&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; halign<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;right&quot;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span> &nbsp; &nbsp;<br \/>\n<span class=\"br0\">&#125;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><\/div><\/div>\n<p>The API allows <a href=\"https:\/\/docs.dhtmlx.com\/suite\/chart\/configuration_properties\/\" rel=\"noopener\" target=\"_blank\">configuring a scale<\/a> and setting a title for it. Besides, you can <a href=\"https:\/\/docs.dhtmlx.com\/suite\/chart\/configuration_properties\/\" rel=\"noopener\" target=\"_blank\">add a threshold line<\/a> at any defined level to look for the particular value.<\/p>\n<div class=\"codecolorer-container javascript default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"javascript codecolorer\"><span class=\"kw1\">var<\/span> chart <span class=\"sy0\">=<\/span> <span class=\"kw1\">new<\/span> dhx.<span class=\"me1\">Chart<\/span><span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot;chart_container&quot;<\/span><span class=\"sy0\">,<\/span><span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; type<span class=\"sy0\">:<\/span><span class=\"st0\">&quot;line&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; scales<span class=\"sy0\">:<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"st0\">&quot;bottom&quot;<\/span> <span class=\"sy0\">:<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; text<span class=\"sy0\">:<\/span> <span class=\"st0\">'month'<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"st0\">&quot;left&quot;<\/span> <span class=\"sy0\">:<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; padding<span class=\"sy0\">:<\/span> <span class=\"nu0\">10<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; max<span class=\"sy0\">:<\/span> <span class=\"nu0\">90<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; series<span class=\"sy0\">:<\/span> <span class=\"br0\">&#91;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;value<span class=\"sy0\">:<\/span> <span class=\"st0\">'company A'<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;strokeWidth<span class=\"sy0\">:<\/span> <span class=\"nu0\">2<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class=\"co1\">\/\/ more options &nbsp; <\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#93;<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><\/div><\/div>\n<p>Plus, our users can <a href=\"https:\/\/docs.dhtmlx.com\/suite\/chart\/configuration_properties\/\" rel=\"noopener\" target=\"_blank\">set maximum points<\/a> to show an average number of values if your data is too large to display all the values in the chart.<\/p>\n<div class=\"codecolorer-container javascript default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"javascript codecolorer\"><span class=\"kw1\">var<\/span> chart <span class=\"sy0\">=<\/span> <span class=\"kw1\">new<\/span> dhx.<span class=\"me1\">Chart<\/span><span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot;chart&quot;<\/span><span class=\"sy0\">,<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; type<span class=\"sy0\">:<\/span><span class=\"st0\">&quot;line&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; maxPoints<span class=\"sy0\">:<\/span><span class=\"nu0\">100<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><\/div><\/div>\n<p><a href=\"https:\/\/docs.dhtmlx.com\/suite\/samples\/chart\/02_configuration\/12_max_points.html\" rel=\"noopener\" target=\"_blank\">Check the sample ><\/a><\/p>\n<h6>Simple Customization<\/h6>\n<p>DHTMLX Charting library lets you modify several aspects of the chart&#8217;s appearance. You can <a href=\"https:\/\/docs.dhtmlx.com\/suite\/samples\/chart\/02_configuration\/13_point_types.html\" rel=\"noopener\" target=\"_blank\">set the type of the point of the data item<\/a> (circle, triangle, rectangular or rhombus state) and define its color. Series lines can be repainted and dashed. Moreover, developers can add new CSS classes in case they need specific options.<\/p>\n<h5>Conclusion<\/h5>\n<p>A line chart is a powerful data visualization tool for many different areas, including finance, marketing, and project management. It is extremely effective for monitoring trends over a certain period of time and making predictions. If two or more lines are on the graph, it can be used as a comparison between them.<\/p>\n<p>DHTMLX Chart component is a part of the <a href=\"https:\/\/dhtmlx.com\/docs\/products\/dhtmlxSuite\/\" rel=\"noopener\" target=\"_blank\">JavaScript widget library<\/a> &#8211; DHTMLX Suite. You can download a dhtmlxChart <a href=\"https:\/\/dhtmlx.com\/docs\/products\/dhtmlxChart\/download.shtml\" rel=\"noopener\" target=\"_blank\">free trial version<\/a> as well as estimate a complete Suite kit with 20+ UI widgets included. <\/p>\n<p>Our advanced solutions allow building rich web interfaces that are compatible with all modern browsers. Plus, we offer examples of smooth integration into applications based on React, Angular, and Vue.JS. <\/p>\n<p>Access our <a href=\"https:\/\/docs.dhtmlx.com\/suite\/chart\/\" rel=\"noopener\" target=\"_blank\">documentation<\/a> to get more information about dhtmlxChart features. <\/p>\n<p>If you have questions for our team or want to share your opinion, do not hesitate to <a href=\"https:\/\/dhtmlx.com\/docs\/contact.shtml\" rel=\"noopener\" target=\"_blank\">contact us<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article is a part of the series about DHTMLX JavaScript and HTML5 Charts &#8211; providing insights and best practices for the most popular graph types. Today, we&#8217;ll try &#8230;<\/p>\n","protected":false},"author":101013,"featured_media":6978,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[72,1],"tags":[33,21,10],"class_list":["post-6972","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-general","category-uncategorized","tag-all-posts","tag-charts","tag-dhtmlxsuite"],"_links":{"self":[{"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/posts\/6972","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/users\/101013"}],"replies":[{"embeddable":true,"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/comments?post=6972"}],"version-history":[{"count":10,"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/posts\/6972\/revisions"}],"predecessor-version":[{"id":15371,"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/posts\/6972\/revisions\/15371"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/media\/6978"}],"wp:attachment":[{"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/media?parent=6972"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/categories?post=6972"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/tags?post=6972"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}