benfred / venn.js

Area proportional Venn and Euler diagrams in JavaScript
MIT License
1.04k stars 218 forks source link

Crashes While Calling from C# Codebehind #128

Open nohainnogain opened 5 years ago

nohainnogain commented 5 years ago

When I attempt to call the chart in C# CodeBehind, the JavaScript in d3.min crashes, due to the chart being set to NULL. When I attempt to use the onload() event, it fires perfectly, but this does not allow me to place in my calculated values to create my diagram. The only thing that I changed was in the venndiagramfigures.js, which is where I set the values for the set (I added a function called setVennValues, which takes in values for the Venn Diagram). I am calling the function in the Codebehind with the following code:

ScriptManager.RegisterStartupScript(this, GetType(), "venndiagramfigures.js", "setVennValues(); ", true);

charterror

Thank you for this great project!

nohainnogain commented 5 years ago

venndiagramfigures.zip Update: I have solved this issue! I'm honestly not too sure about why this fixed the issue, but I commented out the majority of the second Venn Diagram (my web application only needed the one) and only left the definition of the set from the second. I called the JavaScript like so:

ClientScript.RegisterStartupScript(this.GetType(), "AKey", "setVennValues();", true);

It now calls the JavaScript code from the Code Behind, as opposed to the Client Side (which is much easier to manage when the application performs a PostBack). Thanks again benfred and other collaborators, for this amazing contribution. I believe that it's the most programmer-friendly Venn Diagram generator that I've found, and successfully implemented with relative ease.