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

Render charts in Base64 format #258

Merged

Conversation

LxLeChat
Copy link
Contributor

@LxLeChat LxLeChat commented Jul 24, 2019

Pull Request [Topic]

Added new feature to New-PSHTMLChart. Add the ability to transform the charts to base64 img in the html (when the html is executed for the moment ... )

Please tell us , the type of Change you are submiting:

Select one of the following:

  • Bug
  • Feature
  • Minor Change

Does it fix an existing issue? Please tell us which one

Related to the following issues: #221 #255 #220

Description of what's been changed

-Added a new switch tobase64 to the New-PSHTMLChart
-Added a new condition inside New-PSHTMLChartwhen ToBase64 is used. this will change the default value of the onComplete event of the current chart to this:

if ($tobase64) {
     $ChartOptions.animation.onComplete = 'RemoveCanvasAndCreateBase64Image'
}

-Added a ChartAnimation class to add the animation option for chartoptions
-Added a new GetDefinition override in the chart class, this override add a javascript function called RemoveCanvasAndCreateBase64Image. The function to transform the chart into a base64, then create a new img tag in place of the canvas and delete the script tag associated with the chart ( #255 ).

Results of your tests (If applicable)

No new test @ the moment, but i invite you to test on of your example i modified : 4charts.ps1 where all the new features proposed are exposed.

Edit:
@ the moment selnium is not implemented

LxLeChat and others added 4 commits July 22, 2019 22:31
need to rename the switch from tobase64 to something else
Check chart example with 4 charts
@Stephanevg
Copy link
Owner

Plop @LxLeChat
J'ai regarder ton PR la, et y a qq tests qui on echoué (Ceux qui ce basent sur un string qui comportait l'object JSON de chartsjs.

image

Tu crois que tu peux les fixer avant que je merge?

gracias

updated new-pshtmlchart tests
@Stephanevg
Copy link
Owner

Awesome, Merci Mec @LxLeChat !!

@Stephanevg Stephanevg closed this Jul 26, 2019
@Stephanevg Stephanevg reopened this Jul 26, 2019
@Stephanevg Stephanevg merged commit 6d313fc into Stephanevg:Feature_PshtmlBase64_dev Jul 26, 2019
@Stephanevg
Copy link
Owner

ça marche mieux quand on merge les trucs quand meme... ^^

@Stephanevg Stephanevg modified the milestones: 0.8.2, 0.8.1 Oct 20, 2019
@Stephanevg Stephanevg changed the title Feature charts to mail Render charts in Base64 format Oct 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants