Hola intento pasar una variable de jquery a un atributo de un div.
les paso mi codigo jquery
Código Javascript
:
Ver original*/
function update_values(temp1, temp2, volts){
$("#display_temp1").html(temp1);
$("#display_temp2").html(temp2);
$("#display_volt").html(volts);
}
function process_msg(topic, message){
// ej: "10,11,12"
if (topic == "values"){
var msg = message.toString();
var sp = msg.split(",");
var temp1 = sp[0];
var temp2 = sp[1];
var volts = sp[2];
update_values(temp1,temp2,volts);
}
}
Bien ahora les paso un eemplo donde si me funciona
Ahora les peso el ejemplo donde no me funciona necesito llamar a la variable de jquery donde dice
data:[{value:'32':, name: 'Humedad'}] donde dice 32 ahi tengo que pasar la variable de jquery puede ser display_temp1 o demas.
Código HTML:
Ver original <div ui-jp="chart" ui-options=" { tooltip : {
formatter: '{a} <br></div>{b} : {c}%'
},
series : [
{
name:'Task',
type:'gauge',
detail : {formatter:'{value}%'},
data:[{value:'32':, name: 'Humedad'}]
}
]
}" style="height: 300px; -webkit-tap-highlight-color: transparent; user-select: none; background-color: rgba(0, 0, 0, 0); cursor: default;" _echarts_instance_="1">
<div style="position: relative; overflow: hidden; width: 419px; height: 300px;"><div data-zr-dom-id="bg" class="zr-element" style="position: absolute; left: 0px; top: 0px; width: 784px; height: 300px; user-select: none;"></div><canvas width="419" height="300" data-zr-dom-id="0" class="zr-element" style="position: absolute; left: 0px; top: 0px; width: 419px; height: 300px; user-select: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></canvas><canvas width="419" height="300" data-zr-dom-id="1" class="zr-element" style="position: absolute; left: 0px; top: 0px; width: 419px; height: 300px; user-select: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></canvas><canvas width="419" height="300" data-zr-dom-id="_zrender_hover_" class="zr-element" style="position: absolute; left: 0px; top: 0px; width: 419px; height: 300px; user-select: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></canvas></div></div>