score:2
Accepted answer
within the chart options you can define if the yaxis
is displayed or not.
options: {
...
scales: {
yaxes: [{
display: false
}]
}
}
please check the following runnable code snippet.
var linechartdata = {
labels: ["february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december", "january", "february", "march", "april"],
datasets: [{
label: "x",
fillcolor: "#ff1e6d",
strokecolor: "#ff1e6d",
pointcolor: "#ff1e6d",
data: [290, 390, 300, 440, 625, 375, 390, 325, 280, 295, 385, 295, 485, 280, 265]
}, {
label: "y",
fillcolor: "#ffc000",
strokecolor: "rgba(220,180,0,1)",
pointcolor: "#ffc000",
data: [190, 200, 420, 390, 150, 250, 160, 155, 200, 260, 240, 500, 300, 210, 230, 270]
}]
}
chart.defaults.global.animationsteps = 50;
chart.defaults.global.tooltipypadding = 0;
chart.defaults.global.tooltipcornerradius = 0;
chart.defaults.global.tooltiptitlefontstyle = "normal";
chart.defaults.global.tooltipfillcolor = "rgba(0,160,0,0.8)";
chart.defaults.global.animationeasing = "easeoutbounce";
chart.defaults.global.responsive = true;
chart.defaults.global.scalelinecolor = "#816cab";
chart.defaults.global.scalefontsize = 11;
chart.defaults.global.scalefontcolor = "white";
new chart(document.getelementbyid("fill"), {
type: 'line',
data: linechartdata,
options: {
pointdotradius: 0,
beziercurve: true,
scaleshowverticallines: false,
scalegridlinecolor: "transparent",
scales: {
yaxes: [{
display: false
}]
}
}
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/chart.js/2.9.3/chart.min.js"></script>
<canvas id="fill"></canvas>
Source: stackoverflow.com
Related Query
- Disable or hide YAixs of chart in chartJs
- ChartJS disable gridlines outside chart area
- Hide labels from pie chart in chartjs
- hide label on doughnut chart of chartjs
- ChartJs (ver: 2.8.0): Custom tooltip does not hide if clicked (or mouse pointer is moved) outside the chart canvas area
- VueJS + Chartjs - Chart only renders after code change
- Disable background chart on chartjs
- Dynamically update values of a chartjs chart
- Hide points in ChartJS LineGraph
- Chartjs Bar Chart showing old data when hovering
- Chart area background color chartjs
- Is it possible in chartjs to hide certain dataset legends?
- Chartjs v2.0: stacked bar chart
- Chartjs random colors for each part of pie chart with data dynamically from database
- How to disable chartjs legendclick
- ChartJS New Lines '\n' in X axis Labels or Displaying More Information Around Chart or Tooltip with ChartJS V2
- ReferenceError: Chart is not defined - chartjs
- How to disable a tooltip for a specific dataset in ChartJS
- ChartJS - Draw chart with label by month, data by day
- How do you hide the title of a chart tooltip?
- Changing fontFamily on ChartJS bar chart
- Line chart disable interpolation
- Display line chart with connected dots using chartJS
- chartjs : how to set custom scale in bar chart
- Chartjs 2 - Stacked bar and unstacked line on same chart with same y axis
- Dynamically update the options of a chart in chartjs using Javascript
- Chartjs hide data point labels
- chartjs datalabels change font and color of text displaying inside pie chart
- How to fix chart Legends width-height with overflow scroll in ChartJS
- Chartjs Bar Chart Legend
More Query from same tag
- chartjs-plugin-datalabels not showing on stacked horizontal bar
- Add padding between two y-axis scales using chart.js
- Specify varying thickness of each bar in Chart.js bar chart
- Chart.js v3.x time series on x axis
- chart js legend template
- Chart.js radar chart ticks are hidden behind the graph
- Time scale formatting issues with chartjs, mostly unitStepSize
- Why is my Chart.JS canvas not destroying?
- Loop through array for chart.js input
- Default font size doesn't change ChartJS
- Chart.js place y value position and its x-label position relative to the x-value
- Can "Bar" be placed center of vertical grid line in Chart.js?
- How to disable scientific notations in logarithmic chart type
- Problem with Charts.js in vue. anyone can help step by step
- I need a PHP query to grab data from the database and use in my bar charts for results
- How to make a prefilled doughnut in chart.js?
- How to reformat tooltip in Chart.js?
- Cycle through finite set of colours for indefinite set of data in Javascript
- Error: "barWithErrorBars" is not a chart type. Vue - chartjs-chart-error-bars
- Can not read property 'Concat' of Undefined
- Chartjs: display different average line while grouping
- Chart.js mouseover tooltips appears when cursor in wrong position
- Chartjs barchart group dataset by label
- Unable to see the lines in chart.js
- Problems with ChartJS "Uncaught TypeError: Cannot read property 'length' of null"
- Cannot read property 'transition' null chartjs
- Gradient colour in backgroundColor JS
- Who knows why I can't plot my chart properly?
- Chart.JS - Couldn't add the margin/spacing between Y-axis labels
- Legend position with Chart.js