score:0
i think you cannot draw a line using chart.js the best solution would be a shift to d3 charts where you can make custom charts lines etc..
you can create a line using d3 as below
var svgcontainer = d3.select("body").append("svg")
.attr("width", 200)
.attr("height", 200);
var circle = svgcontainer.append("line")
.attr("x1", 5)
.attr("y1", 5)
.attr("x2", 50)
.attr("y2", 50)
.attr("stroke-width", 2)
.attr("stroke", "black");
Source: stackoverflow.com
Related Query
- chart.js - user add the final point of the line
- Add a text as tooltip for each point on a line chart
- How to change the chart line or area colors according to the user need?
- How to get rid of the line on top of every point on a line chart (Chart.js)
- chart.js Line chart doesn't display line past a certain point in the chart
- Add space between point of the chart and of the border chart in react-chartjs-2
- How to add text inside the doughnut chart using Chart.js?
- Remove the vertical line in the chart js line chart
- Moving vertical line when hovering over the chart using chart.js
- How to add an on click event to my Line chart using Chart.js
- line chart with {x, y} point data displays only 2 values
- Chart.js line chart is cut off at the top?
- How to display Line Chart dataset point labels with Chart.js?
- chartjs show dot point on hover over line chart
- How to add second Y-axis for Bar and Line chart in Chart.js?
- How to add text in centre of the doughnut chart using Chart.js?
- Add all data in the tooltip of Chart JS
- How to align Chart.JS line chart labels to the center
- ChartJS: Draw vertical line at data point on chart on mouseover
- How to hide the y axis and x axis line and label in my bar chart for chart.js
- How can I remove extra whitespace from the bottom of a line chart in chart.js?
- ChartJS - Line chart issue with only 1 point
- How to add a point to chart.js line chart?
- how to programmatically make a line chart point active/highlighted
- ChartJS Line chart cut off at the top and bottom
- Rotate 90 degrees clockwise the scaleLabel (no ticks or labels) on a Chart.js line chart
- How to start the line graph from the left Y axis in a line/bar mixed chart (Chart.js)?
- Chart.js - Color specific parts of the background in a line chart
- How to add gradient background to Line Chart [vue-chart.js]
- Add a custom label to the top or bottom of a stacked bar chart
More Query from same tag
- ChartJS V3 Radar chart Label Font Size
- My chart.js canvas disappears after hide() function
- How to avoid detached HTMLCanvasElements when updating canvas with JavaScript?
- ChartJS - line graph, position tooltip
- Chart.js - hide / remove label on second dataset
- How to set the pointDot option on combo stacked bar-line chart
- Attach data to label (Chart.js & Django 3)
- How to style a pie chart in chart js? I want to change the border color, border width and give them shadow
- Javascript chart display labels
- Chart Js clickable bar
- how to set color of label in chartjs?
- Chart js 2.x renders the canvas invisible
- How to create datasets for all labels for stacked bar in chart.js?
- is there a way to change the dispaly of a date
- How to offset the legends of the bars in a "chart.js" bar chart?
- ChartJS shows date, but not time, when displaying labels in time axis
- chartjs height does not follow parent container
- Reanimate Data Values in CharJS
- chart.js version 3 - How to make an overlapping bar chart?
- Using chart.js, how do I align bars instead of centering them when there are only a few bars to display?
- How do I obtain a Chart instance for Chart.js
- How to put back the data with a switch?
- plot a bar chart.js time series
- How can I automatically rescale the y axis of my log chart using ChartJS?
- JavaScript Chart.JS - issue keeping charts in two rows, instead everything in stacked into one column
- ChartJS - handling of overlapping points in line chart
- How to display stack label/name?
- How to destroy a canvas using Id and add new canvas to the same id
- How to set Chart.js axis minumum to 0?
- How to create a chart that uses strings for both the X and Y axes?