Closed (fixed)
Project:
Charts
Version:
5.0.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Feb 2021 at 16:43 UTC
Updated:
19 May 2022 at 13:43 UTC
Jump to comment: Most recent
I can't get the preview function to work on admin pages. When I click the "Update Preview" button, the preview simply does not show up.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
extect commentedLooks like the highcharts library isn't loaded on admin pages. When I put the following in my custom module, previews are working:
Maybe we should put sth. like that in the highcharts module itself or even make loading on admin pages available as a setting?
Comment #3
diamondseaThe preview appears to be drawn off of the saved version of the node. If you save the node and then click Preview, it will appear. If you edit the chart data in the node, the data changes will not be reflected in the chart until you save the node and view the Preview again. Also, make sure that you have selected Highcharts as the charting engine on the page so it will be loaded properly.
Comment #4
srdtwc commentedHas the "update preview" button been removed? I am using Highcharts and can see the preview, but the only way I am able to refresh the preview is by toggling the charting library.
Comment #5
srdtwc commentedPotentially related: https://www.drupal.org/project/charts/issues/3278438
It seems like "update preview" only appears if the field is collapsed, but it does not work in that situation.
Comment #8
nikathoneNeed review of the provided MR. If you want to test with the patch file it can be obtained under https://git.drupalcode.org/project/charts/-/merge_requests/31.patch
Comment #11
andileco commentedI've tested this and it works much better than previously. Occasionally there's a need to click the "preview" button twice, but no errors are showing.
(As a side note, I need to create a new issue for Chart.js - the data coming from the field is not plotting on the Chart.js chart).
Comment #12
andileco commentedOK, there does actually seem to be something related to Chart.js PREVIEW specifically.
Comment #14
andileco commentedFor Chart.js preview to work, just needed to change this line in ChartAxisBase.php:
'#axis_type' => 'linear',to
'#axis_type' => '',