score:5
Accepted answer
here is an example to get the point style you are after:
documentation for point options for line chart can be found here
a codepen of the below code here
html:
<html>
<body>
<div class="mychartdiv">
<canvas id="mychart" width="600" height="400"></canvas>
</div>
</body>
</html>
js:
new chart(document.getelementbyid("mychart"), {
type: "line",
data: {
labels: ["january", "february", "march", "april", "may", "june"],
datasets: [
{
label: "my first dataset",
data: [20, 25, 22, 19, 31, 40],
fill: true,
bordercolor: "rgb(75, 192, 192)",
backgroundcolor: "rgba(0,0,0,0.1)",
borderwidth: 2,
linetension: 0,
/* point options */
pointbordercolor: "blue", // blue point border
pointbackgroundcolor: "white", // wite point fill
pointborderwidth: 1, // point border width
}
]
},
options: {
legend: {
labels: {
usepointstyle: true, // show legend as point instead of box
fontsize: 10 // legend point size is based on fontsize
}
}
}
});
Source: stackoverflow.com
Related Query
- Empty circle - only point strok in line chart for ChartJS
- ChartJS - Line chart issue with only 1 point
- line chart with {x, y} point data displays only 2 values
- show label in tooltip but not in x axis for chartjs line chart
- chartjs show dot point on hover over line chart
- Add a text as tooltip for each point on a line chart
- plot a point on top on line chart in chartjs
- Chartjs backgroundColor for line chart does not appear in Vue app
- VueJS + Chartjs - Chart only renders after code change
- ChartJS Line Chart - Points Connected out of order for Timeseries in Angular 6
- Show label for every data point in line chart
- Trouble with setting background color for Line chart at Chartjs version 3.5.1
- Chart Js Change Label orientation on x-Axis for Line Charts
- Chartjs random colors for each part of pie chart with data dynamically from database
- Chart.js how to show cursor pointer for labels & legends in line chart
- Display line chart with connected dots using chartJS
- Chartjs 2 - Stacked bar and unstacked line on same chart with same y axis
- Chartjs linechart with only one point - how to center
- How to display Line Chart dataset point labels with Chart.js?
- ChartJs line chart repaint glitch while hovering over
- How to add second Y-axis for Bar and Line chart in Chart.js?
- chart.js Line chart with different background colors for each section
- How to display value of only one datapoint in line chart
- Border radius for the bar chart in ChartJS
- Display a limited number of labels only on X-Axis of Line Chart using Chart.js
- ChartJS - Line Chart with different size datasets
- Show data dynamically in line chart - ChartJS
- Chartjs - data format for bar chart with multi-level x-axes
- ChartJS: Draw vertical line at data point on chart on mouseover
- Show only nth tick LINE on x-axis for Chart.js diagram
More Query from same tag
- Export chart.js into fixed sized chart
- Can't figure out how to skip first datapoint on the x-axis and labels on X-axis skip second-to-last datapoint with Chart.js
- How to display variables from Laravel controller to view javascript with specific index
- Chart.js not working - Uncaught RefernceError:
- Chart.js bar chart bars and labels do not align
- Am I missing a chart.js component or helper?
- How to open a new Tab with javascript and display some chart
- ChartJS 2.0 - Huddle labels on pie chart
- how to display labels at top of charts(chart.js)
- Chart.js page is zooming out everytime we change to a different graph while using a browser on with IOS El Capitan or latest iPad version
- Zoom chartjs with many X values
- How to set percentage value by default on each bars in horizontal bar chart js
- Chart.js: How to set minimum height of chart but still maintain aspect ratio?
- How to limit number of displayed points in chart.js?
- Does this library have a way of showing a world map?
- How do I refresh data from json-file with charts.js?
- Dynamic Pie Chart With Json Data using chart.js
- ChartJS doughnut data toggle on custom button click
- Update a chart dynamically with socket.io in real time
- Trying to update data in chart.js chart
- Execute chartjs after an ajax call with PHP
- Unable to display data in Bar Chart using react-chart-2
- Chart.js onClick function for bar graph
- when click legend item in chart.js my bar is hiden but value of bar not hide
- Double Y Axis + Bar chart combo
- how to change point style legend to diamond in chart js
- how to minimize x axis labels to day hours in chart js
- Trying to load a chart with chart.js, through ajax and php
- Error in created hook (Promise/async): "TypeError: Cannot read property 'position' of undefined"
- Displaying a chartjs chart within a bulma full height hero