You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/** This block of code is for everything contained in ionViewDidLoad right below it
29
+
*
30
+
Everything above the options property in the chart code below relates to the chart data. Everything below that property modifies the display in some way.
31
+
32
+
Everything below the plugins property in options relates to the snazzy labels that surround the chart.
33
+
34
+
The layout.padding property gives room for the snazzy labels.
35
+
36
+
In plugins.datalabels:
37
+
38
+
anchor, align, and offset are all used to position the labels. the anchor value sets the anchor point from which you'll relate a label's position
39
+
align defines what direction you'll position your labels relative to the anchor point
40
+
offset defines how far away from the anchor point you will position the labels
41
+
For more explanation: https://chartjs-plugin-datalabels.netlify.com/positioning.html
42
+
43
+
Some properties have functions as their values. This makes the values dynamic, changing based on certain conditions.
44
+
You'll notice that the functions take an argument called context. This object contains helpful information about the chart. Console log it if you're curious!
45
+
46
+
The "rotation" property is what rotates the labels to match where they are around the graph
47
+
The "BorderRadius property " controls how round the edges of the label containers are.
48
+
The "Font" and "Offset" functions scale the font and positioning according to the chart's width.
49
+
The "Formatter" property is what allows us to display the data names and values.
0 commit comments