Skip to main content
Skip table of contents

How to remove beforeDraw chart option

The documentation of the PocketQuery Chart API describes an option beforedDraw:

beforeDraw: Callback function that is applied before the draw function of Google Chart is called. This function receives the prepared dataTable and the full options object as arguments: function(queryResult, options) {}. See the example below.

This option has been deprecated. Historically, this option comes from a time when Converters weren’t present in PocketQuery and we believe that most usages of beforeDraw can be refactored to a Converter. In fact, most usages we have seen are being used to manipulate the query result, similarly as with the dataTable chart option. This option has also been deprecated: How to refactor dataTable to Converter.

We had to deprecate the beforeDraw chart option for security reasons, so any usage of this option will need to be refactored. We believe that the procedure described in the article linked above will also apply for most usages of beforeDraw, where the option is used to manipulate the query result: data manipulation should now take place in a Converter.

Note that if you are currently using the beforeDraw option, but the specified method has no content (or just comments that were copied from an example in the documentation), you can simply remove the option.

If you think you have a use case where your usage of beforeDraw cannot be refactored to a Converter, or if you struggle otherwise, please reach out to us.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.