This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] CCS:GUI Composer:无法更改 ti_widget_plot 的大小

Guru**** 2999690 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/925905/ccs-gui-composer-could-not-change-size-of-ti_widget_plot

工具/软件:Code Composer Studio

您好 E2E 团队、

我正在使用 ti_widget_plot 设计应用。 我可以定义小工具的大小、但该图不遵循这些大小。 下图显示了设计器中的图。 小工具的大小更大(请参阅框架)。

在运行时、我检查了检查专员中的 Aptribute:

即使我在下一次调用之后更改了检查器的宽度

Plotly.extendTraces (templateObj.$.ti_widget_plot.$.plot、update、[0、1、2、3]); 

宽度设置回700px。

700px 的宽度 和400 sompx 的高度是否已硬编码? 还是可以覆盖的默认值?

以下是图绑定和更新的 js 实现:

templateObj.$.ti_widget_plot.data =[line0、line1、line2、line3];
templateObj.$.ti_widget_plot.layout ={
页边距:{
T:0
}
};
templateObj.$.ti_widget_plot.config =配置={
"linkText":"图形名称"、
"滚动缩放":正确、
'DisplayModeBar':正确、
"可编辑":true、
'宽度':"1000px"
};
templateObj.$.ti_widget_plot.reDraw ();
var cnt = 0;

var interval = setInterval (function(){
CNT++;
VAR 更新={
X:[[cnt]、[cnt]、[cnt]、[cnt]、
Y:[[document.getElementById ('ti_tile_meter_HV_I').value]、
[document.getElementById ("ti_tile_meter_HV_U").value]、
[document.getElementById ('ti_widget_gauge3').value]、
[document.getElementById ('ti_widget_gauge4').value]]
};


Plotly.extendTraces (templateObj.$.ti_widget_plot.$.plot、update、[0、1、2、3]);
},1000); 

谢谢

Erik

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    该数字丢失、我将重试:

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    检查器的屏幕截图是:

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我找到了解决方案:

    templateObj.$.ti_widget_plot.data =[line0、line1、line2、line3、Line4];
    templateObj.$.ti_widget_plot.layout ={
    页边距:{
    T:0
    }、
    宽度:1000
    }; 

    布局中的宽度属性。