score:1
Accepted answer
this is what's needed
data: [{
x: {{ labels2[0] | safe }},
y: {{ values2[0] | safe }}
}, {
x: {{ labels2[1] | safe }},
y: {{ values2[1] | safe }}
}, {
x: {{ labels2[2] | safe }},
y: {{ values2[2] | safe }}
}, {
x: {{ labels2[3] | safe }},
y: {{ values2[3] | safe }}
}]
score:0
if you want multiple line charts on the same graph you will need to put the dataset objects in the datasets array instead of making the chart twice like so:
datasets: [
{
label: 'sweep data',
data: {{ values | safe }},
backgroundcolor: ['red'],
fill: false,
display: true
},
{
label: 'peak data',
data: {{ values2 | safe }},
backgroundcolor: ['black'],
fill: false,
display: true
}
]
Source: stackoverflow.com
Related Query
- Show multiple line graphs on the same chart using chart JS
- show multiple responsive chart in the same page using chart.js
- Chart JS show multiple data points for the same label
- Chart.js -> line chart -> multiple points with the same X
- Moving vertical line when hovering over the chart using chart.js
- Displaying line chart for multiple months using chart.js
- how can i use chart.js to create a chart that has one time series line and one linear line on it at the same time?
- Chart.js 3.5: linear gradient doesn't apply properly when multiple bars in the same chart
- How to show multiple datasets in line chart js
- I am using chart.js I sent my time values throw my api as timestamp know i need to show them in the chart as date format
- Ionic using multiple chart.js canvas in the same page
- How to show tooltip value of all data falling on the same axis in chart js?
- Why is my line chart using multiple lines to connect random points? (Chart.js)
- How to plot a line chart which has both the start and points outside the canvas area using Chart.js
- How to draw multiple color bars in a bar chart along a Horizontal Line using chart.js
- How to show symbols after the label and before the numeric value using chart.js Bar chart in Angular
- Chart.js how to show line chart without displaying the labels on xaxis and yaxis
- Moving vertical line when hovering over the chart using chart.js in v2.9.4
- Show the latest labels in a bar chart with React.js using react-chartjs
- Is it possible to generate multiple chart in Laravel using chartjs ? If possible please give the solution
- I am using chart js to draw a chart. I did everything right but i don't know why the x axis and y axis label is not comming in chart. code below
- Line chart plotting multiple points for duplicate data on x and y axis using chart.js
- chart js how do I only show just the low/high dots on line chart?
- Displaying line chart for multiple datasets using chart.js
- Draw bubbles to show details in line chart using chart js
- how to render the same chart using Chart.js
- How to add text inside the doughnut chart using Chart.js?
- Remove the vertical line in the chart js line chart
- create a multi line chart using Chart.js
- How to add an on click event to my Line chart using Chart.js
More Query from same tag
- impressions in google analytics is zero while sessions and users are more
- Update chart data in angular2-chartjs
- Chart js vertical line z-index
- How to use Real time chart in react?
- Draw data in graphics generated by Chart JS
- Chart.js v2.0: Tooltip only for one dataset
- Remove background color in chartjs line chart
- Vertical stacked bar chart with chart.js
- Ticks callback not displaying strings containing decimal
- Chart.js tooltip hover customization for mixed chart
- Chart.js doughnut text colors
- How Can I Get An Instance of a ChartJS Bar Chart Using Angular
- Trying to call API and plot a line chart but it does not show
- Implement a cash flow timeline
- Impossible to render multiple charts with chart.js
- Is it Possible to get the base 64 of graph without showing it on page / canvas (Graph.Js)
- Chart.js - Multiple generateLegend() functions on same page
- Chart.js load new data
- Line is rendering only vertical line instead of sloped line
- How to fix a stacked logarithmic bar chart values to fit the grid
- How to make dashed thick lines with dots in ChartJS ? Is it possible?
- how to create multiple chart on one component vue
- JS import updated JSON file for use with ChartJS
- Chart.js Treemap Custom text
- How do I create a stacked horizontal bar chart with Chart.js in React?
- change date format in tooltip of chart.js
- Populating javascript chart with Razor model data
- Chart.Js how to hide datapoints with "0" value in Stacked Bar Chart
- How Can customize chartjs doughnut chart border and tooltip
- Rendering Chart.js Bubble Chart Using Array Data