Scale Title Configuration Properties

  • display: This property is used to control the axis title. It is a boolean value, if set to true the title is visible, else becomes hidden.
  • align: This property is used to specify the alignment of the axis title like start, center, and end.
  • text: This property is used to define the text content for the axis title.
  • color: This property is used to set the color of the axis title. It accepts the color values to customize the visual appearance.
  • font: This property is used to specify the font styling for the axis tile. We can customize the font family, size, etc.
  • padding: This property is used to determine the padding around the axis title.

Chart.js Labeling Axes

Chart.js Labeling Axes is used to describe the information in a chart. The Scale Title Configuration allows customization of axis titles, which also includes the options for display, alignment, text, color, and padding.

Syntax:

const config = {
type: 'bar',
data:,
options: {
scales: {
y: {
title: {
display: true,
align: 'center',
text: 'Y-Axis Title',
color: 'black',
font: {
family: 'Arial',
size: 14,
weight: 'bold',
},
padding: {
top: 10,
bottom: 5,
left: 0,
right: 0,
},
},
},
},
},
};

Similar Reads

Scale Title Configuration Properties

display: This property is used to control the axis title. It is a boolean value, if set to true the title is visible, else becomes hidden. align: This property is used to specify the alignment of the axis title like start, center, and end. text: This property is used to define the text content for the axis title. color: This property is used to set the color of the axis title. It accepts the color values to customize the visual appearance. font: This property is used to specify the font styling for the axis tile. We can customize the font family, size, etc. padding: This property is used to determine the padding around the axis title....

Creating Custom Tick Formats

We can customize the appearance of tick marks on the axis and include additional information. For this, we need to override the ticks.callback method in the axis configuration. The arguments for this method are given below:...