# How to make template change size according to percent?

**URL:** <https://forum.inductiveautomation.com/t/how-to-make-template-change-size-according-to-percent/93436>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [July 19, 2024, 6:34am UTC](https://forum.inductiveautomation.com/t/how-to-make-template-change-size-according-to-percent/93436 "2024-07-19T06:34:54Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![zixi\_zhou](https://avatars.discourse-cdn.com/v4/letter/z/3be4f8/32.png) [@zixi\_zhou](https://forum.inductiveautomation.com/u/zixi_zhou)\
**Post date:** [July 19, 2024, 6:34am UTC](https://forum.inductiveautomation.com/t/how-to-make-template-change-size-according-to-percent/93436/1 "2024-07-19T06:34:54Z")

</div>

![捕获](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/6/e62dc45d3c907d19a631d66e1f33b30080761357.png)  
 ![捕获2](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/b/db5a042f0b7a852e089ae89056c1c70c3ee8a1f1.png)  
Hello, I made a template, there is a view canvas included. but when I use this template in overview page, this canvas can not change size according to persent, how can I solve this? or this is the feature of perspective?

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [July 19, 2024, 7:01am UTC](https://forum.inductiveautomation.com/t/how-to-make-template-change-size-according-to-percent/93436/2 "2024-07-19T07:01:08Z")

</div>

Every element would need to have a scaling width and height.  
The embeded view, its root the canvas and all the elemnts inside the canvas.

It looks like the canvas elements are not dynimcally configured, could you share the code of the canvas?

---

<div class="post-metadata">

**Author:** ![zixi\_zhou](https://avatars.discourse-cdn.com/v4/letter/z/3be4f8/32.png) [@zixi\_zhou](https://forum.inductiveautomation.com/u/zixi_zhou)\
**Post date:** [July 19, 2024, 9:21am UTC](https://forum.inductiveautomation.com/t/how-to-make-template-change-size-according-to-percent/93436/3 "2024-07-19T09:21:51Z")

</div>

![捕获2](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/5/35e8f327ea33818df294164a35604db902331d79.png)  
I configured the canvas elements , and it test is ok..  
problem is when I use this template, I need adjust the size of the template sometimes, then this canvas element can not change size according to the template.

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [July 19, 2024, 9:30am UTC](https://forum.inductiveautomation.com/t/how-to-make-template-change-size-according-to-percent/93436/4 "2024-07-19T09:30:31Z")

</div>

Can you give the **code** of the view (RT\_PCT) and the canvas("movement" or also the whole view with it CS\_PCT). as een export or by copying the json formatted with the format button

It looks like you only want the width to scale? since you are adjusting the top yourself through some script

---

<div class="post-metadata">

**Author:** ![zixi\_zhou](https://avatars.discourse-cdn.com/v4/letter/z/3be4f8/32.png) [@zixi\_zhou](https://forum.inductiveautomation.com/u/zixi_zhou)\
**Post date:** [July 19, 2024, 9:48am UTC](https://forum.inductiveautomation.com/t/how-to-make-template-change-size-according-to-percent/93436/5 "2024-07-19T09:48:31Z")

</div>

![捕获](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/1/217041de5f90f6331d929b6f2869ee5dda5e2cc0.png)  
I say not clear, please look at the picture, problem is when I adjust this template, this RB160 part can not adjust accordingly.

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [July 19, 2024, 11:39am UTC](https://forum.inductiveautomation.com/t/how-to-make-template-change-size-according-to-percent/93436/6 "2024-07-19T11:39:45Z")

</div>

export the views  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/9/49cea9302063f6247184938b51e1115d8eea508d.png)  
and upload them here so i can look at them  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/2/b2b372834cda852e1466a24b43b318215c3ead00.png)

---

<div class="post-metadata">

**Author:** ![zixi\_zhou](https://avatars.discourse-cdn.com/v4/letter/z/3be4f8/32.png) [@zixi\_zhou](https://forum.inductiveautomation.com/u/zixi_zhou)\
**Post date:** [July 20, 2024, 4:48am UTC](https://forum.inductiveautomation.com/t/how-to-make-template-change-size-according-to-percent/93436/7 "2024-07-20T04:48:16Z")

</div>

[PCT\_2024-07-20\_1246.zip](https://forum.inductiveautomation.com/uploads/short-url/ffQfv0kElZiqWlebYfc7c3gqKRW.zip) (8.5 KB)

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [July 22, 2024, 6:36am UTC](https://forum.inductiveautomation.com/t/how-to-make-template-change-size-according-to-percent/93436/8 "2024-07-22T06:36:11Z")

</div>

You should have given the RT\_PCT too...

But i already see one thing that is wrong,  
set width of the instance to 100% and turn off useDefaultViewWidth

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/1/5182ac9ed0e233d843cb281b44b58f04d13fa067.png)

---

<div class="post-metadata">

**Author:** ![zixi\_zhou](https://avatars.discourse-cdn.com/v4/letter/z/3be4f8/32.png) [@zixi\_zhou](https://forum.inductiveautomation.com/u/zixi_zhou)\
**Post date:** [July 23, 2024, 2:07am UTC](https://forum.inductiveautomation.com/t/how-to-make-template-change-size-according-to-percent/93436/9 "2024-07-23T02:07:40Z")

</div>

Thanks a lot.
