News Articles charts

AMChart datetime implementation

I would like to create a chart with datetime axis in Amchart. The minimum period should be in hours, so I added the minPeriod:"hh". The data is inside the HTML, between tags. I tried with the below function, but I get a blank chart (with white bkackground). What could be the problem? This is how […]

Open source javascript library for chart that uses lib folder (work offline)

I am searching for a OPEN SOURCE javascript chart library that can work offline. That is, it should fetch source code from lib folder and not from any domain. Kindly let me know if you find any such library. Thanks in Advance Source: JavaSript – Stack Overflow

Chart JS & React: displaying old data when hovering

I’ve been facing this issue for 2 or 3 weeks now and I’ve tried everything on stackoverflow to fix it, but it doesn’t seem possible. I have some charts using the chart js library (version 2.9.4) and when I update some data using React Hooks, the old and the new data/charts overlap each other and […]

Chart.js – Multiple JSON data object array [{x: Data, y: count}….] representing each dataset of the chart

I’ve been trying to implement a Stacked Area Line Chart using Chart.js, which in turn uses multiple datasets as an input for each line graph. Although I’am able to view the final stacked chart with the associated dataset, I can clearly notice that y-axis data is falsely represented(hover on data-point) w.r.t x-axis for each dataset, […]

How to set up an initial Zoom value for a chart (ChartJS + ChartJS Zoom plugin)?

I am trying to create a chart that has data for the last 30 days. But I would like to set up the initial Zoom value for the small screen sizes. So, the chart would display on mobile not all 30 values but rather 5 or 10. And I can just pan or zoom out […]

Detecting and displaying interval overlaps on a bar chart

I am trying to modify an existing project, specifically a piece of code displaying bar charts. Currently, there is a reduce function is written as: const ribbonData = R.keys(selectedRibbons).reduce((acc, id) => { const ribbon = ribbons.find(ribbon => ribbon.id === id); if (ribbon) { acc.push(ribbon); } return acc; }, []); return ribbonData.sort((a, b) => a.order – […]

chartjs plugin datalabels does not show value on charts

I’m trying to get the values on each bar with the chartjs datalabels plugin. But it isn’t showing any values. Can anyone help and tell me what’s wrong? I’ve also tried to use different versions of chartjs but it didn’t help. Currently I’m using Chartjs 3.2.0 and for the chartjs-plugin-datalabels 2.0.0 here is an example […]

How to change format of numbers and rotate data numbers in chart js

I want to rotate the numbers of xAsis in chartjs and also remove the gridlines. I want my number formats to be persian numbers. my code doesn’t work. I want something like this photo here is my javascript code: const CanvasElement = document.getElementById("price-chart"); const config = { type: "bar", data:{ labels: dates, datasets: [{ data:prices, […]

How to create a stacked line chart using Apache ECharts using encode

I see this example in Apache ECharts https://echarts.apache.org/examples/en/editor.html?c=line-stack import * as echarts from ‘echarts’; var chartDom = document.getElementById(‘main’); var myChart = echarts.init(chartDom); var option; option = { title: { text: ‘折线图堆叠’ }, tooltip: { trigger: ‘axis’ }, legend: { data: [‘邮件营销’, ‘联盟广告’, ‘视频广告’, ‘直接访问’, ‘搜索引擎’] }, grid: { left: ‘3%’, right: ‘4%’, bottom: ‘3%’, containLabel: […]

ApexCharts: Line graph overflowing out of Y axes

Hope you guys are doing okay. I am working on a line graph from Apex Charts and every thing seems to be working fine except one issue. The lines cross-over/overflows on the y axes whereas they are supposed to stay between the y axes. I have tried adding offsetX to almost everything but it just […]

Hiding labels on y axis in Chart.js 3.5.0 not working

This driving me nuts. I tried all of the stuff here and looked to documentation https://www.chartjs.org/docs/latest/getting-started/v3-migration.html but still not able to remove y-axis labels from bar charts. Here is the part of the code that defines y axis stuff var ctx = document.getElementById(‘myChart’).getContext(‘2d’); var chartOptions = { scales: { y: { display: true } } […]

Ordering the svg elements visually

I have trouble with ordering SVG elements. I wrote a script that takes the ratio of each number in an array to the sum of the numbers in it and creates a pie chart with regard to these numbers. Now, I’m trying to add some animations, but inherently, when I try to scale up the […]

How to create plot on circle graph using chartjs or any other js plugin

How to create a plot on a circle graph using chartjs or any other js plugin. Value example: x-axis = -4 and y-axis = -4 Example of graph Source: CSS – Stack Overflow

How to use segment property to color line / border color based on value in chart js?

I am trying to create a chart with line/border color with different color based on value, like this image, so color change above and below a certain point. I have already went through the segment sample on chartjs docs (https://www.chartjs.org/docs/latest/samples/line/segments.html), but this is using skip and points, whereas I am trying to do this with […]

How to print the date in the Google Chart Timeline

Here my JS using Google Chart Timeline : https://jsbin.com/yiqesal/edit?html,output I can see the hour on my X axis, only. It’s printing when I play with the width range in this line like : <div id="timeline" style="width: 700px"></div> How to print the date of the day in the X axis every 12:00AM in any case ? […]

Need recommendations for Chart library for React [closed]

Need to build dynamic Chart. Need suggestions for that. Source: React – Stack Overflow

Suggestion for building the chart with Reactjs [closed]

Need to build dynamic Chart. Need suggestions for that. Source: React – Stack Overflow

amChart Calculate center coordinates of an arc on Pie Chart

I am currently using this plugin and finding the docs has not much information about getting the center point of a pie chart. After spending days on the docs, I am still not able to find out how to calculate the center point (coordinates) of an arc. The idea is to automatically calculate a triangle […]

Sitemap | Terms | Privacy | Cookies | Advertising

Senior Software Developer

Creator of @LzoMedia I am a backend software developer based in London who likes beautiful code and has an adherence to standards & love's open-source.