Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manual Configuration doesn't work for ChartJS charts #1184

Open
Mara42 opened this issue Sep 20, 2024 · 3 comments
Open

Manual Configuration doesn't work for ChartJS charts #1184

Mara42 opened this issue Sep 20, 2024 · 3 comments
Labels
bug This label could be used to identify issues that are caused by a defect in the product.

Comments

@Mara42
Copy link

Mara42 commented Sep 20, 2024

Description

None of the ChartJS charts won't modify if you add code in the Manual Configuration tab, however, the exact same code added to the Manual Configuration tab for Google Charts does work.

Step-by-step reproduction instructions

  1. Make sure you have a WP instance with Visualizer installed and activated
  2. Create a ChartJS chart and try to add code in the Manual Configuration

Screenshots, screen recording, code snippet or Help Scout ticket

The first chart is from Google Charts, which shows the modifications provided by the code in the Manual Configuration, and the second is from ChartJS.
Screenshot 2024-09-20 at 12 39 12

Same here
Screenshot 2024-09-20 at 11 20 26

You can try with this code: {
"legend": {
"textStyle": {
"fontSize": 14,
"fontName": "Spectral",
"bold": true,
"color": "red"
}
}
}

HelpScout ticket: https://secure.helpscout.net/conversation/2711096424/434294?viewId=212385

Test instance: https://filthyhearing.s2-tastewp.com/2024/09/20/5/
Username: test
Password: test

Environment info

No response

Is the issue you are reporting a regression

No

@Mara42 Mara42 added the bug This label could be used to identify issues that are caused by a defect in the product. label Sep 20, 2024
@vytisbulkevicius
Copy link
Contributor

vytisbulkevicius commented Sep 20, 2024

Hi @Mara42,

It works but for ChartJS library the format is a bit different. For example, in your case you're changing the legend so format would be like this for the Pie chart:

{
  "plugins": {
    "legend": {
      "labels": {
        "font": {
          "size": "14",
          "family": "Spectral",
          "weight": "bold"
        },
        "color": "red"
      }
    }
  }
}

You can play around with other settings as well but I tested and it works.

@Mara42
Copy link
Author

Mara42 commented Sep 20, 2024

Hi @vytisbulkevicius,

I just tested on a couple of instances and the changes appear only in the preview of the chart, but when viewing the page/post in which the chart is added, the changes of the legend are not visible.
https://imgur.com/a/NVGdrmT
https://imgur.com/a/hnItIsD

@AndreeaCristinaRadacina

Hey @vytisbulkevicius,

I tested Mara's scenario, and I can confirm that the ChartJS modifications are not visible on frontend:
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This label could be used to identify issues that are caused by a defect in the product.
Projects
None yet
Development

No branches or pull requests

3 participants