Skip to content

HTML template for using config / setup / actions from Samples section #10778

Open
@lfoltyn

Description

@lfoltyn

Documentation Is:

  • Missing or needed?
  • Confusing
  • Not sure?

Please Explain in Detail...

Hi all,

maybe I just overlooked that part in you documentation.

But it took me some time to figure out, how to use the code displayed in Samples section from tabs config / setup / actions - e.g. from here https://www.chartjs.org/docs/latest/samples/bar/border-radius.html - in some working HTML example.

I simply missed some HTML template, where I would replace 3 sections with the code from the Sample to see the outcome.

Regards,
Lukas

Your Proposal for Changes

I would add somewhere in this page a sample HTML template (e.g. using CDN for including the js library) and the instruction that it is enough to replace 3 sections based on the Sample for config / setup / actions tabs.

To be honest I did not investigate where to copy the code from actions tab. I did not need that in my HTML example.

Important are these two lines, but some complete example is needed:

...

<script>
  const ctx = document.getElementById('myChart');
     
  // definitions for config / setup / actions
  
  const myChart = new Chart(ctx, config);
</script>
...

Example

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions