Extension not executed by Tool bar button
up vote
-1
down vote
favorite
I want to create an extension that make a pie chart of the different material of my BIM Model appear in Forge Viewer. I followed the learn forge tutorial and if worked. When I clicked on the new toolbar button, the alert "I am an extension" appeared.
However, now that I am replacing this line by my code, nothing appears when I click on the button.
I am using chart.js for the pie chart.
Here is my code replacing the alert('I am an extension"); line :
var ChartToolbarButton = new Autodesk.Viewing.UI.Button('runMyAwesomeCode');
ChartToolbarButton.onClick = function () {var Chart = require('chart.js');
var ctx = document.getElementById("myPieChart");
var myPieChart = new Chart(ctx, {
"type":"pie",
"title":{
"text":"Pie Chart"
},
"series":[
{"values":[59]},
{"values":[55]},
{"values":[30]},
{"values":[28]},
{"values":[15]}
]
});
// **********************
//
//
// Execute an action here
//
//
// **********************
As you can see, for now I am just trying to make a piechart appear, something simple to start with.
javascript autodesk-forge autodesk-viewer forge
add a comment |
up vote
-1
down vote
favorite
I want to create an extension that make a pie chart of the different material of my BIM Model appear in Forge Viewer. I followed the learn forge tutorial and if worked. When I clicked on the new toolbar button, the alert "I am an extension" appeared.
However, now that I am replacing this line by my code, nothing appears when I click on the button.
I am using chart.js for the pie chart.
Here is my code replacing the alert('I am an extension"); line :
var ChartToolbarButton = new Autodesk.Viewing.UI.Button('runMyAwesomeCode');
ChartToolbarButton.onClick = function () {var Chart = require('chart.js');
var ctx = document.getElementById("myPieChart");
var myPieChart = new Chart(ctx, {
"type":"pie",
"title":{
"text":"Pie Chart"
},
"series":[
{"values":[59]},
{"values":[55]},
{"values":[30]},
{"values":[28]},
{"values":[15]}
]
});
// **********************
//
//
// Execute an action here
//
//
// **********************
As you can see, for now I am just trying to make a piechart appear, something simple to start with.
javascript autodesk-forge autodesk-viewer forge
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I want to create an extension that make a pie chart of the different material of my BIM Model appear in Forge Viewer. I followed the learn forge tutorial and if worked. When I clicked on the new toolbar button, the alert "I am an extension" appeared.
However, now that I am replacing this line by my code, nothing appears when I click on the button.
I am using chart.js for the pie chart.
Here is my code replacing the alert('I am an extension"); line :
var ChartToolbarButton = new Autodesk.Viewing.UI.Button('runMyAwesomeCode');
ChartToolbarButton.onClick = function () {var Chart = require('chart.js');
var ctx = document.getElementById("myPieChart");
var myPieChart = new Chart(ctx, {
"type":"pie",
"title":{
"text":"Pie Chart"
},
"series":[
{"values":[59]},
{"values":[55]},
{"values":[30]},
{"values":[28]},
{"values":[15]}
]
});
// **********************
//
//
// Execute an action here
//
//
// **********************
As you can see, for now I am just trying to make a piechart appear, something simple to start with.
javascript autodesk-forge autodesk-viewer forge
I want to create an extension that make a pie chart of the different material of my BIM Model appear in Forge Viewer. I followed the learn forge tutorial and if worked. When I clicked on the new toolbar button, the alert "I am an extension" appeared.
However, now that I am replacing this line by my code, nothing appears when I click on the button.
I am using chart.js for the pie chart.
Here is my code replacing the alert('I am an extension"); line :
var ChartToolbarButton = new Autodesk.Viewing.UI.Button('runMyAwesomeCode');
ChartToolbarButton.onClick = function () {var Chart = require('chart.js');
var ctx = document.getElementById("myPieChart");
var myPieChart = new Chart(ctx, {
"type":"pie",
"title":{
"text":"Pie Chart"
},
"series":[
{"values":[59]},
{"values":[55]},
{"values":[30]},
{"values":[28]},
{"values":[15]}
]
});
// **********************
//
//
// Execute an action here
//
//
// **********************
As you can see, for now I am just trying to make a piechart appear, something simple to start with.
javascript autodesk-forge autodesk-viewer forge
javascript autodesk-forge autodesk-viewer forge
edited Nov 21 at 22:22
asked Nov 19 at 21:50
Elvi Na
11
11
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53383138%2fextension-not-executed-by-tool-bar-button%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown