Pentaho

 View Only

 RequireJS

  • Pentaho
  • Pentaho
Mauricio Valencia's profile image
Mauricio Valencia posted 03-08-2019 14:14

Hello!

I have been trying to use an HTML code to generate a graph like this one in Pentaho CDE:

pastedimage_1

It works perfectly when I have the RequireJS Support option unchecked, but when it is checked, the dashboard does not show anything, it does not load as it should. Not having the RequiereJS active is not an option because my charts does not look fine without it, so is there a way to show the graph I want to show having the RequireJS option checked? Could you help me?

I also want to ask, is it possible to use a parameter in the Script section of my HMTL code?

Thanks!


#Pentaho
Duarte Cunha Leao's profile image
Duarte Cunha Leao

Hi, are you using any JS library to render the graphic? How are you including it? Does it support RequireJS?

Cheers

Mauricio Valencia's profile image
Mauricio Valencia

Hi Duarte Leao, right now I am just testing with the HTML code written here: http://bl.ocks.org/mbostock/1153292, I am adding it in the Layout Panel.

pastedimage_2

Is there a better way to generate the graph?

Thank you!

Duarte Cunha Leao's profile image
Duarte Cunha Leao

Hi Mauricio,

you should install the D3 Component Library, from the marketplace (source: GitHub - webdetails/d3ComponentLibrary: D3 Component Library for Pentaho ). Then, you'll be able to use the D3 Component which comes with it. Not only you'll be able to tidy up the rendering code, by placing it in a component's, but it'll make sure that the D3 dependency is available.

Cheers

Mauricio Valencia's profile image
Mauricio Valencia

Hi!

I installed it and now my chart is available using a d3Component, but I have the same problem, it just works with the RequiereJS unchecked.