The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
HIghCharts GAUGE
MarcoBarradas
Administrator, Employee-RapidMiner, RapidMiner Certified Analyst, Member Posts: 272 Unicorn
Hi I'm trying to use a Highchart Gauge, since it's not part of the standar deployment I create a process that writes the HTML.
Unfortunately it's not working.
I tried the same approach with a google gauge an it worked.
Can you help me?
Unfortunately it's not working.
I tried the same approach with a google gauge an it worked.
Can you help me?
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="6.4.000">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="6.4.000" expanded="true" name="Process">
<process expanded="true">
<operator activated="true" class="text:create_document" compatibility="6.4.001" expanded="true" height="60" name="Create Document" width="90" x="514" y="30">
<parameter key="text" value="<html> <head> <script src="https://myurl:8443/RA/static/javascript/jquery/plugins/jquery.desaturate.js"></script> <script src="http://code.highcharts.com/highcharts.js"></script> <script src="http://code.highcharts.com/highcharts-more.js"></script> <script src="http://code.highcharts.com/modules/solid-gauge.js"></script> 	<script> $(function () { var gaugeOptions = { chart: { type: 'solidgauge' }, title: null, pane: { center: ['50%', '85%'], size: '140%', startAngle: -90, endAngle: 90, background: { backgroundColor: (Highcharts.theme && Highcharts.theme.background2) || '#EEE', innerRadius: '60%', outerRadius: '100%', shape: 'arc' } }, tooltip: { enabled: false }, // the value axis yAxis: { stops: [ [0.1, '#55BF3B'], // green [0.5, '#DDDF0D'], // yellow [0.9, '#DF5353'] // red ], lineWidth: 0, minorTickInterval: null, tickPixelInterval: 400, tickWidth: 0, title: { y: -70 }, labels: { y: 16 } }, plotOptions: { solidgauge: { dataLabels: { y: 5, borderWidth: 0, useHTML: true } } } }; // The speed gauge $('#container-speed').highcharts(Highcharts.merge(gaugeOptions, { yAxis: { min: 0, max: 100, title: { text: 'Objetivo' } }, credits: { enabled: false }, series: [{ name: 'Speed', data: [80], dataLabels: { format: '<div style="text-align:center"><span style="font-size:25px;color:' + ((Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black') + '">{y}</span><br/>' + '<span style="font-size:12px;color:silver">km/h</span></div>' }, tooltip: { valueSuffix: ' km/h' } }] })); }); </script> </head> <body> <div style="width: 600px; height: 400px; margin: 0 auto"> 	<div id="container-speed" style="width: 300px; height: 200px; float: left"></div> 	<div id="container-rpm" style="width: 300px; height: 200px; float: left"></div> 	</div> </body> </html>"/>
</operator>
<connect from_op="Create Document" from_port="output" to_port="result 1"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
<portSpacing port="sink_result 2" spacing="0"/>
</process>
</operator>
</process>
Tagged:
0
Answers
you are missing JQuery. Add this to the scripts: Regards,
Marco
I believe maybe I'm calling twice the highcharts library, Is there a way to call the library that RapidMiner Server has locally?
My other theory it has something related to https, my server is configured using a certificate.
Thanks.
Note that the order of script imports is important - it won't work in the wrong order. This order works for me: If you want to use the shipped versions (gauge is not part of the shipped version), you can use these imports: Note that your document has to be in an iframe to prevent it from having access to the (very outdated) JQuery version which is part of the regular Server web pages.
Regards,
Marco
Could you please edit the url of my server on your response? =D
Best Regards.