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

Set up highchart #3506

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft

Conversation

precious-onyenaucheya-ons
Copy link
Contributor

@precious-onyenaucheya-ons precious-onyenaucheya-ons commented Feb 24, 2025

What is the context of this PR?

Describe what you have changed and why, link to other PRs or Issues as appropriate.

How to review this PR

Describe the steps required to test the changes (include screenshots if appropriate).

Checklist

This needs to be completed by the person raising the PR.

  • I have selected the correct Assignee
  • I have linked the correct Issue

Copy link

netlify bot commented Feb 24, 2025

Deploy Preview for ons-design-system-preview ready!

Name Link
🔨 Latest commit c61e645
🔍 Latest deploy log https://app.netlify.com/sites/ons-design-system-preview/deploys/67c08ecc84d2eb00083385a6
😎 Deploy Preview https://deploy-preview-3506--ons-design-system-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@precious-onyenaucheya-ons precious-onyenaucheya-ons changed the title Feature/set up highchart Set up highchart Feb 24, 2025
@precious-onyenaucheya-ons precious-onyenaucheya-ons added the Enhancement Change of existing feature label Feb 24, 2025
</figure>

<!-- Set scripts to pass the config values as json to the javascript -->
{# <script type="application/json" data-highcharts-config--{{ params.uuid }}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @precious-onyenaucheya-ons, quick question before doing a more full review: is this meant to be commented out? It's causing a console error for me when I view the component in a local build, and the chart won't render as it can't read the content.

Copy link
Collaborator

@helenb helenb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @precious-onyenaucheya-ons thank you for this - let's have a look through in our call this afternoon. I am also going to do some work to refine the line chart ticket tomorrow so we can get a better idea of what work is still to be done.

align: 'left',
verticalAlign: 'top',
layout: 'horizontal',
symbolWidth: type === 'line' ? 20 : 12,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an area where I think re-working of my original code is needed. Ideally we'd set the Highcharts global options just once per page - perhaps checking with a window variable whether or not it has been done. This means that any configuration that is specific to a chart type needs splitting out and setting differently. Would it be helpful for me to help with that?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(this could potentially be in a separate ticket)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my PR for how this could be done - #3507

@@ -9,6 +9,7 @@
<figure id="{{ params.figId }}">
<h3>{{ params.title }}</h3>
<h4>{{ params.subtitle }}</h4>
<h5 class="ons-u-vh">{{ params.description }}</h5>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good solution.

@@ -37,7 +37,7 @@ class ChartOptions {
fontWeight: 'normal',
},
},
// chart title is rendered in wagtail
// Remove chart title
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: // Remove the chart title as rendered by Highcharts, as this is rendered in the surrounding component

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Change of existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants