There are quite a few properties of a chart instance that are helpful to be available outside of the chart. An example of this is the scales
property, which contains the dimensions and paddings of the scales. This information can then be used to, for example, position something behind the chart.
It would be helpful if these properties were public API and documented.
Currently, no chart instance properties are documented, only the functions are.
I am using the scales
property in a project to position an element behind the chart so that it is aligned with the scales and the chart maximum values. The chart doesn't have a title or a legend, so there may be a better property to use, such as chartArea
, or additional properties to include in the positioning calculations, such as titleBlock
What properties do you thing should be documented?
@bytesnz I think that the following should be documented: id
, chart
(deprecated), config
, options
, titleBlock
, boxes
, legend
, events
, scales
, chartArea
, and tooltip
should be documented. We are doing a lot of the doc work in the documentation rewrite branch so any PRs should be made to that branch
We now have typescript documentation shipping with Chart.js as of v3.0.0-beta. This contains documentation of the scales
property.
I would recommend these for this kind of documentation as they're up to date and the integration with IDEs like VSCode is good.