Chart.js: [FEATURE] Documentation of chart instance `scales` property

Created on 1 Feb 2017  路  3Comments  路  Source: chartjs/Chart.js

Expected Behavior

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.

Current Behavior

Currently, no chart instance properties are documented, only the functions are.

Context



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

Environment

  • Chart.js version: 2.0
  • Browser name and version:
  • Link to your project:
help wanted documentation

All 3 comments

What properties do you thing should be documented?

  • [ ] id
  • [ ] chart
  • [ ] config
  • [ ] options
  • [ ] _bufferedRender
  • [ ] titleBlock
  • [ ] boxes
  • [ ] legend
  • [ ] events
  • [ ] scales
  • [ ] chartArea
  • [ ] tooltip
  • [ ] animating

@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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

joebirkin picture joebirkin  路  3Comments

adriantombu picture adriantombu  路  3Comments

kennsippell picture kennsippell  路  3Comments

JAIOMP picture JAIOMP  路  3Comments

akashrajkn picture akashrajkn  路  3Comments