Well, I think solved for the moment with this method.
```
def updateViewBox(self):
"""
TODO: More control to adjust charts
"""
rect = self.parent.viewRect()
label_rect = self.label.boundingRect()
w_available = int(.9*((rect.width() - label_rect.width())/3))
self.plot_station.p1\
.getAxis("bottom")\
.setWidth(w_available)
self.plot_station.p2\
.getAxis("bottom")\
.setWidth(w_available)
self.plot_station.p3\
.getAxis("bottom")\
.setWidth(w_available)
```
At the StationLayoutWidget class.
David Pineda Osorio
Ingeniero Civil Electricista
Ingeniero en área Geodesia del Centro Sismológico
f: +56 9 82142267
El mar, 14 jun 2022 a las 9:27, DAVID ALEJANDRO PINEDA (<[email protected]>)
escribió:
> Hi Martin.
>
> I tried the setXlink and viewbox linkedViewChanged, as is showed at the
> example link that you shared to me.
>
> Didn't work, mi method to update data and 'view size' is in
> plot_station.py and is this:
>
> ```
> def setData(self, data):
> for name, axis in self.map_axis.items():
> data_axis = data[name]
> curve = getattr(self, axis)
> if curve:
> timelist = [a for a,b in data_axis]
> valuelist = [b for a,b in data_axis]
> curve.setData(
> x=timelist,
> y=valuelist)
> self.p1.setAutoVisible()
> self.p2.setAutoVisible()
> self.p3.setAutoVisible()
> # self.p2.setGeometry(self.p1.vb.sceneBoundingRect())
> # self.p3.setGeometry(self.p2.vb.sceneBoundingRect())
> self.p2.vb.linkedViewChanged(self.p1.vb, self.p2.vb.XAxis)
> self.p3.vb.linkedViewChanged(self.p2.vb, self.p3.vb.XAxis)
> ```
>
> The las two lines are, if I understand correctly, the linked to the chart
> on the left and positionen acordly it.
>
> But the problem can'y be resolved in that way.
> This happend when I put more than 10 rows, so ...
>
> There some more mannually form to assign a % for every item in a row?
>
> Best regards!
>
> David Pineda Osorio
> Ingeniero Civil Electricista
> Ingeniero en área Geodesia del Centro Sismológico
> f: +56 9 82142267
>
>
> El lun, 13 jun 2022 a las 17:58, Martin Chase (<[email protected]>)
> escribió:
>
>> Hola David,
>>
>> Have you tried `setXLink`? Probably somewhere in your
>> `StationLayoutWidget` class, I'm guessing, but it'll work anywhere you have
>> access to all the plots you want linked together. Here's an example:
>> https://github.com/pyqtgraph/pyqtgraph/blob/master/pyqtgraph/examples/MultiplePlotAxes.py#L23
>>
>> Buena suerte,
>> - Martin (he/him)
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "pyqtgraph" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/pyqtgraph/ip_uoZzLTgE/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/pyqtgraph/CAD_p8v2YVR%3DDEC47SuiXR9ndTY6XMza7LyDnTZtvrxs5vG8ViQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/pyqtgraph/CAD_p8v2YVR%3DDEC47SuiXR9ndTY6XMza7LyDnTZtvrxs5vG8ViQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>
--
You received this message because you are subscribed to the Google Groups
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/pyqtgraph/CA%2B1671ktU0g%2BM8CxkAjyUv%3DhcC3%2BkGkS6oXJG91u8%2BLCZD%3DMGA%40mail.gmail.com.