score:11
note that there seems to be some changes going on. the actual configuration would depend on which v2.0 you are using.
for version 2.0.0-alpha
set categoryspacing
for the xaxes. you can do this globally
chart.defaults.bar.scales.xaxes[0].categoryspacing = 0
or you can do it by chart
...
scales: {
xaxes: [{
categoryspacing: 0
}],
...
fiddle - http://jsfiddle.net/beehe4eg/
for version 1.0.2
adjust the options barvaluespacing
and bardatasetspacing
to make the bars closer. this will automatically increase their width.
score:17
for me, trying 2.0 beta, what worked was to set the barpercentage on the xaxes scale option.
this is what i used:
var options = {
data: chartdata,
type: "bar",
options: {
scales: {
xaxes: [{ barpercentage: 0.5 }]
}
}
};
var chart = new chart(chartctx, options);
score:40
for version 2.4.0 barthickness - manually set width of each bar in pixels. if not set, the bars are sized automatically.
options = {
scales: {
xaxes: [{
barthickness : 73
}]
}
}
Source: stackoverflow.com
Related Query
- How to modify bar width in Chartjs 2 bar charts
- How do I make line charts overlay over bar charts in chartjs
- how to make chartjs columns smaller in width for bar chart?
- chart js 2 how to set bar width
- How to modify chartjs tooltip so i can add customized strings in tooltips
- chartjs : how to set custom scale in bar chart
- ChartJs how to get from mulitiple dateset which dataset bar is clicked
- ChartJs bar chart - keep bars left instead of equally spread across the width
- How to change the cursor to a pointer when I hover over a bar in a ChartJS bar chart?
- Why are these 2.9 ChartJS bar charts different?
- How to set a full length background color for each bar in chartjs bar
- How to draw Horizontal line on Bar Chart Chartjs
- How to fix bar width in chartjs?
- How to dynamically set ChartJs line chart width based on dataset size?
- How to add ChartJS code in Html2Pdf to view image
- ChartJS bar chart fixed width for dynamic data sets
- How to remove bars for those bars with zero value in Chartjs bar chart?
- How to make chartJs stacked bar always rounded when data is 0?
- How do I add time sourced from an external source as an X axis to a ChartJS graph?
- chartjs - how to set the order in which the different charts are displayed
- How to retain spacing between bars for two different bar charts in Chart.js 2
- Chartjs 3.x - How to duplicate X axis on both sides of horizontal bar chart with only 1 dataset?
- how to highlight bar in ChartJS with onkeyup Input
- How can I load multiple Chartjs charts with different data on the same page?
- How to generate chartjs charts to pdf using laravel?
- Chartjs tooltip anchor point position on bar charts
- Chart.JS: How can I only display data labels when the bar width is big enough for the text?
- Rounded corners on chartJS v.2 - bar charts (with negative values)
- How to set the chartjs bar graph scale to the highest value in the result data
- How to highlight single bar in bar chart using Chartjs
More Query from same tag
- How can I draw a line to the highest datapoint in chart js?
- "Cannot read property 'xyz' of undefined": How to use map or foreach on numeric json?
- Stacked bar chart results in misaligned bars
- Chart.js annotation horizontal line on double y-axis graph
- Conditional in ChartJS axes tick callback function isn't returning the expected labels
- Is it possible with Chart js or which chart Library can provide this type of chart?
- Failed to create chart
- How can I prevent the hover data from displaying in Chart.JS?
- Updating a Pie Chart in React as Data is Entered
- cannot read property 'yyyx' of undefined
- Bars on chartjs superimpose when using type: 'time'
- how to add legend in pie chart
- Change value from 0 to something on tooltip only
- Chart.js: How to group legends of dataset? So one toggle for multiple datasets?
- (MVC) Is this an efficient way of displaying chart data by date?
- Chart.js Radar chart legend label font size doesn't work
- Group data from CSV (D3.js & Chart.js)
- Visualization of charts using real time data from MSSQL with node.js webserver
- Adding labels and colours to Chart.JS from arrays
- Using Google Analytics raw data to display graph by month
- How can I change only a specific option in a chart with chart.js?
- How to display laravel variables in JSON in laravel view- Charts.js
- How to use below syntax in chart.js 3.x?
- Chart.js: Fixed horizontal location of vertical axis
- Accessing .csv data from views file
- Data-labeling ChartJS, Removing Duplicates?
- Chart JS chart not rendering in ArcGIS popup when using navigation arrows
- ChartJS - x axis labels orientation
- generate color from number
- Show value on Mixed chart, Charts.js