Skip to content

Can't get callback example working #23

@songproducer

Description

@songproducer

I'm able to choose the callback from the admin, but on the webpage it doesn't display.

I'm using this with the Wagtail News Template so the only difference I think is that I'm calling the chart from within the blocks.StreamBlock class

utils/blocks.py

CHART_CONFIG_CALLBACKS = (
        ('barchart_labels', 'Bigger font and bold labels'),
    )
class StoryBlock(blocks.StreamBlock):
        chart = ChartBlock(callbacks=CHART_CONFIG_CALLBACKS)

static_src/javascript/main.js

window.barchart_labels = function() {
    return {
        plugins: {
            datalabels: {
                font: {
                    size: 18,
                    weight: 'bold',
                },
                color: '#ff0000'
            }
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions